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: 1164611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5625C3FE80 for ; Fri, 6 Jul 2012 10:08:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sn5Mo-0005wH-Rz; Fri, 06 Jul 2012 10:02:26 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sn5JV-0004yR-GM for linux-arm-kernel@merlin.infradead.org; Fri, 06 Jul 2012 09:59:01 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sn5JO-0004Wi-PK for linux-arm-kernel@lists.infradead.org; Fri, 06 Jul 2012 09:58:56 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120706_105855_372905_EC4B5FE0 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal information Cc: Seungwon Jeon , Nicolas Ferre , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Acked-by: Ludovic Desroches --- 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: