Re: [PATCH] mmc: Test bus-width for old MMC devices (v2)

From: Takashi Iwai
Date: Wed Dec 22 2010 - 03:59:58 EST


At Tue, 21 Dec 2010 22:56:32 -0500,
zhangfei gao wrote:
>
> On Tue, Dec 21, 2010 at 11:36 AM, Philip Rakity <prakity@xxxxxxxxxxx> wrote:
> >
> >
> > Can you please try this diff and see if it works for you.
> >
> > Will do formal patch after your testing. ÂWhat card is failing ?
> >
> > Please let me know the manufacturing information so can add card to my test suite.
> >
> > Philip
> >
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> > index 1d8409f..77072c8 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -558,6 +558,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â EXT_CSD_BUS_WIDTH,
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ext_csd_bits[idx][0]);
> > Â Â Â Â Â Â Â Â Â Â Â Âif (!err) {
> > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mmc_set_bus_width_ddr(card->host,
> > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bus_width, MMC_SDR_MODE);
> Test OK,
> Curious why move here, then mmc_set_bus_width_ddr is called twice in
> fact when ddr=0 && (!(host->caps & MMC_CAP_BUS_WIDTH_TEST)), though
> not impact function.
> mmc_set_bus_width is mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE).

Right. How about the patch below? This one just moves the call
before caps test, so it's simpler (and avoiding double calls).


thanks,

Takashi

===