Skip to contentSkip to conversation

New: mmc_block / tifm_sd not completely registering when a new sd card is inserted

Bugme-new Andrew Morton 4 participants 9 messages Sep 15, 2010 – Sep 21, 2010 1 message not in the archive MMC, SD and SDIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 48 lines · On Wed, 15 Sep 2010 13:48:30 GMT [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=18602

Summary: mmc_block / tifm_sd not completely registering when a
new sd card is inserted
Product: Drivers
Version: 2.5
Kernel Version: 2.6.35.4
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: MMC/SD
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

After I insert an SD card once after booting, mount it, unmount it, then pop out the card, if I try to insert the card again, the /dev/mmcblk* devices do not show again. I have to unload the mmc_block and tifm_sd (and mmc_core) modules, then reload them, in order for the device node to apear again. I don't think this was always the case, but I can't remember the specific version that this problem first occurred.

On the first insertion cycle, dmsg looks like this:

  [204702.558153] tifm_core: MMC/SD card detected in socket 0:1
  [204702.834915] mmc0: new SD card at address 4f9a
  [204702.878743] mmcblk0: mmc0:4f9a SD02G 1.83 GiB 
  [204702.878802]  mmcblk0: p1
  # ... do stuff with the card
  [204908.381864] tifm0 : demand removing card from socket 0:1
  [204908.381936] mmc0: card 4f9a removed

# now, insert the card again

  [204913.581176] tifm_core: MMC/SD card detected in socket 0:1
  # and remove it again
  [204926.188570] tifm0 : demand removing card from socket 0:1

lspci identifies my SD card reader as:

0f:06.3 SD Host controller: Texas Instruments PCIxx12 SDA Standard Compliant
SD Host Controller

Any advice would be appreciated. Thanks.

#2 lore raw

(CC'ing maintainer)

Quoted 60 lines · Andrew Morton

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 41 lines · On Wed, 15 Sep 2010 13:48:30 GMT [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=18602

Summary: mmc_block / tifm_sd not completely registering when a
new sd card is inserted
Product: Drivers
Version: 2.5
Kernel Version: 2.6.35.4
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: MMC/SD
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

After I insert an SD card once after booting, mount it, unmount it, then pop out the card, if I try to insert the card again, the /dev/mmcblk* devices do not show again. I have to unload the mmc_block and tifm_sd (and mmc_core) modules, then reload them, in order for the device node to apear again. I don't think this was always the case, but I can't remember the specific version that this problem first occurred.

On the first insertion cycle, dmsg looks like this:

  [204702.558153] tifm_core: MMC/SD card detected in socket 0:1
  [204702.834915] mmc0: new SD card at address 4f9a
  [204702.878743] mmcblk0: mmc0:4f9a SD02G 1.83 GiB 
  [204702.878802]  mmcblk0: p1
  # ... do stuff with the card
  [204908.381864] tifm0 : demand removing card from socket 0:1
  [204908.381936] mmc0: card 4f9a removed

# now, insert the card again

  [204913.581176] tifm_core: MMC/SD card detected in socket 0:1
  # and remove it again
  [204926.188570] tifm0 : demand removing card from socket 0:1
Quoted 7 lines

lspci identifies my SD card reader as:

0f:06.3 SD Host controller: Texas Instruments PCIxx12 SDA Standard Compliant
SD Host Controller

Any advice would be appreciated. Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

   0f:06.3 SD Host controller:

Texas Instruments PCIxx12 SDA Standard Compliant

Quoted 5 lines
Quoted 4 lines

SD Host Controller

Any advice would be appreciated. Thanks.

From what I recollect, these controllers (the xx12 ones) were never that well tested (there are some differences between xx21 and xx12 and I only had the former). I suppose, compiling tifm_* module with DEBUG enabled and posting the trace may help to diagnose the problem.

#4 lore raw
Quoted 6 lines · On Sat, 18 Sep 2010 00:23:55 -0700 (PDT) Alex Dubov <[email protected]> wrote:
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

   0f:06.3 SD Host controller:

Texas Instruments PCIxx12 SDA Standard Compliant

Quoted 2 lines
Quoted 2 lines

SD Host Controller

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

Any advice would be appreciated. Thanks.

From what I recollect, these controllers (the xx12 ones) were never that well tested (there are some differences between xx21 and xx12 and I only had the former). I suppose, compiling tifm_* module with DEBUG enabled and posting the trace may help to diagnose the problem.

Log is attached. It seems that this time, no entry shows up in /dev at all, even if I modprobe mmc_block manually.

Signature · 1 line
Mike Kelly
Sep 18 04:56:54 aether kernel: [  459.091171] tifm_core: MMC/SD card detected in socket 0:1
Sep 18 04:56:54 aether kernel: [  459.203406] mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
Sep 18 04:56:54 aether kernel: [  459.203418] tifm_sd tifm_sd0:1: ios: clock = 0, vdd = 0, bus_mode = 1, chip_select = 0, power_mode = 0, bus_width = 0
Sep 18 04:56:54 aether kernel: [  459.203480] mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
Sep 18 04:56:54 aether kernel: [  459.203491] tifm_sd tifm_sd0:1: ios: clock = 0, vdd = 15, bus_mode = 1, chip_select = 0, power_mode = 1, bus_width = 0
Sep 18 04:56:54 aether kernel: [  459.214312] mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
Sep 18 04:56:54 aether kernel: [  459.214325] tifm_sd tifm_sd0:1: ios: clock = 400000, vdd = 15, bus_mode = 1, chip_select = 0, power_mode = 2, bus_width = 0
Sep 18 04:56:54 aether kernel: [  459.225087] mmc0: starting CMD52 arg 00000c00 flags 00000195
Sep 18 04:56:54 aether kernel: [  459.225102] tifm_sd tifm_sd0:1: executing opcode 0x34, arg: 0xc00, mask: 0x2140
Sep 18 04:56:54 aether kernel: [  459.225433] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:54 aether kernel: [  459.225449] mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:54 aether kernel: [  459.226080] mmc0: starting CMD52 arg 80000c08 flags 00000195
Sep 18 04:56:54 aether kernel: [  459.226091] tifm_sd tifm_sd0:1: executing opcode 0x34, arg: 0x80000c08, mask: 0x2140
Sep 18 04:56:54 aether kernel: [  459.226431] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:54 aether kernel: [  459.226447] mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:54 aether kernel: [  459.226468] mmc0: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
Sep 18 04:56:54 aether kernel: [  459.226477] tifm_sd tifm_sd0:1: ios: clock = 400000, vdd = 15, bus_mode = 1, chip_select = 1, power_mode = 2, bus_width = 0
Sep 18 04:56:54 aether kernel: [  459.228051] mmc0: starting CMD0 arg 00000000 flags 000000c0
Sep 18 04:56:54 aether kernel: [  459.228061] tifm_sd tifm_sd0:1: executing opcode 0x0, arg: 0x0, mask: 0x40
Sep 18 04:56:54 aether kernel: [  459.228222] tifm_sd tifm_sd0:1: host event: host_status 1, flags 0
Sep 18 04:56:54 aether kernel: [  459.228274] mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
Sep 18 04:56:54 aether kernel: [  459.231054] mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
Sep 18 04:56:54 aether kernel: [  459.231064] tifm_sd tifm_sd0:1: ios: clock = 400000, vdd = 15, bus_mode = 1, chip_select = 0, power_mode = 2, bus_width = 0
Sep 18 04:56:54 aether kernel: [  459.233310] mmc0: starting CMD8 arg 000001aa flags 000002f5
Sep 18 04:56:54 aether kernel: [  459.233321] tifm_sd tifm_sd0:1: executing opcode 0x8, arg: 0x1aa, mask: 0x1140
Sep 18 04:56:54 aether kernel: [  459.233673] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:54 aether kernel: [  459.233688] mmc0: req done (CMD8): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:54 aether kernel: [  459.233702] mmc0: starting CMD5 arg 00000000 flags 000002e1
Sep 18 04:56:54 aether kernel: [  459.233711] tifm_sd tifm_sd0:1: executing opcode 0x5, arg: 0x0, mask: 0x1340
Sep 18 04:56:54 aether kernel: [  459.234040] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:54 aether kernel: [  459.234054] mmc0: req failed (CMD5): -110, retrying...
Sep 18 04:56:54 aether kernel: [  459.234064] tifm_sd tifm_sd0:1: executing opcode 0x5, arg: 0x0, mask: 0x1340
Sep 18 04:56:54 aether kernel: [  459.234390] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.234403] mmc0: req failed (CMD5): -110, retrying...
Sep 18 04:56:55 aether kernel: [  459.234412] tifm_sd tifm_sd0:1: executing opcode 0x5, arg: 0x0, mask: 0x1340
Sep 18 04:56:55 aether kernel: [  459.234738] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.234752] mmc0: req failed (CMD5): -110, retrying...
Sep 18 04:56:55 aether kernel: [  459.234761] tifm_sd tifm_sd0:1: executing opcode 0x5, arg: 0x0, mask: 0x1340
Sep 18 04:56:55 aether kernel: [  459.235088] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.235103] mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.236465] mmc0: starting CMD55 arg 00000000 flags 000000f5
Sep 18 04:56:55 aether kernel: [  459.236475] tifm_sd tifm_sd0:1: executing opcode 0x37, arg: 0x0, mask: 0x1140
Sep 18 04:56:55 aether kernel: [  459.236809] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.236823] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.236837] mmc0: starting CMD55 arg 00000000 flags 000000f5
Sep 18 04:56:55 aether kernel: [  459.236846] tifm_sd tifm_sd0:1: executing opcode 0x37, arg: 0x0, mask: 0x1140
Sep 18 04:56:55 aether kernel: [  459.237175] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.237190] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.237214] mmc0: starting CMD55 arg 00000000 flags 000000f5
Sep 18 04:56:55 aether kernel: [  459.237223] tifm_sd tifm_sd0:1: executing opcode 0x37, arg: 0x0, mask: 0x1140
Sep 18 04:56:55 aether kernel: [  459.237550] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.237564] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.238600] mmc0: starting CMD55 arg 00000000 flags 000000f5
Sep 18 04:56:55 aether kernel: [  459.238610] tifm_sd tifm_sd0:1: executing opcode 0x37, arg: 0x0, mask: 0x1140
Sep 18 04:56:55 aether kernel: [  459.238939] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.238954] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.238973] mmc0: starting CMD1 arg 00000000 flags 000000e1
Sep 18 04:56:55 aether kernel: [  459.238983] tifm_sd tifm_sd0:1: executing opcode 0x1, arg: 0x0, mask: 0x1340
Sep 18 04:56:55 aether kernel: [  459.239311] tifm_sd tifm_sd0:1: host event: host_status 80, flags 0
Sep 18 04:56:55 aether kernel: [  459.239326] mmc0: req done (CMD1): -110: 00000000 00000000 00000000 00000000
Sep 18 04:56:55 aether kernel: [  459.239345] mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
Sep 18 04:56:55 aether kernel: [  459.239353] tifm_sd tifm_sd0:1: ios: clock = 0, vdd = 0, bus_mode = 1, chip_select = 0, power_mode = 0, bus_width = 0
Sep 18 04:58:07 aether kernel: [  531.283599] tifm0 : demand removing card from socket 0:1
Sep 18 04:58:07 aether kernel: [  531.283649] mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
Sep 18 04:58:07 aether kernel: [  531.283659] tifm_sd tifm_sd0:1: ios: clock = 0, vdd = 0, bus_mode = 1, chip_select = 0, power_mode = 0, bus_width = 0
Sep 18 04:58:07 aether kernel: [  531.283888] tifm_sd tifm_sd0:1: after remove
#5 lore raw
Quoted 5 lines

