> -----Original Message----- > From: linux-mmc-owner@xxxxxxxxxxxxxxx [mailto:linux-mmc- > owner@xxxxxxxxxxxxxxx] On Behalf Of Ulf Hansson > Sent: Monday, December 05, 2011 11:48 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 > > Hi Jerry, > > 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. > > > > Signed-off-by: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx> > > --- > > drivers/mmc/core/core.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index > > 5278ffb..a08e6b1 100644 > > --- a/drivers/mmc/core/core.c > > +++ b/drivers/mmc/core/core.c > > @@ -2066,8 +2066,10 @@ void mmc_rescan(struct work_struct *work) > > */ > > mmc_bus_put(host); > > > > + mmc_power_up(host); > > if (host->ops->get_cd && host->ops->get_cd(host) == 0) > > goto out; > > + mmc_power_off(host); > > This does not feel right. get_cd is typically a function which makes use > of some GPIO pin to find out if there is a card present and thus no > power_up should be needed. > > If your host driver does not support GPIO mechanism of detecting the card, > the polling mechanism is maybe what you want. > Yes, the FSL eSDHC controller don't support GPIO mechanism to detect the card, But there is SDHC_CD pin from chip, and can detect the card, and update the register. So we should power up the controller to update the card status before read the register. -- 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