From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 2 Sep 2015 10:06:51 +0200 Subject: [U-Boot] [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds In-Reply-To: References: <1440769821-24005-1-git-send-email-l.majewski@samsung.com> <201508292119.11094.marex@denx.de> Message-ID: <201509021006.51715.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 ...