From patchwork Thu Oct 3 15:53:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175117 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp544725ill; Thu, 3 Oct 2019 09:20:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkslsN5l9urWSnHZ+vwg1df5mMo5IY2vaZcLGvJsIaALJ4sjhA75b6qA6iN0j7pg+P34/O X-Received: by 2002:a17:906:e297:: with SMTP id gg23mr8313193ejb.47.1570119635505; Thu, 03 Oct 2019 09:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119635; cv=none; d=google.com; s=arc-20160816; b=KMNby+Eu9Y5ifSF0C23Psisg73ZWaLwZ1M/K1VhZFvIKkMERtxWHpjJhqhfXC8teUq 2ycf4Ue3P58BpMTFTstj2yp+bokX7Qz36JgnAsmpZWKLrPSpqKkHBvTNr6zGT8nH4KcM 3zL7s2c9SAnRfw+rGDsbBdDMSbyQpv8SIJnN7nxbR3ILkaveuqPNGMssqyoNOkGGl4Bs JuM/KwRuEWAGQte37vyQGH/wQ9IKaRhZ8T07piSKkXJ/sfTz05cHXdGVuSnx7g1SvQW/ 55rffUl/3ziNR4wOIq+93TrK2P36xAhsDxrWLjdSNz9rVk/6Q5p8Oewd+a093+QCyNCE 8/+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YtNiCp9tv6jPL6Tl8j8y3bz6AR2tFrlYDEM4Bhl/18A=; b=yJ70HBGDbGDi9IJxQZoRvhVYctSr4l9xzxLqbZhD75KBSBhOBPN0HPeF/P8aiuVG4c seUUCZu7UzHRQMHpEh+SlkP+7aKltb8IDanvRNWF65DjlsxL94JrCQNcJz8312Wtxlld nD/Dn8NbE9X+9ZAc5ssdEzpQWqel12bSvvUXWSk4WWrBad4xcsqJwqFGrWsA2c6TPQhI TCI59Afh/x+9EQy4N/3/x4rS3vJb1A9Mmg2/ZyaC0e719mK+BXxXV5KodQPF4Zcjc6Mc vJW4zcAn2JgpGxL59qKZYk9TEw6kV7hYxUEYGvbGiMFFbjf/Mu17Y8j9vFy7pQvJzMnj 4C7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SBH6riL5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g90si1919517edd.329.2019.10.03.09.20.34; Thu, 03 Oct 2019 09:20:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SBH6riL5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389928AbfJCQUe (ORCPT + 14 others); Thu, 3 Oct 2019 12:20:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:48298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731517AbfJCQUd (ORCPT ); Thu, 3 Oct 2019 12:20:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90DB720865; Thu, 3 Oct 2019 16:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119633; bh=+hiAlNfbSBPF8qKfDkfN4sNImtyxNSb/HIggk7vL2UE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SBH6riL5/qd/BA9nrJf1OjUpZAune74uhhx5DzC0qoPVx/us5Eaj/aXg/q+ch1xkV iGexVsgvcCQRaJs6AkLekpgQM+fFUto3lAqzf+KjljNJJK+ddGvugo48lZ2q5FSQlB JB57GzYXeESN6iFQUrOB82LpGJ1wR6cWNkvYbnio= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Ulf Hansson , Douglas Anderson , Sasha Levin Subject: [PATCH 4.19 136/211] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:53:22 +0200 Message-Id: <20191003154518.185905298@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ulf Hansson [ Upstream commit 7c526608d5afb62cbc967225e2ccaacfdd142e9d ] 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 Reviewed-by: Douglas Anderson Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.1 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 942da07c9eb87..22c454c7aaca6 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3486,6 +3486,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);