[U-Boot] [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds

Marek Vasut marex at denx.de
Wed Sep 2 10:06:51 CEST 2015


On Tuesday, September 01, 2015 at 06:22:08 PM, Pantelis Antoniou wrote:
> Hi Marek,

Hi!

[...]
> >> So you suggest adding board_mmc_getcd() in several places in the mmc
> >> subsystem driver to detect removal of the SD card?
> > 
> > Hmmmm, I'm not sure about this one. Panto ?
> 
> I’m fine with this. Perhaps we can avoid spamming this all over the place,
> and that would be better.
> 
> >>> It'd be cool if the MMC subsystem could pull the wp-gpios and cd-gpios
> >>> from DT though :)
> >> 
> >> +1
> 
> Indeed. I would expect this to be a per-board thing. I would not expect
> all platforms to provide that capability.

That's right.

> >>>>> Also, where did you find out there is such "cleanup" mechanism
> >>>>> please ?
> >>>> 
> >>>> Internally we did some tests with several SD cards. We were stunned
> >>>> when it turned out that for some workloads it took up to 15 seconds
> >>>> to end write operation for small data.
> >>>> 
> >>>> The culprit is the SD Card embedded controller responsible for FTL -
> >>>> flash translation layer.
> >>>> It allows NAND memory on the card to be visible as the block device.
> >>>> More importantly it also takes care of wear leveling and bad block
> >>>> management.
> >>>> 
> >>>> Hence, we don't know when it would start housekeeping operations.
> >>>> We can only poll/wait until this controller finishes it work.
> >>>> The code as it was (with the indefinite loop) was taking this
> >>>> situation into account.
> >>>> 
> >>>> The 1 second timeout is apparently too short and makes using SD card
> >>>> non-deterministic and error prone in u-boot.
> >>>> 
> >>>> Even worse, many devices use SD card as the only storage device.
> >>> 
> >>> Yes, horrible.
> >> 
> >> Good that we have agreed.
> > 
> > Heh :)
> 
> Horrible closed source flash management algorithm is horrible, film at 11
> :)

It was some seriously repugnant flick ...


More information about the U-Boot mailing list