public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Seungwon Jeon <tgih.jun@samsung.com>
To: "'Doug Anderson'" <dianders@chromium.org>,
	"'Jaehoon Chung'" <jh80.chung@samsung.com>
Cc: "'Chris Ball'" <cjb@laptop.org>,
	"'James Hogan'" <james.hogan@imgtec.com>,
	"'Grant Grundler'" <grundler@chromium.org>,
	"'Alim Akhtar'" <alim.akhtar@samsung.com>,
	"'Abhilash Kesavan'" <a.kesavan@samsung.com>,
	"'Tomasz Figa'" <tomasz.figa@gmail.com>,
	"'Olof Johansson'" <olof@lixom.net>,
	"'Sonny Rao'" <sonnyrao@chromium.org>,
	"'Bing Zhao'" <bzhao@marvell.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
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	[thread overview]
Message-ID: <001701cecfe2$9831eb90$c895c2b0$%jun@samsung.com> (raw)
In-Reply-To: <CAD=FV=UiUxoqbAeq+3iUChqksHd_NpJs2rM83=ng3fprMj0E-A@mail.gmail.com>

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 <jh80.chung@samsung.com> 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


  reply	other threads:[~2013-10-23 11:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 22:39 [PATCH 0/2] Prevent races when doing read-modify-write of INTMASK Doug Anderson
2013-10-15 22:39 ` [PATCH 1/2] mmc: dw_mmc: Cleanup disable of low power mode w/ SDIO interrupts Doug Anderson
2013-10-18  9:42   ` Jaehoon Chung
2013-10-18 20:09     ` Doug Anderson
2013-10-23 11:25       ` Seungwon Jeon [this message]
2013-10-24  7:28         ` Doug Anderson
2013-10-25  9:29           ` Seungwon Jeon
2013-10-28 22:39             ` Doug Anderson
2013-11-01  5:23               ` Seungwon Jeon
2013-10-15 22:39 ` [PATCH 2/2] mmc: dw_mmc: Protect read-modify-write of INTMASK with a lock Doug Anderson
2013-10-16  9:49   ` James Hogan
2013-10-16 16:43     ` Doug Anderson
2013-10-16 20:23       ` James Hogan
2013-10-18  9:51         ` Jaehoon Chung
2013-10-18 20:09           ` Doug Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001701cecfe2$9831eb90$c895c2b0$%jun@samsung.com' \
    --to=tgih.jun@samsung.com \
    --cc=a.kesavan@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=bzhao@marvell.com \
    --cc=cjb@laptop.org \
    --cc=dianders@chromium.org \
    --cc=grundler@chromium.org \
    --cc=james.hogan@imgtec.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=sonnyrao@chromium.org \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox