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

Greg Ansley gja at ansley.com
Fri Jul 9 17:00:18 UTC 2010


>Number:         148474
>Category:       arm
>Synopsis:       MMC timeout too short durring enumeration of cards.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-arm
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 09 17:00:14 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Greg Ansley
>Release:        8-stabe & 9-current
>Organization:
Ansley & Associates, Inc.
>Environment:
>Description:
Large SD cards take much longer to come out of the power-up state than earlier smaller cards.

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.

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:


More information about the freebsd-arm mailing list