From patchwork Thu Oct 3 15:53:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175164 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp579150ill; Thu, 3 Oct 2019 09:47:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxr91GpI4fHV1uc7Gs7YOgW6+VR59fOavx3cs+xnjIHJagAaoQfVgZB9GuXioEQET0qOjM8 X-Received: by 2002:a17:906:d04f:: with SMTP id bo15mr8766152ejb.296.1570121277351; Thu, 03 Oct 2019 09:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570121277; cv=none; d=google.com; s=arc-20160816; b=Y7cKqV4aJKSIt/ryh+GtHKRak93uTAMB/T+OPmTFxU9BJW5yr/7jnfVG2aOMBPLpHa Zk/m4j80+OoHrU3OPIs1ROfg9WlitK2QCvyDPYn7Ca9N9h2nm6JnQ/tl2ZRrNnWse7ji CV1vsdIUP6Tiw7BBTAoiakkQfnNFkjYQa2k4VXFePW2GLWW9anGwtwtlGYyPAArS7F/k 0LR6DDp8rO6l50wgr8dZa39u9ZuX55RPziAbw4/SRurcgL1YVCh3XfgTadiQzuh//O4C eZzs7+4f7K0q2wL1t/gGDF5xJI5B/wjPtr18vz+OgEb0KOaZygg3RRMvESW4ubj06t1b A/AQ== 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=7xusYlWhFKzzWiCXxRIOQvSBsEVKu1kjtnfarMQ9cYQ=; b=E0xp71LIbSUExM1KQzSy/PmFip7r4Xmj8bajU+UdUGTZgesnWRNkFrB0HMWv7TlSm3 zvwJZ7Ll1vAG/C9KPWLX5EQcU6HzOYUbGRHDVnYMx9Cd2p6FfiLtXIc2nobTtl0JPXV5 rPhWmDMMxNNU5yZaX13ZBvxyH8H9TGhrfEv2kGVX7ic5aRkV19cNAVYe47B0ty4YZR4X xmr0e2Lep6YfVJtstv+6x4dmOVw3eFCwk2ogS8Lfu952M16UqfEz8DCtC+wMsB3nbkWT KrT+N3YGyMW9vmmlh8Cd2sT2lwtkueRlLV7ME10dKQpOya8VDQNbVYgnHAaVmmlHdswL W31A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SoTAn9Hr; 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 m5si1518474ejr.125.2019.10.03.09.47.57; Thu, 03 Oct 2019 09:47:57 -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=SoTAn9Hr; 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 S2393041AbfJCQr4 (ORCPT + 27 others); Thu, 3 Oct 2019 12:47:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393029AbfJCQrx (ORCPT ); Thu, 3 Oct 2019 12:47:53 -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 657A62070B; Thu, 3 Oct 2019 16:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570121272; bh=dWZQeEXELj4oPCyvPKatzqbyZkyD3e/BEQa+Mm6YXN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SoTAn9HrRhsSoLMUk8f8k6rBCr6FmUQJ0xSRpQ5IzvqhK1TXz5c6ntP3/tYoi/9mj HNgXSEZOgxyaV1L2+3ZIs4JA4LguYlhq7GQLP4oy6KWp0yUKz9EA6UQ6qICiq+7j8J PLza7exYPTG+sOLaq/EsmWQQxxz/j1C1EMOPz+9w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Sasha Levin Subject: [PATCH 5.3 217/344] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Thu, 3 Oct 2019 17:53:02 +0200 Message-Id: <20191003154601.711711454@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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Hansson [ Upstream commit 1c81d69d4c98aab56c5a7d5a810f84aefdb37e9b ] In cases when SDIO IRQs have been enabled, runtime suspend is prevented by the driver. However, this still means msdc_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 mtk-sd 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 mtk-sd 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 mtk-sd driver, so let's do that. Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/mtk-sd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.20.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 33f4b6387ef71..978c8ccce7e31 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2421,6 +2421,9 @@ static void msdc_restore_reg(struct msdc_host *host) } else { writel(host->save_para.pad_tune, host->base + tune_reg); } + + if (sdio_irq_claimed(host->mmc)) + __msdc_enable_sdio_irq(host, 1); } static int msdc_runtime_suspend(struct device *dev)