Skip to contentSkip to conversation

mmc: atmel-mci: fix incorrect setting of host->data to NULL

PATCH New Nicolas Ferre 3 participants 3 messages Jul 6, 2012 – Jul 10, 2012

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

PATCH 1/1 mmc: atmel-mci: fix incorrect setting of host->data to NULL

Setting host->data to NULL is incorrect sequence in STATE_SENDING_STOP state of FSM: This early setting leads to the skip of dma_unmap_sg() in atmci_dma_cleanup() which is a bug.

Idea taken form dw_mmc by Seungwon Jeon.

---
 drivers/mmc/host/atmel-mci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/atmel-mci.c +1 -1
index 78e5326..2ce109d 100644
@@ -1860,7 +1860,6 @@ static void atmci_tasklet_func(unsigned long priv)
 
 			dev_dbg(&host->pdev->dev, "FSM: cmd ready\n");
 			host->cmd = NULL;
-			host->data = NULL;
 			data->bytes_xfered = data->blocks * data->blksz;
 			data->error = 0;
 			atmci_command_complete(host, mrq->stop);
@@ -1874,6 +1873,7 @@ static void atmci_tasklet_func(unsigned long priv)
 				atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
 				state = STATE_WAITING_NOTBUSY;
 			}
+			host->data = NULL;
 			break;
 
 		case STATE_END_REQUEST:
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 mmc: atmel-mci: fix incorrect setting of host->data to NULL

Le 07/06/2012 11:58 AM, Nicolas Ferre a ?crit :

Quoted 8 lines

Setting host->data to NULL is incorrect sequence in STATE_SENDING_STOP state of FSM: This early setting leads to the skip of dma_unmap_sg() in atmci_dma_cleanup() which is a bug.

Idea taken form dw_mmc by Seungwon Jeon.

Thanks

Quoted 25 lines
---
  drivers/mmc/host/atmel-mci.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/atmel-mci.c +1 -1
index 78e5326..2ce109d 100644
@@ -1860,7 +1860,6 @@ static void atmci_tasklet_func(unsigned long priv)
 
  			dev_dbg(&host->pdev->dev, "FSM: cmd ready\n");
  			host->cmd = NULL;
-			host->data = NULL;
  			data->bytes_xfered = data->blocks * data->blksz;
  			data->error = 0;
  			atmci_command_complete(host, mrq->stop);
@@ -1874,6 +1873,7 @@ static void atmci_tasklet_func(unsigned long priv)
  				atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
  				state = STATE_WAITING_NOTBUSY;
  			}
+			host->data = NULL;
  			break;
 
  		case STATE_END_REQUEST:
#2 lore raw

PATCH 1/1 mmc: atmel-mci: fix incorrect setting of host->data to NULL

Hi,

Quoted 11 lines · ludovic.desroches

Le 07/06/2012 11:58 AM, Nicolas Ferre a ?crit :

Quoted 8 lines

Setting host->data to NULL is incorrect sequence in STATE_SENDING_STOP state of FSM: This early setting leads to the skip of dma_unmap_sg() in atmci_dma_cleanup() which is a bug.

Idea taken form dw_mmc by Seungwon Jeon.

Thanks, pushed to mmc-next for 3.6.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child