Skip to contentSkip to conversation

mmc: atmel-mci: abort transfer on timeout error

PATCH New ludovic.desroches at atmel.com 3 participants 3 messages Sep 9, 2013 – Sep 26, 2013

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

PATCH 1/1 mmc: atmel-mci: abort transfer on timeout error

From: Ludovic Desroches <[email protected]>

When a software timeout occurs, the transfer is not stopped. In DMA case, it causes DMA channel to be stuck because the transfer is still active causing following transfers to be queued but not computed.

---
 drivers/mmc/host/atmel-mci.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/mmc/host/atmel-mci.c +7 -0
index bdb84da..e9ea2fc 100644
@@ -582,6 +582,13 @@ static void atmci_timeout_timer(unsigned long data)
 	if (host->mrq->cmd->data) {
 		host->mrq->cmd->data->error = -ETIMEDOUT;
 		host->data = NULL;
+		/*
+		 * With some SDIO modules, sometimes DMA transfer hangs. If
+		 * stop_transfer() is not called then the DMA request is not
+		 * removed, following ones are queued and never computed.
+		 */
+		if (host->state == STATE_DATA_XFER)
+			host->stop_transfer(host);
 	} else {
 		host->mrq->cmd->error = -ETIMEDOUT;
 		host->cmd = NULL;
Signature · 1 line
1.7.11.3
#1 lore raw

PATCH 1/1 mmc: atmel-mci: abort transfer on timeout error

On 09/09/2013 17:29, ludovic.desroches at atmel.com :

Quoted 8 lines

From: Ludovic Desroches <[email protected]>

When a software timeout occurs, the transfer is not stopped. In DMA case, it causes DMA channel to be stuck because the transfer is still active causing following transfers to be queued but not computed.

Thanks.

Quoted 24 lines
---
  drivers/mmc/host/atmel-mci.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/mmc/host/atmel-mci.c +7 -0
index bdb84da..e9ea2fc 100644
@@ -582,6 +582,13 @@ static void atmci_timeout_timer(unsigned long data)
  	if (host->mrq->cmd->data) {
  		host->mrq->cmd->data->error = -ETIMEDOUT;
  		host->data = NULL;
+		/*
+		 * With some SDIO modules, sometimes DMA transfer hangs. If
+		 * stop_transfer() is not called then the DMA request is not
+		 * removed, following ones are queued and never computed.
+		 */
+		if (host->state == STATE_DATA_XFER)
+			host->stop_transfer(host);
  	} else {
  		host->mrq->cmd->error = -ETIMEDOUT;
  		host->cmd = NULL;
Signature · 1 line
Nicolas Ferre
#2 lore raw

PATCH 1/1 mmc: atmel-mci: abort transfer on timeout error

Hi,

Quoted 7 lines · Nicolas Ferre

On 09/09/2013 17:29, ludovic.desroches at atmel.com :

Quoted 6 lines

From: Ludovic Desroches <[email protected]>

When a software timeout occurs, the transfer is not stopped. In DMA case, it causes DMA channel to be stuck because the transfer is still active causing following transfers to be queued but not computed.

Quoted 5 lines
Quoted 3 lines

Thanks, pushed to mmc-next for 3.12.

- Chris.

Signature · 1 line
Chris Ball   <[email protected]>   <http://printf.net/>