Skip to contentSkip to conversation

mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response

PATCH Superseded Alex Smith 3 participants 4 messages Apr 29, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alex Smith

author
#0 lore raw

PATCH 1/1 mmc: jz4740: don't wait for PRG_DONE after stop command with R1 response

As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for read requests"), stop commands for reads do not have MMC_RSP_BUSY set. In this case we should not wait for a PRG_DONE IRQ after sending the stop command: it will not get raised when the busy flag is not set, causing the request to fail with a timeout.

Cc Lars-Peter Clausen <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Chris Ball <[email protected]>
Cc James Hogan <[email protected]>
---
 drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/jz4740_mmc.c +6 -4
index de2139c..1c3368b 100644
@@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
 
 		jz4740_mmc_send_command(host, req->stop);
 
-		timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
-		if (timeout) {
-			host->state = JZ4740_MMC_STATE_DONE;
-			break;
+		if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
+			timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
+			if (timeout) {
+				host->state = JZ4740_MMC_STATE_DONE;
+				break;
+			}
 		}
 	case JZ4740_MMC_STATE_DONE:
 		break;
Signature · 1 line
1.9.2
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Alex Smith

As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for read requests"), stop commands for reads do not have MMC_RSP_BUSY set. In this case we should not wait for a PRG_DONE IRQ after sending the stop command: it will not get raised when the busy flag is not set, causing the request to fail with a timeout.

Cc Lars-Peter Clausen <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Chris Ball <[email protected]>
Cc James Hogan <[email protected]>
Quoted 28 lines
---
 drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/jz4740_mmc.c +6 -5
index de2139c..1c3368b 100644
@@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
 
                jz4740_mmc_send_command(host, req->stop);
 
-               timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
-               if (timeout) {
-                       host->state = JZ4740_MMC_STATE_DONE;
-                       break;
+               if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
+                       timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
+                       if (timeout) {
+                               host->state = JZ4740_MMC_STATE_DONE;
+                               break;
+                       }
                }
        case JZ4740_MMC_STATE_DONE:
                break;
--

1.9.2

#2 lore raw
Quoted 7 lines · Ulf Hansson
Quoted 6 lines · Alex Smith

As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for read requests"), stop commands for reads do not have MMC_RSP_BUSY set. In this case we should not wait for a PRG_DONE IRQ after sending the stop command: it will not get raised when the busy flag is not set, causing the request to fail with a timeout.

Quoted 8 lines
Quoted 5 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Chris Ball <[email protected]>
Cc James Hogan <[email protected]>
#3 lore raw
In reply to Ulf Hansson
Quoted 7 lines · Ulf Hansson
Quoted 6 lines · Alex Smith

As of commit bcc3e1726d ("mmc: block: Use R1 responses for stop cmds for read requests"), stop commands for reads do not have MMC_RSP_BUSY set. In this case we should not wait for a PRG_DONE IRQ after sending the stop command: it will not get raised when the busy flag is not set, causing the request to fail with a timeout.

Quoted 7 lines
Quoted 5 lines
Cc Lars-Peter Clausen <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Chris Ball <[email protected]>
Cc James Hogan <[email protected]>

Alex, could you please resend a new version which has been verified using checkpatch.

Kind regards
Ulf Hansson

Quoted 29 lines
Quoted 29 lines
---
 drivers/mmc/host/jz4740_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/host/jz4740_mmc.c +6 -5
index de2139c..1c3368b 100644
@@ -515,10 +515,12 @@ static irqreturn_t jz_mmc_irq_worker(int irq, void *devid)
 
                jz4740_mmc_send_command(host, req->stop);
 
-               timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
-               if (timeout) {
-                       host->state = JZ4740_MMC_STATE_DONE;
-                       break;
+               if (mmc_resp_type(req->stop) & MMC_RSP_BUSY) {
+                       timeout = jz4740_mmc_poll_irq(host, JZ_MMC_IRQ_PRG_DONE);
+                       if (timeout) {
+                               host->state = JZ4740_MMC_STATE_DONE;
+                               break;
+                       }
                }
        case JZ4740_MMC_STATE_DONE:
                break;
--

1.9.2