Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753467Ab3JWLZk (ORCPT ); Wed, 23 Oct 2013 07:25:40 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:46370 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461Ab3JWLZi (ORCPT ); Wed, 23 Oct 2013 07:25:38 -0400 X-AuditID: cbfee68f-b7f836d000001b39-25-5267b230a5c6 From: Seungwon Jeon To: "'Doug Anderson'" , "'Jaehoon Chung'" Cc: "'Chris Ball'" , "'James Hogan'" , "'Grant Grundler'" , "'Alim Akhtar'" , "'Abhilash Kesavan'" , "'Tomasz Figa'" , "'Olof Johansson'" , "'Sonny Rao'" , "'Bing Zhao'" , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <1381876762-10892-1-git-send-email-dianders@chromium.org> <1381876762-10892-2-git-send-email-dianders@chromium.org> <52610273.3080005@samsung.com> In-reply-to: Subject: RE: [PATCH 1/2] mmc: dw_mmc: Cleanup disable of low power mode w/ SDIO interrupts Date: Wed, 23 Oct 2013 20:25:36 +0900 Message-id: <001701cecfe2$9831eb90$c895c2b0$%jun@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=Windows-1252 Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac7MPf2Y+J50eQ7eTpivjLSA9lI0pQDoH2oQ Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42I5/e+Zoa7BpvQgg20NahaP1yxmsngwbxub xbytR1kttr/eyGZxdtlBNotXR34wWbyb94LZ4savNlaLy7vmsFkc+d/PaHHq+mc2iydnZjJa rNr1h9GB12N2w0UWj52z7rJ79Ow8w+hx6MpaRo8rJ5pYPSYvvMjs0bdlFaPH501yARxRXDYp qTmZZalF+nYJXBnr//ayF7SLVlzZdpitgXEGfxcjJ4eEgInEp0W3mSBsMYkL99azgdhCAssY JTZ+8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E wiX23lQBqWEWmMss8Xj+BxaIhpeMEqs2f2MFKeIUCJaY3e4A0issECPx/cJjRhCbRUBVYtfs H6wgNq+ArcTprruMELagxI/J91hAbGYBPYmPf24zQtjyEpvXvAXbKyGgLvHory5IWETASGLS 6z5WiBIRiX0v3jFOYBSahWTSLCSTZiGZNAtJywJGllWMoqkFyQXFSem5hnrFibnFpXnpesn5 uZsYwWnnmdQOxpUNFocYBTgYlXh4LdrTgoRYE8uKK3MPMUpwMCuJ8K6fnR4kxJuSWFmVWpQf X1Sak1p8iDEZ6NGJzFKiyfnAlJhXEm9obGJmZGlkZmFkYm5OmrCSOO+BVutAIYH0xJLU7NTU gtQimC1MHJxSDYwFcyX+u238ydjYaXns16nLHgHnIsQNNvy898PI46Qg1w1GBRGv5jubu9Uv iZ+SyffutzM8ynlxn8a1v0JbE5YfUiv/cSTH3OEpY84/1Z/X5SarmhUKXqoLmTzlROQjK7O3 e797fuGd9vqt1NcJ0t+1t+p+2fNv9eYZymeCA/JiZ9rGnJqwTjtDiaU4I9FQi7moOBEAOgFv BX8DAAA= 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: 2875 Lines: 70 Hi Doug, This change looks good. There's comment below. On Sat, October 19, 2013, Doug Anderson wrote: > Jaehoon, > > On Fri, Oct 18, 2013 at 2:42 AM, Jaehoon Chung wrote: > >> - clk_en_a = mci_readl(host, CLKENA); > >> + /* > >> + * Low power mode will stop the card clock when idle. According to the > >> + * 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) { > > mmc->caps & MMC_CAP_SDIO_IRQ? > > Wow, that was an embarrassing one. Thanks. > > >> + const u32 clken_low_pwr = SDMMC_CLKEN_LOW_PWR << slot->id; > >> + u32 clk_en_a_old; > >> + u32 clk_en_a; > >> > >> - if (clk_en_a & clken_low_pwr) { > >> - mci_writel(host, CLKENA, clk_en_a & ~clken_low_pwr); > >> - mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | > >> - SDMMC_CMD_PRV_DAT_WAIT, 0); > >> + clk_en_a_old = mci_readl(host, CLKENA); > >> + > >> + if (card->type == MMC_TYPE_SDIO || > >> + card->type == MMC_TYPE_SD_COMBO) { && card->quirks & MMC_QUIRK_BROKEN_CLK_GATING How about considering MMC_QUIRK_BROKEN_CLK_GATING? Some sdio device can work with gating clock. For this, mmc_fixup_device() should be called prior to init_card() in core(sdio.c). I guess you found that. Thanks, Seungwon Jeon > >> + 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; > > When this condition is entered? card->type is always MMC_TYPE_SDIO or MMC_TYPE_SD_COMBO, isn't? > > Ugh, that's not intuitive. This callback is only called for SDIO > cards and not MMC/SD cards? That means if you plug in an SDIO card > and then eject it and plug in an SD card you won't get to low power. > Hrm. > > I dug around a bit and couldn't find a better way to do this and then > I realized that the other user of the init_card() callback has the > same bug, so for the next version of the series I'm proposing a fix > for mmc core to add this for all types. If you have a better > suggestion, I'm all ears. > > -Doug > -- > 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/