> -----Original Message----- > From: Linus Walleij [mailto:linus.walleij@xxxxxxxxxx] > Sent: Wednesday, December 07, 2011 5:05 PM > To: Huang Changming-R66093 > Cc: linux-mmc@xxxxxxxxxxxxxxx; Huang Changming-R66093 > Subject: Re: [PATCH 3/4] MMC/core: Make sure the power is up, when detect > the card > > On Mon, Dec 5, 2011 at 10:23 AM, <r66093@xxxxxxxxxxxxx> wrote: > > From: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx> > > > > Before running get_cd() recall function to detect whether the card is > > present, must make sure the power is up. > (...) > > + mmc_power_up(host); > > if (host->ops->get_cd && host->ops->get_cd(host) == 0) > > goto out; > > + mmc_power_off(host); > > NAK, I don't get it. > > mmc_power_up() mmc_power_off() is about powering up/down the *card*. > > If you need to read a register in your MMC host or so, control power and > clocking of your silicon in the driver itself. You can use runtime PM or > whatever including explicit clk_enable()/clk_disable() etc. > > I have a strong feeling that the bug you're trying to fix is in the host > controller you're using, not in the MMC core. > Yes, you are right, the power_up will enable the controller clock, then controller can update state register. Now I add this code to special platform codes and can detect the card correctly. -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html