From patchwork Thu Oct 3 15:53:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175163 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp579041ill; Thu, 3 Oct 2019 09:47:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcV/T7NgusrHcpQjwua06dgUSZ2SE5Wc/4kt9zwprTytQlf76CznXwH8fUNopV3TFzDz/h X-Received: by 2002:a17:906:164d:: with SMTP id n13mr8569748ejd.75.1570121272019; Thu, 03 Oct 2019 09:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570121272; cv=none; d=google.com; s=arc-20160816; b=l5BI5AvJ6LYN4wxebocZxJKhMSzdFhO7JKEbuNe11+VGIWVoO3bElVHt6/c415aNPD epFbNZCRmx/4A5jtSn5WrXQ7T89SqtPVfiSXDL4cBudgSgYFCtri4y59i9sAsvbIf30+ 2YYbGdJAvQZT7OT+DqLsaxH+fHHVG/ncjRChywJxUISiS30hNt7mTURzNK7ggjRP9Thl J1ohWAE0UPgbqTC9Ds2RtAw18WxGcSxCYW93xxb5/TH6SjaR+Z2e0lz6gjrWmca9Ds5A cIjeqTgStx/Ie6v5Ya32W10hzaybKEoBYWkMhPFTuicL1H/OeNrx4ibifSFNApfEd/zB +p1Q== 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=dZ41bbHxLff5p0zCXST/a9g6Cmr6W9+L9hwnnBzBqxk=; b=0Ewy++wGgPMYxgNZwkiMD8E001ngyQUh2cwJL+EfCt2cH9nrB6TFCxJl4SYCVNSnJx 8gg98yPmKzxvw2K2LP4/w23124jqa1aEHtiJM8yjIs4rfsFz7ZqjUxQPOjKp4pLmJ1PR 6HD4LqMrsWiP0IX2XZTY46k5NTk3CxIIX8W+FXGzU0s7rBhilFktle1y3+1vq5chzssv drhEvBQ1oOtAp2DWpGEzYrtN36w8imwyqa5oulSsOb7z44CeBRTZoCvPSI5kv7jg+v12 3d0fi+TAPqDuD70hzhzpDuNHuSjLfnjr0CH/4+NqP9nCxojZMAWc5Qz1KMnPZZt6n//I EKGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="URh/Ae/u"; 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 96si1870300edq.24.2019.10.03.09.47.51; Thu, 03 Oct 2019 09:47:52 -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="URh/Ae/u"; 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 S2405549AbfJCQrt (ORCPT + 14 others); Thu, 3 Oct 2019 12:47:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:33284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405551AbfJCQrs (ORCPT ); Thu, 3 Oct 2019 12:47:48 -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 0ECFC20865; Thu, 3 Oct 2019 16:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570121267; bh=seL4JwafJp8UZCv4oDKz5AUomDKOVrqUXEXpQSwlfAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URh/Ae/u69Hfg7sZKSAV9dZP9RNXyqPh7Abwb0QU2zWpZ8fEpL+B7j3ThG9hXvKLF 4wYA5OpFEoGNynmMeNicLBg6Qnbi3eqfEEMy2qDW5TGr2C1g+ZydzL1NTCj8LGKCJ8 ZEnfB+7Zd0w8SOFnTNaiPNc4AeFCs9ycxA4jOpRY= 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 5.3 215/344] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:53:00 +0200 Message-Id: <20191003154601.506214005@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154540.062170222@linuxfoundation.org> References: <20191003154540.062170222@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 eea52e2c5a0ce..79c55c7b4afd9 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);