Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754959AbbHQL0K (ORCPT ); Mon, 17 Aug 2015 07:26:10 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:37671 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbbHQL0H (ORCPT ); Mon, 17 Aug 2015 07:26:07 -0400 X-AuditID: cbfee68d-f79106d00000728c-b9-55d1c4cd475d Message-id: <55D1C4CD.4040200@samsung.com> Date: Mon, 17 Aug 2015 20:26:05 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-version: 1.0 To: Michal Suchanek , Jaehoon Chung Cc: linux-sunxi , Seungwon Jeon , Ulf Hansson , Maxime Ripard , =?UTF-8?B?RGF2aWQgTGFuemVuZMO2cmZlcg==?= , Hans de Goede , Chen-Yu Tsai , Arnd Bergmann , linux-mmc , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 2/3] mmc: dw_mmc: simplify the SDMMC_CLKEN_LOW_PWR logic References: <3d03bfe2c18789eefa038018467c9c63c94ae4a2.1439381423.git.hramrach@gmail.com> <55D13F07.70309@samsung.com> In-reply-to: Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWyRsSkRPfskYuhBqcmKlj8nXSM3eJS5xFG izfHpzNZbF/HYnHjVxurxabH11gtLu+aw2Zx5H8/o8XvR0BlWzftZbb4cP8is8XxteEWPw+d Z3Lg9fj9axKjx4ZHq1k9nmy6yOixc9Zddo89E0+yedy5tofNY/OSeo87S2axerzfd5XNo2/L KkaPz5vkArijuGxSUnMyy1KL9O0SuDLO793JXNAgV7H/8jPWBsa7ol2MnBwSAiYSXyddY4Ww xSQu3FvP1sXIxSEksIJRYtP8Q4wwRbM7DrJDJGYxSszrn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QLpZRPQkdj+7TgTiC0qECZxZkYHC4jNKyAo8WPyPTBbRCBA4tG9 V+wgI5kFJrNIPF59D6xBWMBH4tbh82BFQgKvGCV693KD2JwCwRLdN/4xguxiFlCXmDIlFyTM LCAvsXnNW+YJjEBHIqyYhVA1C0nVAkbmVYwSqQXJBcVJ6blGeanlesWJucWleel6yfm5mxjB ieSZ9A7Gw7vcDzEKcDAq8fBq/LkQKsSaWFZcmXuIUYKDWUmEt27lxVAh3pTEyqrUovz4otKc 1OJDjKbAIJjILCWanA9Mcnkl8YbGJmZGlkbmhhZGxuZK4rz6JptChQTSE0tSs1NTC1KLYPqY ODilGhjXacmcXlKbmP74yyf38MQrgRMc1h5RvN2+5kWDs82P9b+PfAvzXe6VLqZfEuTEHlP3 5YOA+OGQUxy3t6+cVVqtwH812Uzosa4qx4LwL50sC1+6Hmhq02O2f84rYePw8oCiiYKy/Q6b wq7JSf6nXLj+sClOOjfphPEnKa+Awq3b66YaL43W7VNiKc5INNRiLipOBACYFJfgOgMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3981 Lines: 109 On 08/17/2015 02:52 PM, Michal Suchanek wrote: > Hello, > > On 17 August 2015 at 03:55, Jaehoon Chung wrote: >> Hi, Michal. >> >> On 08/12/2015 09:23 PM, Michal Suchanek wrote: >>> The driver has open-coded test for SDIO cards. Use the mmc core provided >>> MMC_QUIRK_BROKEN_CLK_GATING flag instead. >> >> Did you use the clock-gating for SDIO cards? >> Doesn't MMC_CAP_SDIO_IRQ bit set? Which case is broken? >> Could you explain to me more? > > The core flag for disabling power saving is MMC_QUIRK_BROKEN_CLK_GATING. I understood your intention. And i read the comment into mmc/core/quirks.c I will test SDIO card with this patch. Thanks. Best Regards, Jaehoon Chung > > It may coincide with MMC_CAP_SDIO_IRQ but that's different flag for > different purpose. > > MMC_QUIRK_BROKEN_CLK_GATING is currently set for all SDIO cards except > for cards on a whitelist. > > I don't know any particular SDIO card that has problems when the clock > is off and does not use an IRQ. > > Thanks > > Michal > >> >> Best Regards, >> Jaehoon Chung >> >>> >>> As a bonus this may enable clock gating on SDIO cards that are known to >>> work with it. >>> >>> Signed-off-by: Michal Suchanek >>> --- >>> drivers/mmc/host/dw_mmc.c | 33 +++++++++++++++------------------ >>> 1 file changed, 15 insertions(+), 18 deletions(-) >>> >>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c >>> index 40e9d8e..3bc9fd7 100644 >>> --- a/drivers/mmc/host/dw_mmc.c >>> +++ b/drivers/mmc/host/dw_mmc.c >>> @@ -1335,27 +1335,24 @@ static void dw_mci_init_card(struct mmc_host *mmc, struct mmc_card *card) >>> * description of the CLKENA register we should disable low power mode >>> * for SDIO cards if we need SDIO interrupts to work. >>> */ >>> - if (mmc->caps & MMC_CAP_SDIO_IRQ) { >>> - const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id; >>> - u32 clk_en_a_old; >>> - u32 clk_en_a; >>> + const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id; >>> + u32 clk_en_a_old; >>> + u32 clk_en_a; >>> >>> - clk_en_a_old = mci_readl(host, CLKENA); >>> + clk_en_a_old = mci_readl(host, CLKENA); >>> >>> - if (card->type == MMC_TYPE_SDIO || >>> - card->type == MMC_TYPE_SD_COMBO) { >>> - set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); >>> - clk_en_a = clk_en_a_old & ~clken_low_pwr; >>> - } else { >>> - clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); >>> - clk_en_a = clk_en_a_old | clken_low_pwr; >>> - } >>> + if (card->quirks & MMC_QUIRK_BROKEN_CLK_GATING) { >>> + set_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); >>> + clk_en_a = clk_en_a_old & ~clken_low_pwr; >>> + } else { >>> + clear_bit(DW_MMC_CARD_NO_LOW_PWR, &slot->flags); >>> + clk_en_a = clk_en_a_old | clken_low_pwr; >>> + } >>> >>> - if (clk_en_a != clk_en_a_old) { >>> - mci_writel(host, CLKENA, clk_en_a); >>> - mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | >>> - SDMMC_CMD_PRV_DAT_WAIT, 0); >>> - } >>> + if (clk_en_a != clk_en_a_old) { >>> + mci_writel(host, CLKENA, clk_en_a); >>> + mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | >>> + SDMMC_CMD_PRV_DAT_WAIT, 0); >>> } >>> } >>> >>> >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/