Skip to contentSkip to conversation

SDHC cards no longer recognized on AT91 based board

Bug 39822 Chris Ball 3 participants 6 messages Jul 28, 2011 – Jan 29, 2012 2 messages not in the archive MMC, SD and SDIO

lore
Share & tools
lore

Chris Ball

author
#2 lore raw
In reply to a message not in the archive

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Thanks,

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#3 lore raw
Quoted 30 lines · Chris Ball

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

Quoted 7 lines

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Sorry, I keep away from git. But the smoking gun is drivers/mmc/core/sd.c that underwent major changes to support SDXC between 2.6.39 and 3.0.0 .

Luckily I can revert core/sd.c to the state it was in in lk 2.6.38.6 and it compiles in 3.0.0 . With that kernel my Fox G20 can read its root fs from a SDHC card.

BTW With lk 2.6.39 the Fox G20 booted okay from a SDHC card but that kernel had other (UDP broadcast) problems.

#4 lore raw
In reply to Chris Ball
Quoted 30 lines · Chris Ball

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

Quoted 7 lines

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Still broken in lk 3.1.0, same errors in dmesg.

Doug Gilbert

#5 lore raw
Quoted 34 lines · Douglas Gilbert
Quoted 33 lines · Chris Ball

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Quoted 6 lines
Quoted 4 lines

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Still broken in lk 3.1.0, same errors in dmesg.

Still broken in lk 3.2.0, same errors in dmesg.

The solution (hack) up to lk 3.1.0 has been to take linux-2.6.38/drivers/mmc/core/sd.c file and overwrite the defective sd.c . That worked in lk 3.0.* and 3.1.* . In lk 3.2.0 the old sd.c no longer compiles but by adding "#include <linux/stat.h>" is does and thereafter that SDHC card can be read again.

My test system is a FoxG20 card which is based on the AT91SAM9G20 SOC. The card's BIOS can read the 4 GB microSD (HC) card in all cases; the problem is with SDHC cards and all drivers/mmc/core/sd.c from and including lk 3.0.0

Doug Gilbert

#7 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 52 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 51 lines · Douglas Gilbert
Quoted 34 lines · Douglas Gilbert
Quoted 33 lines · Chris Ball

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Quoted 6 lines
Quoted 4 lines

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Still broken in lk 3.1.0, same errors in dmesg.

Still broken in lk 3.2.0, same errors in dmesg.

The solution (hack) up to lk 3.1.0 has been to take linux-2.6.38/drivers/mmc/core/sd.c file and overwrite the defective sd.c . That worked in lk 3.0.* and 3.1.* . In lk 3.2.0 the old sd.c no longer compiles but by adding "#include<linux/stat.h>" is does and thereafter that SDHC card can be read again.

Quoted 6 lines
Quoted 5 lines

My test system is a FoxG20 card which is based on the AT91SAM9G20 SOC. The card's BIOS can read the 4 GB microSD (HC) card in all cases; the problem is with SDHC cards and all drivers/mmc/core/sd.c from and including lk 3.0.0

can you test it on atmel_mci?

Nothing went into dmesg concerning mci and the boot up froze at this point:
Waiting for root device /dev/mmcblk0p2...

Quoted 1 line

at91_mci is deprecated and will be drop soon

Hmm. Doesn't seem to work for me so there would be no loss. It could at least announce when it gets loaded and if there are any errors.

My theory remains that the large rework done on drivers/mmc/core/sd.c just prior to lk 3.0.0 has caused this problem.

Doug Gilbert

#6 lore raw
In reply to Douglas Gilbert
Quoted 51 lines · Douglas Gilbert
Quoted 34 lines · Douglas Gilbert
Quoted 33 lines · Chris Ball

Hi, thanks for the bug report. Adding linux-mmc@ and some atmel driver folks to CC.

Quoted 24 lines · On Thu, Jul 28 2011, [email protected] wrote:

Prior to 3.0.0 the FoxG20 board (Atmel AT91SAM9G20) could boot and use both micro SD and SDHC card to contain its root file system. With the advent of the 3.0.0 kernel the micro SDHC card is unable to mount the root file system.

Comparing the relevant part of dmesg for 2.6.38.6 (and it worked on 2.6.39):
...
Waiting for root device /dev/mmcblk0p2...
mmc0: host does not support reading read-only switch. assuming write-enable. at91_mci at91_mci: Timeout waiting end of packet
mmc0: new SDHC card at address 1234
mmcblk0: mmc0:1234 SA04G 3.67 GiB
mmcblk0: p1 p2 p3
...

to the same dmesg section for 3.0.0 :
...
Waiting for root device /dev/mmcblk0p2...
mmc0: error -110 whilst initialising SD card
at91_mci at91_mci: Timeout waiting end of packet
mmc0: error -110 whilst initialising SD card
[no further progress]

Quoted 1 line

Non "HC" SD cards work as expected in 3.0.0

If no-one on the CC list has any ideas, would you be interested in trying to bisect this change?

Quoted 6 lines
Quoted 4 lines

Another possibility would be adding printks before all of the -ETIMEDOUT lines in core/* and host/at*, in order to see which one you're hitting (and therefore which operation is causing the initialization to fail). But a full bisection would be more conclusive.

Still broken in lk 3.1.0, same errors in dmesg.

Still broken in lk 3.2.0, same errors in dmesg.

The solution (hack) up to lk 3.1.0 has been to take linux-2.6.38/drivers/mmc/core/sd.c file and overwrite the defective sd.c . That worked in lk 3.0.* and 3.1.* . In lk 3.2.0 the old sd.c no longer compiles but by adding "#include <linux/stat.h>" is does and thereafter that SDHC card can be read again.

Quoted 5 lines

My test system is a FoxG20 card which is based on the AT91SAM9G20 SOC. The card's BIOS can read the 4 GB microSD (HC) card in all cases; the problem is with SDHC cards and all drivers/mmc/core/sd.c from and including lk 3.0.0

can you test it on atmel_mci?

at91_mci is deprecated and will be drop soon

Best Regards,
J.