Bug 107811

Summary: SD card time out too short in tifm_sd.c
Product: IO/Storage Reporter: Bernd Edlinger (bernd.edlinger)
Component: OtherAssignee: io_other
Status: NEW ---    
Severity: normal CC: szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.13.0 Subsystem:
Regression: No Bisected commit-id:

Description Bernd Edlinger 2015-11-13 12:10:49 UTC
Hi,

this happened with a 16GB Sandisk SDHC card, and a TI tifm_7xx1 host if,
originally with 3.13.0 (ubuntu 14.4), but should also happen with latest kernel.


Jul 15 06:54:29 tobias-VGN-N11M-W kernel: [   76.695120] tifm_7xx1 0000:08:03.2: enabling device (0000 -> 0002)
Jul 15 06:54:29 tobias-VGN-N11M-W kernel: [   76.719492] tifm_core: MMC/SD card detected in socket 0:1
Jul 15 06:54:29 tobias-VGN-N11M-W kernel: [   77.029932] mmc0: new SDHC card at address aaaa
Jul 15 06:54:29 tobias-VGN-N11M-W kernel: [   77.039647] mmcblk0: mmc0:aaaa SS16G 14.8 GiB
Jul 15 06:54:29 tobias-VGN-N11M-W kernel: [   77.050276]  mmcblk0: p1 p2
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336053] tifm_sd0:1 : card failed to respond for a long period of time (19, 1)
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336273] tifm0 : demand removing card from socket 0:1
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336388] mmc0: card aaaa removed
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336479] mmcblk0: error -123 sending status command, retrying
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336615] mmcblk0: error -123 sending status command, retrying
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336747] mmcblk0: error -123 sending status command, aborting
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.336879] end_request: I/O error, dev mmcblk0, sector 29362176
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337012] Buffer I/O error on device mmcblk0p2, logical block 0
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337138] lost page write due to I/O error on mmcblk0p2
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337173] end_request: I/O error, dev mmcblk0, sector 29362184
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337303] Buffer I/O error on device mmcblk0p2, logical block 1
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337429] lost page write due to I/O error on mmcblk0p2
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337449] end_request: I/O error, dev mmcblk0, sector 29362192
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337578] Buffer I/O error on device mmcblk0p2, logical block 2
Jul 15 06:55:55 tobias-VGN-N11M-W kernel: [  173.337704] lost page write due to I/O error on mmcblk0p2


the following patch fixed the time out for me:


diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index 93c4b40..84c3f80 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -964,7 +964,7 @@ static int tifm_sd_probe(struct tifm_dev *sock)
        host = mmc_priv(mmc);
        tifm_set_drvdata(sock, mmc);
        host->dev = sock;
-       host->timeout_jiffies = msecs_to_jiffies(1000);
+       host->timeout_jiffies = msecs_to_jiffies(10000);
 
        tasklet_init(&host->finish_tasklet, tifm_sd_end_cmd,
                     (unsigned long)host);


An interesting fact is, that it did alwas only happen with cmd19
which is send tuning block.