From patchwork Thu Oct 3 15:52:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 175137 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp560847ill; Thu, 3 Oct 2019 09:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNGmu/TAM7OH8Om/ALN/o6i4pkdATwnrSiZP3pXX7WPq1hBXG9MfzUUW2yvi50FylBc8Sy X-Received: by 2002:a17:906:4e8f:: with SMTP id v15mr8794256eju.57.1570120368139; Thu, 03 Oct 2019 09:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570120368; cv=none; d=google.com; s=arc-20160816; b=M52lcHk9PJrojdiY2ylaULzYL6jmKpaaqlASD865YjhLisBMoWK5yJ5tRflaXX71kO FLDh+qUeGOWHwHpyaOSeKehqzawfQuaQ6isdlht4680t+OLgvtAi727V/i6ZJdIapRgq 5eyeD9L/btvtYpXlvjOISnQuCDKa/ZxAP3rn+ehL1nKMGDFXa3Fx3ubrpxIY4IZMc0Xs R0hevlBSOX6WRiQpCYih0460GQdh/lRCv4HqNZmRHre5h82C4G2NuMKiIBiuW+GD0WYg D3U+kOLqkMwAOUEY+ojGg5HsLvCqBzsz2MNR3VmGSAPEg1KTXqwzhcXD1B6oP6tWH+UG gmqA== 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=twL0NtANoeCEZBipKUdYfJWrb9I+gusiWaczR/Q+l6w=; b=aGJ2JvQlqSMpJIBWlV11M6eesgkMDKROK9LabDC9cLZ2u5v1Av5lpXJoGU2AxCl0Fy GDuiieppKL1ipWYT4Ak/KsNOaJqupz0UXyxvplA3CG4zevtrn9vM5JxiPIT8oudngyhN +7uBtV8tLS/7k8TUubp0Cmn1GWlrm5s6SqG0xYKHWRYxEoBmqUQ85mIrZ0W3WV2UjHnn FqM+8M6g52GyDJIqCdnj6aGWzxYeJHz1Lw2W/CMoZbxWWDrX8ZfG8+i6DABqbMe2AoZH LN1NGAVIGHrQbzWhbpb72RoDcAcuzWcOQuv+f7QQleU7rz/WzP7vVwuqu05U7lcPKbig JE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pJPdVEJ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 h15si1937032eda.284.2019.10.03.09.32.47; Thu, 03 Oct 2019 09:32:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=pJPdVEJ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391954AbfJCQcr (ORCPT + 27 others); Thu, 3 Oct 2019 12:32:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:40420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391132AbfJCQco (ORCPT ); Thu, 3 Oct 2019 12:32:44 -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 315872070B; Thu, 3 Oct 2019 16:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120362; bh=8zGTGHMcYcZ5vPDHzmRtC8gsvJEvulmKyj4ydCxN5i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pJPdVEJ+fLf4XV3TRHQd4Y1q/js8wt2ElNWZstBC9gXOS5tfPibcJ5z0qrC0+3VcL 5CRQD+05wXUui5m3BvMiwBFUDTtUzQhr5Q0h2/GeIZPeDEOqJLoMYO/gzfAlEQXqzJ M8k1CztFsqayDFkeHaRKuQ89MypxQNt1RyVv2M9Y= 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.2 193/313] mmc: dw_mmc: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:52:51 +0200 Message-Id: <20191003154551.988411764@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154533.590915454@linuxfoundation.org> References: <20191003154533.590915454@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 60c3a06e3469a..45c3490546839 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3482,6 +3482,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);