Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753431AbbHQBz0 (ORCPT ); Sun, 16 Aug 2015 21:55:26 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51494 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbbHQBzY (ORCPT ); Sun, 16 Aug 2015 21:55:24 -0400 X-AuditID: cbfee690-f796f6d000005054-47-55d13f08aed9 Message-id: <55D13F07.70309@samsung.com> Date: Mon, 17 Aug 2015 10:55:19 +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 , linux-sunxi@googlegroups.com, Seungwon Jeon , Ulf Hansson , Maxime Ripard , =?windows-1252?Q?David_Lanzend=F6rfer?= , Hans de Goede , Chen-Yu Tsai , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, 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> In-reply-to: <3d03bfe2c18789eefa038018467c9c63c94ae4a2.1439381423.git.hramrach@gmail.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJIsWRmVeSWpSXmKPExsWyRsSkQJfT/mKowaKtzBZ/Jx1jt7jUeYTR 4s3x6UwW29exWGx6fI3V4vKuOWwWR/73M1r8fgRUsXXTXmaLD/cvMlscXxtu8fPQeSYHHo/f vyYxemx4tJrV48mmi4weO2fdZffYM/Ekm8eda3vYPDYvqfe4s2QWq8f7fVfZPPq2rGL0+LxJ LoA7issmJTUnsyy1SN8ugStj4a+/7AWnhCoerPrE3MD4nK+LkYNDQsBE4tQWyy5GTiBTTOLC vfVsILaQwApGiRVXYy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qEtMnbgBrZhPQkdj+7TgTiC0qECZxZkYHC0S9oMSPyfdYQAaJCFxnlrjQswhskLCA j8Stw+dZIDa0MEoc2b8HbBKnQLTEo7XrgSZxcDAL6Encv6gFEmYWkJfYvOYt8wRG/llI5s5C qJqFpGoBI/MqRonUguSC4qT0XMO81HK94sTc4tK8dL3k/NxNjOBU8UxqB+PBXe6HGAU4GJV4 eDX+XAgVYk0sK67MPcQowcGsJMJ7V+BiqBBvSmJlVWpRfnxRaU5q8SFGU6DHJzJLiSbnA9NY Xkm8obGJmZGlkbmhhZGxuZI4r+yGzaFCAumJJanZqakFqUUwfUwcnFINjFV2orus9uQFXhIp PxM4Y62BYOCa7LZTE7Tsg2zvlCxql156vTV6v2iEws6sY7tdw69sb4j5tv2s50qfhm2z3yWx Prv3ZuK6dHdfqZuqArernirP0p/0L+Z8qYzi4Zr9kYdypNNql0j/Fag1rCxitDodc2ZegaK4 tU1vl98mvtrdirH3F1c1KLEUZyQaajEXFScCAJrMbgMrAwAA 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: 2552 Lines: 76 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? 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-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/