From patchwork Fri Jul 6 09:58:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 1164711 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4BEEADF236 for ; Fri, 6 Jul 2012 10:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756616Ab2GFK1q (ORCPT ); Fri, 6 Jul 2012 06:27:46 -0400 Received: from newsmtp5.atmel.com ([204.2.163.5]:7365 "EHLO sjogate2.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755829Ab2GFK1q (ORCPT ); Fri, 6 Jul 2012 06:27:46 -0400 Received: from meyreuil.atmel.fr ([10.159.254.132]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id q669rs7C011422; Fri, 6 Jul 2012 02:53:55 -0700 (PDT) Received: from ibiza.rfo.atmel.com ([10.159.245.197]) by meyreuil.atmel.fr (8.11.7p1+Sun/8.11.7) with ESMTP id q669wY713418; Fri, 6 Jul 2012 11:58:34 +0200 (MEST) From: Nicolas Ferre To: linux-mmc@vger.kernel.org, Ludovic.Desroches@atmel.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Ferre , Seungwon Jeon Subject: [PATCH] mmc: atmel-mci: fix incorrect setting of host->data to NULL Date: Fri, 6 Jul 2012 11:58:33 +0200 Message-Id: <1341568713-8869-1-git-send-email-nicolas.ferre@atmel.com> X-Mailer: git-send-email 1.7.5.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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. Signed-off-by: Nicolas Ferre Cc: Seungwon Jeon --- drivers/mmc/host/atmel-mci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 78e5326..2ce109d 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -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: