Skip to contentSkip to conversation

mmc: sdhci: Increase sdhci_send_command timeout to 100ms

PATCH In review Peter Seiderer 2 participants 2 messages Dec 27, 2019 – Jan 7, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: Increase sdhci_send_command timeout to 100ms

Fixes:

	$ mmc bootpart enable 1 1 /dev/mmcblk1
[ 2339.324062] mmc1: Controller never released inhibit bit(s).
[ 2339.329808] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 2339.336339] mmc1: sdhci: Sys addr:  0x11044000 | Version:  0x00000002
[ 2339.342933] mmc1: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000001
[ 2339.349460] mmc1: sdhci: Argument:  0x03b34801 | Trn mode: 0x00000013
[ 2339.356048] mmc1: sdhci: Present:   0x01fd8008 | Host ctl: 0x00000031
[ 2339.362637] mmc1: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
[ 2339.369230] mmc1: sdhci: Wake-up:   0x00000008 | Clock:    0x0000001f
[ 2339.375943] mmc1: sdhci: Timeout:   0x0000000f | Int stat: 0x00000000
[ 2339.382542] mmc1: sdhci: Int enab:  0x117f100b | Sig enab: 0x117f100b
[ 2339.389257] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000003
[ 2339.395856] mmc1: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000a000
[ 2339.402577] mmc1: sdhci: Cmd:       0x0000061b | Max curr: 0x00ffffff
[ 2339.409291] mmc1: sdhci: Resp[0]:   0x00000800 | Resp[1]:  0xffffffff
[ 2339.415889] mmc1: sdhci: Resp[2]:   0x328f5903 | Resp[3]:  0x00000900
[ 2339.422602] mmc1: sdhci: Host ctl2: 0x00000008
[ 2339.427203] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x3fc79208
[ 2339.433913] mmc1: sdhci: ============================================
---
 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +2 -2
index 275102c0a1bf..011b3d322826 100644
@@ -1364,8 +1364,8 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 	    cmd->opcode == MMC_STOP_TRANSMISSION)
 		cmd->flags |= MMC_RSP_BUSY;
 
-	/* Wait max 10 ms */
-	timeout = 10;
+	/* Wait max 100 ms */
+	timeout = 100;
 
 	mask = SDHCI_CMD_INHIBIT;
 	if (sdhci_data_line_cmd(cmd))
Signature · 1 line
2.24.0
maintainer
#1 lore raw
Quoted 32 lines · Peter Seiderer

Fixes:

	$ mmc bootpart enable 1 1 /dev/mmcblk1
[ 2339.324062] mmc1: Controller never released inhibit bit(s).
[ 2339.329808] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 2339.336339] mmc1: sdhci: Sys addr:  0x11044000 | Version:  0x00000002
[ 2339.342933] mmc1: sdhci: Blk size:  0x00000200 | Blk cnt:  0x00000001
[ 2339.349460] mmc1: sdhci: Argument:  0x03b34801 | Trn mode: 0x00000013
[ 2339.356048] mmc1: sdhci: Present:   0x01fd8008 | Host ctl: 0x00000031
[ 2339.362637] mmc1: sdhci: Power:     0x00000002 | Blk gap:  0x00000080
[ 2339.369230] mmc1: sdhci: Wake-up:   0x00000008 | Clock:    0x0000001f
[ 2339.375943] mmc1: sdhci: Timeout:   0x0000000f | Int stat: 0x00000000
[ 2339.382542] mmc1: sdhci: Int enab:  0x117f100b | Sig enab: 0x117f100b
[ 2339.389257] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000003
[ 2339.395856] mmc1: sdhci: Caps:      0x07eb0000 | Caps_1:   0x0000a000
[ 2339.402577] mmc1: sdhci: Cmd:       0x0000061b | Max curr: 0x00ffffff
[ 2339.409291] mmc1: sdhci: Resp[0]:   0x00000800 | Resp[1]:  0xffffffff
[ 2339.415889] mmc1: sdhci: Resp[2]:   0x328f5903 | Resp[3]:  0x00000900
[ 2339.422602] mmc1: sdhci: Host ctl2: 0x00000008
[ 2339.427203] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x3fc79208
[ 2339.433913] mmc1: sdhci: ============================================
---
 drivers/mmc/host/sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +0 -0
index 275102c0a1bf..011b3d322826 100644

drivers/mmc/host/sdhci.c void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) · line 1368

Quoted 7 lines
drivers/mmc/host/sdhci.c +2 -2
@@ -1364,8 +1364,8 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 	    cmd->opcode == MMC_STOP_TRANSMISSION)
 		cmd->flags |= MMC_RSP_BUSY;
 
-	/* Wait max 10 ms */
-	timeout = 10;
+	/* Wait max 100 ms */
+	timeout = 100;

The inhibits bits should not be set, so I am not sure if this is just

papering over the real issue.  Did mmc (utils) return an error?  Was the
eMMC useable after the error?  Any chance of getting a register dump without
the very long console delays?  What device and host controller was it?  What

kernel version?

Quoted 4 lines
drivers/mmc/host/sdhci.c +0 -0
 	mask = SDHCI_CMD_INHIBIT;
 	if (sdhci_data_line_cmd(cmd))