From patchwork Tue Sep 3 14:21:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 172797 Delivered-To: patches@linaro.org Received: by 2002:ac9:5c4b:0:0:0:0:0 with SMTP id r11csp5641361ocp; Tue, 3 Sep 2019 07:22:37 -0700 (PDT) X-Received: by 2002:a19:6455:: with SMTP id b21mr21194938lfj.167.1567520557688; Tue, 03 Sep 2019 07:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567520557; cv=none; d=google.com; s=arc-20160816; b=KeMsSwtwHRiJMbHsXXxSDLQUKrpAjLWOg2osjBKESu/gyvRPJoi/gaiJTIj+jCIEdD k70B7fT35tYCqt9zDWbCLKnzlJYVryALkN2hUB0qwQ6WlvMcBaRi0EcOpDNScphMB0gx PMgmq+Fid1xjvH2f3twaH2uw6emsPlbHj8HVDR6X4EQHtUsGBHIKneUhnjIOECBdGQKu xhMo9+mkcxio+DEgFqjh2H1BndGswgkXjWDiYog4oHTLPukKaQNi3u4xyWtBpv/Iok9B uivCaTEdGnGZVQVcKlvExQ7slodVX5VgouiByyDUvrG5G9Y9TzDuF+r6yC5daMQ0giHK I6+g== 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=0NvqeeJAxqM9LsjMwddoa5m6zhHcHlw9n+K/8LgxXIo=; b=UthD7uqUgTHzRL7wuOMGkTngs+qQxFDVlTrZmH/VmS4zzCH/Rz5/oi7mTQ06Ls3+T3 jXH3eVevliWuPYXFxGpMvvvhrr2cAyRGQ0OQuobSuHRVr2ijoZaKngCenO2OjaWKUmX6 xmLOnwhhWDxFrAkA5IVwpTpuRwZq9x9ofUwTOLEQdtQnxRXnm6SCISGthQkHKhfQI5rs R3WC+b6G0i4nUWjIyk2190oLAcbZ/F4se43vbQ47BI1S8kr20pxCzGreVbZ7g7Opmc6Q K28tKTLzA5mJqvyro6fxwaz+VfJIfOrJSbutlgPplJUGiswVDAqXnbcWcoyBimJkHxOX yR9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dr8gEgTB; 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 u8sor4948766lfc.34.2019.09.03.07.22.37 for (Google Transport Security); Tue, 03 Sep 2019 07:22:37 -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=Dr8gEgTB; 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=0NvqeeJAxqM9LsjMwddoa5m6zhHcHlw9n+K/8LgxXIo=; b=Dr8gEgTBXp1w4VtAi4Mg6OCCy2rvOuKA2OxrnTOj+lxUU6Y5Zr/e/LiMXo9c/gTVMj dimHRhhs+yp1gkbZp4z0mztJjWrv3WJBlxkhrla8bsYlzwEUe4f1j3+POiAD3wnTTDu0 ZXSwSUnivY32b9fKF7b3hLCaNRrkTSAK5o/qkfMGdNnVK6jI/byKgyQLIFIy00GkkTiB uPgncVJ8PHuhJVF+6MiyqQbwg2bwS+dUntVWLDg+RUJc61GM/Bm5LkB+XtwrREL0QX0R VIcIjvZ6WYdM4CJ6ZIHN0AugBpHZS696oD4v4XD1agn/DGhqtNf2KkEuLA+Gw6HZccSl ttfw== 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=0NvqeeJAxqM9LsjMwddoa5m6zhHcHlw9n+K/8LgxXIo=; b=d5Tf+7owt3sYaSZQ27U4eqxrw65iIasGJPYkt6TSr7M9h3VOI/0PuOVID22cSdTiQM 49/u/LboI47n2gs7kYuaqHv+CMNSWJCnjDi5zhXImUv4SK/xg8kxKLOvFyHl9HGzjiCc yHm8y6TfOFUHZsViLJ5j2Lj8gzuZ2bQdFNZd86GZ4oKL1BX9laN1MmeMQK94TvowEh56 fjOD60vzBftqNkjgyrr0aROUHWlGgdvY7F1Zc8zJjMrPjFDhCabXlR/fIPn7ERGYX/Ag P3Gz1ZXT27+rpc9JKSqCdNlZgBnBltbkSA9CWus/W3RaOJZnPk4oO1QwyyoNzdNUjvsL 11fQ== X-Gm-Message-State: APjAAAVpxnd1BFpWJx9XdDTJnJBzH28dZYymzu1PchFu66sngPrUFPdu ciHED2Bcdl03l54GWF0Et+eouNCBO+ILDA== X-Google-Smtp-Source: APXvYqweF7JPxx3cnV/NebwZQV+1f/Ir2g4Sh+rI5IK4GEBLjBEWnZeSOmycdTJye0f6h/XH6sRvAw== X-Received: by 2002:ac2:5485:: with SMTP id t5mr18239629lfk.27.1567520557351; Tue, 03 Sep 2019 07:22:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 07:22:36 -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 03/11] mmc: mtk-sd: Re-store SDIO IRQs mask at system resume Date: Tue, 3 Sep 2019 16:21:59 +0200 Message-Id: <20190903142207.5825-4-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 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 --- drivers/mmc/host/mtk-sd.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 6946bb040a28..669ea0668159 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2408,6 +2408,9 @@ static void msdc_save_reg(struct msdc_host *host) } else { host->save_para.pad_tune = readl(host->base + tune_reg); } + + if (sdio_irq_enabled(host->mmc)) + __msdc_enable_sdio_irq(host, 1); } static void msdc_restore_reg(struct msdc_host *host)