Log is attached. It seems that this time, no entry shows up in /dev at
all, even if I modprobe mmc_block manually.

The driver appears to do everything right. The problem is that your media timeouts on the initialization commands, so driver decides it's not worth operating.

There's a module option of tifm_sd called "fixed_timeout" (check it out with modinfo). It will preclude setting of hardware timeout register. Lets see what it does on your setup.

#6 lore raw
Quoted 7 lines · On Sat, 18 Sep 2010 22:19:42 -0700 (PDT) Alex Dubov <[email protected]> wrote:

The driver appears to do everything right. The problem is that your media timeouts on the initialization commands, so driver decides it's not worth operating.

There's a module option of tifm_sd called "fixed_timeout" (check it out with modinfo). It will preclude setting of hardware timeout register. Lets see what it does on your setup.

Unfortunately, it doesn't seem to make a difference here. When I plug in my sd card, it looks like tifm_sd gets loaded, lots of debugging output. But, no /dev/mmcblk0 shows up, and mmc_block does not get loaded.

Signature · 1 line
Mike Kelly
#7 lore raw
Quoted 9 lines

Unfortunately, it doesn't seem to make a difference here. When I plug
in my sd card, it looks like tifm_sd gets loaded, lots of debugging
output. But, no /dev/mmcblk0 shows up, and mmc_block does not get
loaded.

