From patchwork Tue Sep 3 14:21:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 172796 Delivered-To: patches@linaro.org Received: by 2002:ac9:5c4b:0:0:0:0:0 with SMTP id r11csp5641326ocp; Tue, 3 Sep 2019 07:22:36 -0700 (PDT) X-Received: by 2002:a2e:9a84:: with SMTP id p4mr19930625lji.52.1567520556500; Tue, 03 Sep 2019 07:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567520556; cv=none; d=google.com; s=arc-20160816; b=Ua9dWTu21NvAR4gFbNOjRSU5sFSac+HpBMfkaaCcftrOsHq392MOP5lG60Kwab537P B+RiOTo/OHkT/u9O36MrSCIG1HqRTA5QnDSUHiFCT8cIzAow6xNa3/AUCrlnrGmvzjBs pf/Qs6Ifjgbrm5gD/Do+F9hOAZrmx3n1PO35iqocTYxq0FXOpjzfH44A2YopSwY0Mec3 3LvcWsmR3FiycIRuWDGZhw6nZKrLyKZWli7flyTbWfds9USxDrB8BK/Zf01wN7IHGlMF qQQtY/LHVs3/A6TVeFZfy9d/aPFzh/w2GOkIR/kxTP6dWKaOl+0CGfh/B/5qCFbz9CDk 00FA== 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=SADru+zeJoUa6Kq7NgE3oCMhDB2qphP6ONJw4NgANKU=; b=UCEeiQiR1ztnkfHP6O6yQWDixOv45/sMKRQllDUXImJlf4L3zDo016HbIyOsRoJM9+ NtkmoediNKiyQnF1hNSpy9wQzRqYGJ2ve1vby68FeBy2+Oyd0Pp8lNhpMAlK8wp548Dq a/GtIuqatNMv35Imb4UPzbb1TsVIxXB5mDsPaDU+VBljfnfiaXucYa9PhTudKHS31ZCu uMFUuwlxNapBdv0rPx0X1z3gPoKfNxGCBYKhOyPMP/j63sbs26fGdWHFSp8quP3fKLwc un2n9y/KtIt7Jp3kCk/o1UCLnUUCgsv6dsK8SabS6stlAZkJCL48zkuv4P14jiu7GrGv qyvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFHtfa4w; 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 m17sor4908480lfp.48.2019.09.03.07.22.36 for (Google Transport Security); Tue, 03 Sep 2019 07:22:36 -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=OFHtfa4w; 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=SADru+zeJoUa6Kq7NgE3oCMhDB2qphP6ONJw4NgANKU=; b=OFHtfa4wufhXWOWb3kQTUHd0i9YHGWH7vS4YpuePByo1apgcQx0qPn5D2rDAPelA2Z c9AFN0rmRl04Af4morxrZ3mOH/6uAa5o24p5hlLofES39wmRTB39cuKWKsxsRbwOPueA DWKNvjHA7bcEZ1WnlxtbCacM07rt3dqTsZp4a0qXvTQeCR28W5+16F2Hu7sZslGhNe+2 /aLGk/irsE8VSg2imBO3LXorORY3s5UnmKKS0pZ1Wf/Tcs/Byda5X4A+tL6KlvEDpHqt vHpl86saT3X7iGXCPgRyUtq7iDDP1IjtuQWaqjKo5k1t5UqNlEovBQ6B26wBM3t7/M3q dWQA== 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=SADru+zeJoUa6Kq7NgE3oCMhDB2qphP6ONJw4NgANKU=; b=Q8POMCOT6jfQIvS/V/83EKsWeslBkiE12JFzsp5f6DDxyRDkEvrG7BsW8Rd9qap2HE zNFKLHA+baQ8YRrP7Ol/f6/L5VkKc2AhOMJ/CU39cs4xleRG6ow3/ms9+6B2etrETT7w 2pTwjJnFe+6LZfPgFg7JaGroJE9tzmYV/zKNt48ela2wdV3tS91p2PkHxlGP0CVV0rbf rSRWZUNtRj78meHHGBnSeWRanaO9Dj2e1a3PLpzfoXM5c8O3EpNHewvxIVjFmMr+Wdk1 M1HnzM7C5LEQAeKWcNOJPJWN4tN1wK1EiMuv5TdyHw6qrRKYpmNnQqLtzrrOOotP5To1 NWLg== X-Gm-Message-State: APjAAAUwHWFaqJ8MNBPLCxARfj7ixs1Ud1kJgSZQeEKfra6wun541eNl EEa6ffWWtO35wYkkUNTF9200Tvxe X-Google-Smtp-Source: APXvYqx/2ml75qZUvcITEBML+/VXCJWVUP/iHChuBbmOfuQX/0u72UoOykubRwkl0ub8F7RLyPaLPA== X-Received: by 2002:ac2:4906:: with SMTP id n6mr451699lfi.81.1567520556123; Tue, 03 Sep 2019 07:22:36 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v10sm2430862ljc.64.2019.09.03.07.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 07:22:35 -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 02/11] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Tue, 3 Sep 2019 16:21:58 +0200 Message-Id: <20190903142207.5825-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903142207.5825-1-ulf.hansson@linaro.org> References: <20190903142207.5825-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. Signed-off-by: Ulf Hansson --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index eea52e2c5a0c..f114710e82b4 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_enabled(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);