From patchwork Sun Sep 8 10:12:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 173337 Delivered-To: patches@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp3002982ilq; Sun, 8 Sep 2019 03:12:45 -0700 (PDT) X-Received: by 2002:a2e:91d9:: with SMTP id u25mr12016579ljg.85.1567937564957; Sun, 08 Sep 2019 03:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567937564; cv=none; d=google.com; s=arc-20160816; b=fqFiQudH3sGUZM1FpwjGnUK9B639zVHVIIawnL9XrViIqeTD5goRuQq8jmm0vusHBm Jzy9h8YVAhrPFeTVwHFY6jVJ/VW5s15bfkaggDGC4j13wgQrPj65KmGzkY8eN39hOCK3 kU1c1Etz/O6p74JAu2dvGu3xZcGGgdK6ju2ok3hhb0Lz/gDmVXM7IrE1v8vqUWV0lsqi DyUgZOVwvi9g9WFqZ0CS4SnifdR3K7CkLXZ2iU03GV5H8unAS0DGKugyzruZQUKQNWEB JSe79nH1SxbKF5nzVE/7/dMv5H0wUEMnLibk655o1OJ+ZUcpfQDSIRhUlNJR09FQaWbn intA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7+P+cYx230fGzdea2f5uH2L1U7ubNclgEZwd45XPj+c=; b=h4b0BYbYKiDJv9f2Ub+tH2I56mxbMn1fDUpiH6hfC3HELFSKle/r4V/GonTJiIHDZp USAWzn21hgjMoC0j9dRd8o7rrfKRX4kYgf22EdWLyNadbesqzFRbVRhLwKMCn1g+agXj wUa09ep2VcdvaFFHhMKZ/E4sjdOtltDYQOiQuLrq5ek4DaiP3wh2erScfBAO6nyDmD2z ywp9DB5bSa1yMdDy7ycwotNRqa7/8ypHchePHDMAA6YrNmGyiywdKW4/hWMyKDGiyIEm JgGR+xgzJUCCe/xLJ2AyrhXqt5inEkthSrL6ywh4dk5BAI6Zj7iQpXstV+xx3g7A1BTX IxyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuIWFNy4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z12sor5646854ljc.0.2019.09.08.03.12.44 for (Google Transport Security); Sun, 08 Sep 2019 03:12:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuIWFNy4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7+P+cYx230fGzdea2f5uH2L1U7ubNclgEZwd45XPj+c=; b=MuIWFNy4Uu/WuQujI3WpAnPQN7hQjKKrIACQtyJmDl9F1BuOgykCmjH6TEkGxO5kO0 1r697iLCtkg0JGaT6SPeg/4Z6qdddHsW02ee6t2vqK1f2ou42EqQ4LblJy7Vmj1t5iV2 rUB+qTGNpoR9VM08EoU+/of9I3Zr+iY2+i2RSikrhZPEp551ZDnIW0kYxmZiwR5TL6Qp zArFDlzIksZN+FzgPGi9LAWJP/GMEV71AfbGi9N+RX4poRuYhEYHcApF3n6Ol7k7Le6B NGiDjUxneaOf1lHy5+ShuMbBz7pktD3jf7bDJIzNGJDOHYEo73Qn0+13/WlyCvNWm3C0 DFAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7+P+cYx230fGzdea2f5uH2L1U7ubNclgEZwd45XPj+c=; b=E9n3dYlfXHnrpmTPfAQ0Yzu5MaC4g1OrPg4VCULrkxqP89Xil+8W7uBU7wiDpgdI7k BIRIev4CvTXtOnOG3NpGxFMUIIExIHcxN1oqvii1MCL//4mjFTPNJNMme9u8aFGUox9J Xv+8vyEvgaeovgI9dpmv6r0ZpWNbb4+jsH1Rxs2g6a7onmCuuE5zWwvGf9K2EEr+syry Lnlw0qu1Aq2DvdC65s2EoKvsXav+493oGK/kya9uFylAOTFmdEbIQlnFWCUMUW87DJmp U5ZrAY15HN2GrqR6sZNeI3uPF/5t3GhnUPxyYmDERMwVvrnvR372MFJCn3z4q1bcg1S7 Z3jQ== X-Gm-Message-State: APjAAAWfpvNmVrDwKErE8fAWjZ1SVB1XdiOGvFCjaE/ir7C0TEf+OsMy OW45DfXO+hsExroUK2L9JfUhwWcK X-Google-Smtp-Source: APXvYqyeDghhAOKZpDvXuAhHjLZvljJG/Qs1XijQtmIcegh9WgeMYfGtbWrv7shtlHbwygv65v7kKQ== X-Received: by 2002:a2e:9e19:: with SMTP id e25mr8211035ljk.152.1567937564569; Sun, 08 Sep 2019 03:12:44 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([185.122.190.73]) by smtp.gmail.com with ESMTPSA id h25sm2444849lfj.81.2019.09.08.03.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2019 03:12:43 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Douglas Anderson , Matthias Kaehlcke Cc: Shawn Lin , Jaehoon Chung , Yong Mao , Chaotian Jing , linux-kernel@vger.kernel.org Subject: [PATCH v2 02/11] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Sun, 8 Sep 2019 12:12:27 +0200 Message-Id: <20190908101236.2802-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190908101236.2802-1-ulf.hansson@linaro.org> References: <20190908101236.2802-1-ulf.hansson@linaro.org> In cases when SDIO IRQs have been enabled, runtime suspend is prevented by the driver. However, this still means dw_mci_runtime_suspend|resume() gets called during system suspend/resume, via pm_runtime_force_suspend|resume(). This means during system suspend/resume, the register context of the dw_mmc device most likely loses its register context, even in cases when SDIO IRQs have been enabled. To re-enable the SDIO IRQs during system resume, the dw_mmc driver currently relies on the mmc core to re-enable the SDIO IRQs when it resumes the SDIO card, but this isn't the recommended solution. Instead, it's better to deal with this locally in the dw_mmc driver, so let's do that. Tested-by: Matthias Kaehlcke Signed-off-by: Ulf Hansson --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 Reviewed-by: Douglas Anderson diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index eea52e2c5a0c..79c55c7b4afd 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3460,6 +3460,10 @@ int dw_mci_runtime_resume(struct device *dev) /* Force setup bus to guarantee available clock output */ dw_mci_setup_bus(host->slot, true); + /* Re-enable SDIO interrupts. */ + if (sdio_irq_claimed(host->slot->mmc)) + __dw_mci_enable_sdio_irq(host->slot, 1); + /* Now that slots are all setup, we can enable card detect */ dw_mci_enable_cd(host);