It's not created, because media times out. Why it happens is a different question. It may be that clock parameters or something similar are not properly configured (I don't have any datasheets for these devices). There can also be a mechanical failure of the SD socket (these things do happen).

Can you confirm that the socket and media are good, by trying them out under windows or something?

Additional approach you can follow is to try and enable SDHCI interface if it's available on your chip (xx21 have it and can be made to use it) and then try it with sdhci.ko driver.

If you want to experiment with sdhci (a tricky exercise), some information is available here:
http://www.gentoo-wiki.info/Acer_Ferrari_4005WLMi#SDHCI

#8 lore raw
Quoted 8 lines · On Sun, 19 Sep 2010 17:50:30 -0700 (PDT) Alex Dubov <[email protected]> wrote:

It's not created, because media times out. Why it happens is a different question. It may be that clock parameters or something similar are not properly configured (I don't have any datasheets for these devices). There can also be a mechanical failure of the SD socket (these things do happen).

Can you confirm that the socket and media are good, by trying them out under windows or something?

The same SD card and reader work fine under Windows Vista on this same machine. Ditto other SD cards in this reader. The fact that I am occasionally able to get this reader to work under Linux, though does make it seem like some timing or race issue that I'm hitting, though.

I may give SDHCI a go at some point, but I'll have to read up on it more.

Signature · 1 line
Mike Kelly
#9 lore raw
Quoted 4 lines
Quoted 1 line

Can you confirm that the socket and media are good, by

trying them out

Quoted 1 line

under windows or something?

Quoted 9 lines

The same SD card and reader work fine under Windows Vista on this same
machine. Ditto other SD cards in this reader. The fact that I am
occasionally able to get this reader to work under Linux, though does
make it seem like some timing or race issue that I'm hitting, though.

It does not look like a pure software issue from the debug trace.
Host issues initialisation commands to the media (8, 5, 55), each is retried 3 times. For all of them, command execution fails with hardware error flag set (and those are cleaned in between).

I still tend to blame improper hardware initialisation, but I'll try to look and see if there can be something else.