From patchwork Tue May 9 08:27:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 98887 Delivered-To: patches@linaro.org Received: by 10.140.96.100 with SMTP id j91csp1708418qge; Tue, 9 May 2017 01:27:42 -0700 (PDT) X-Received: by 10.28.234.221 with SMTP id g90mr208615wmi.103.1494318462178; Tue, 09 May 2017 01:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494318462; cv=none; d=google.com; s=arc-20160816; b=ypuwunYMoSIn9XMIX9IZvsdeyH6J4H6TrEIHB9JVF+vSSEmQbg0y0DNor8H/zM+foQ V5AGlySV1vF15IJA8XGS8aEni8/015Xoh1B1mDlmjxidQoBOvLMEInau8wyPPse8FZXY Q7WokoVX98QdEXjQ2px84K7bW0BYOcS1KXj7OR/Jah3IW+ujATqjX8hLPp/O0MvC1Ak4 +FGVF7/ZzOoaOx3rqDi73dH8WZAfoI/NQ8ju/rvkLdlXFid3eSQ4OGcyb9MgQZxuvk2k l3qxFj8aki5/BLp5YPDWNuB914uWVg/bGAGFs0DzVN4dkv8MHGKDCd7T+MEs5BzSScaM KGZg== 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:arc-authentication-results; bh=/DWWEocq2Gobi94tFYveTkvcWrxTiLFEApPWvJAP64g=; b=Ndp7vKCU50LZU40Q2yMCqF058xmnDaBfQV+vZK+WEZfAwMw2dyZyWIs99CBLochq2q vG+/oZyhybs/qCE2F95fHLwXpVj6cj+rYRRVOGkg8TLTeHBLWrjm7oVgNupuRSqEjfIL /lENXs2hpd8fkk4tx61lIJgbXko54SJVW3cHHdMHg+n5Ce5r5Gyr80jp7HVTPKIvbW+n j9U6JkqzYEgVKxsroYhUQ5ANZ5ZPRgqVxY7j3ImhhtY90OWEtqsJUNmITdsMUGZ7kvBw qLOpIvhsicItHttlzquIUbz5kdmMcSyoE8P9beJyY85nO/BkXZEshudkPWEI28Q1GhQc Jb2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::236 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-wr0-x236.google.com (mail-wr0-x236.google.com. [2a00:1450:400c:c0c::236]) by mx.google.com with ESMTPS id v8si195817wmg.95.2017.05.09.01.27.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 01:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::236 as permitted sender) client-ip=2a00:1450:400c:c0c::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:400c:c0c::236 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-wr0-x236.google.com with SMTP id w50so63347048wrc.0 for ; Tue, 09 May 2017 01:27:42 -0700 (PDT) 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=/DWWEocq2Gobi94tFYveTkvcWrxTiLFEApPWvJAP64g=; b=Hka0cJ5vbGhF2sQXmZT9Xd1kYQKiYS148+4lKIPTTwjYsneUyqkfvw+cjmB2obW+0y GYN6w29BSiZ6SOYOk3aKFLdZb9xxM3aE5MisbjEZzSLUX+MhpZ9kFmxXl00wPF0awR8k TXgQ1zY3B74a20HSvS2jQ0ou7p/Iu1tgWgWps= 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=/DWWEocq2Gobi94tFYveTkvcWrxTiLFEApPWvJAP64g=; b=KADhA19b9gixNVgRYbcwRboxwIbRjvdAXkMTNcTIQYbpR0QjcSImy1KA59EbzoF91a Is2mLDO4Wm8Ok7ZZe1sI0BYNCYqrOvQOjg8H8o1uUPantWAtjaz+0YQwS43vjqb7Drc3 Ilc5KWfu73cTJpKnhPpYoA+QdIFtOsUCTnpjRY14luSxKvz/2fMuKiVu5SlYVc+0lexu E+NctbhNqYe2LbmHrqJrmELWSf8uTaW7eAKSCJ03o6lqORSNb7QUn6A/KhHVmM51L3Zt 00Gi3d0vJ2gwrNgLmMoy0Oo1IBJHS/fiHwQwqggFmnI05JBJG9FoAPzZUSKtB7Kah3Qh blHw== X-Gm-Message-State: AODbwcCQnJyZcs7OGcgeLJL0a2Y+RQvL5tGbrVnZFvcqN7kVIXhIqDVT VNBsvDEZeQfgg5WX2oo= X-Received: by 10.46.14.9 with SMTP id 9mr8547201ljo.27.1494318461763; Tue, 09 May 2017 01:27:41 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id o21sm3151108lfo.34.2017.05.09.01.27.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 May 2017 01:27:41 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Brian Norris , Shawn Lin , Doug Anderson Subject: [PATCH v3 5/5] Revert "mmc: dw_mmc: Don't allow Runtime PM for SDIO cards" Date: Tue, 9 May 2017 10:27:29 +0200 Message-Id: <1494318449-2591-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494318449-2591-1-git-send-email-ulf.hansson@linaro.org> References: <1494318449-2591-1-git-send-email-ulf.hansson@linaro.org> This reverts commit a6db2c86033b ("mmc: dw_mmc: Don't allow Runtime PM for SDIO cards")' As dw_mmc now is capable of preventing runtime PM suspend while SDIO IRQs are enabled, let's drop the less fine-grained method, which is preventing runtime PM suspend for all SDIO cards - no matter of whether SDIO IRQs are being enabled or not. In this way we don't keep the host runtime PM resumed, unless it's really needed, thus avoiding to waste power. Especially when SDIO IRQs is supported via a separate out-of-band IRQ line, which isn't defined by the SDIO standard, typically the SDIO func driver doesn't enable SDIO IRQs via sdio_claim_irq(). So, for these cases we can now allow the dwmmc device to be runtime PM suspended in-between requests. Signed-off-by: Ulf Hansson Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson --- Changes in v3: - Don't remove include of pm_runtime.h as it's needed. --- drivers/mmc/host/dw_mmc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 454b847..0e2d6f7 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1621,16 +1621,10 @@ static void dw_mci_init_card(struct mmc_host *mmc, struct mmc_card *card) if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) { - if (!test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags)) { - pm_runtime_get_noresume(mmc->parent); - set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); - } + set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); clk_en_a = clk_en_a_old & ~clken_low_pwr; } else { - if (test_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags)) { - pm_runtime_put_noidle(mmc->parent); - clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); - } + clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); clk_en_a = clk_en_a_old | clken_low_pwr; }