On 2011-04-02, 08:59 +0800, Dong, Chuanxiao wrote:
> > 
> > +   lastclock = host->iosclock;
> > +   host->iosclock = ios->clock;
> > +   if (lastclock == 0 && ios->clock != 0) {
> > +           spin_unlock_irqrestore(&host->lock, flags);
> > +           pm_runtime_get_sync(host->mmc->parent);
> > +           spin_lock_irqsave(&host->lock, flags);
> > +   } else if (lastclock != 0 && ios->clock == 0) {
> > +           spin_unlock_irqrestore(&host->lock, flags);
> > +           pm_runtime_mark_last_busy(host->mmc->parent);
> > +           pm_runtime_put_autosuspend(host->mmc->parent);
> > +           spin_lock_irqsave(&host->lock, flags);

> I saw there is a potential bug when we disabled the runtime pm,
> actually I already saw this bug on MFLD.  To my understanding, I
> think we need at least to add "host->pwr = 0;" here. I found on
> MFLD, each time when remove the SD card, the power control register
> of host controller becomes 0x0. So if you doesn't force to clean
> pwr, the next time sdhci_set_power will return with doing
> nothing. This only happened if the runtime pm feature is disabled.

Exactly.

I have concerns to this piece of code too, is it a good ideal to move
it to the end of sdhci_set_ios()? Since I'm worrying about sdhci be
put into suspend and registers are not in the right status...


> > +   }
> > +   /* no need to configure the rest.. */
> > +   if (host->iosclock == 0)
> > +           goto out;
> > +

This is wrong, we can not directly return here.

We're already suffering from this:
https://bugs.meego.com/show_bug.cgi?id=19251

From: "Yin, Kangkai" <[email protected]>

We should not go out when iosclock == 0, if we do this, we will miss the
chance to do host controller registers (e.g.: CONTROL, POWER, SIGNAL_ENABLE
etc.) settings and also breaks other variables status (e.g. host->pwr). This
is known to break the mmc power off path.

For example:
https://bugs.meego.com/show_bug.cgi?id=19251

Signed-off-by: "Yin, Kangkai" <[email protected]>
--- a/drivers/mmc/host/sdhci.c.old      2011-06-30 10:24:01.776426401 -0700
+++ b/drivers/mmc/host/sdhci.c  2011-06-30 10:24:21.557030243 -0700
@@ -1184,9 +1184,6 @@
                pm_runtime_put_autosuspend(host->mmc->parent);
                spin_lock_irqsave(&host->lock, flags);
        }
-       /* no need to configure the rest.. */
-       if (host->iosclock == 0)
-               goto out;
 
        /*
         * Reset the chip on each power off.
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to