arm/148474: MMC timeout too short durring enumeration of cards.

M. Warner Losh imp at bsdimp.com
Fri Jul 9 20:30:10 UTC 2010


The following reply was made to PR arm/148474; it has been noted by GNATS.

From: "M. Warner Losh" <imp at bsdimp.com>
To: gja at ansley.com
Cc: freebsd-gnats-submit at freebsd.org
Subject: Re: arm/148474: MMC timeout too short durring enumeration of cards.
Date: Fri, 09 Jul 2010 14:19:24 -0600 (MDT)

 In message: <201007091654.o69GsF1n032013 at www.freebsd.org>
             Greg Ansley <gja at ansley.com> writes:
 : Large SD cards take much longer to come out of the power-up state than earlier smaller cards.
 
 This happens to be exactly opposite what I've observed...  Cards up to
 4GB in my AT91RM9200 are ready right away.  Older, 16MB and 32MB cards
 have taken up to 10 iterations to become ready.
 
 : Current command loop terminates after 100 attempts waiting for a
 : card to become ready.  A 1G card currently takes 241 iterations to
 : become ready on a 400Mhz AT91SAM9G20. A 8G card was took 721. 
 
 It really took 2.4s for the 1G card and 7.21s for the 8G card to
 become ready?  Are you sure?  Are you sure there's not some other
 timing bug going on that causes mms_delay_ms(10) to return much more
 quickly than 10ms?
 
 Also, which tree are you booting that has AT91SAM9G20 support, that's
 not in main yet :)  I'll let that slide.
 
 Your patch causes us to wait for up to 50s for this to happen.  That
 seems excessively long to me, and doesn't match my experience with
 these devices, even the ultra-uber-crappy consumer cards.
 
 Warner
 
 
 : SD card spec does not specify a maximum wait time.
 : 
 : The patch bumps the loop count to for 100 to 5000. Note that this does not affect the no-card or error condition timings.
 : >How-To-Repeat:
 : Boot system with SD card present. Large cards will not be found. Small cards work fine.
 : >Fix:
 : 
 : 
 : Patch attached with submission follows:
 : 
 : Index: mmc.c
 : ===================================================================
 : RCS file: /usr/home/ncvs/src/sys/dev/mmc/mmc.c,v
 : retrieving revision 1.38
 : diff -r1.38 mmc.c
 : 451c451
 : < 	for (i = 0; i < 100; i++) {
 : ---
 : > 	for (i = 0; i < 5000; i++) {
 : 478c478
 : < 	for (i = 0; i < 100; i++) {
 : ---
 : > 	for (i = 0; i < 5000; i++) {
 : 
 : 
 : >Release-Note:
 : >Audit-Trail:
 : >Unformatted:
 : _______________________________________________
 : freebsd-arm at freebsd.org mailing list
 : http://lists.freebsd.org/mailman/listinfo/freebsd-arm
 : To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
 : 
 : 


More information about the freebsd-arm mailing list