Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbbBTC4S (ORCPT ); Thu, 19 Feb 2015 21:56:18 -0500 Received: from regular1.263xmail.com ([211.150.99.133]:49563 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752810AbbBTC4R (ORCPT ); Thu, 19 Feb 2015 21:56:17 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: addy.ke@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 124.248.208.12 X-LOGIN-NAME: addy.ke@rock-chips.com X-UNIQUE-TAG: <27e31335136550bee0ed5b52cccd722e> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 1 From: Addy Ke To: ulf.hansson@linaro.org, jh80.chung@samsung.com, olof@lixom.net, heiko@sntech.de Cc: javier.martinez@collabora.co.uk, huangtao@rock-chips.com, lintao@rock-chips.com, cf@rock-chips.com, linux-rockchip@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Addy Ke Subject: [PATCH v2] mmc: dw_mmc: fix bug that cause mmc_test failture Date: Fri, 20 Feb 2015 10:55:25 +0800 Message-Id: <1424400925-3867-1-git-send-email-addy.ke@rock-chips.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422273849-29773-1-git-send-email-addy.ke@rock-chips.com> References: <1422273849-29773-1-git-send-email-addy.ke@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1911 Lines: 56 The STOP command can terminate a data transfer between a memory card and mmc controller. As show in Synopsys DesignWare Cores Mobile Stroage Host Databook: Data timeout and Data end-bit error will terminate further data transfer by mmc controller. So we should not send abort command to terminate a data transfer again if we got DRTO and EBE interrupt. After this patch, all mmc_test cases can pass on RK3288-Pink2 board. Signed-off-by: Addy Ke --- Changes in v2: - DRTO and EBE are both set, should not send abort command too, suggested by Doug Anderson. drivers/mmc/host/dw_mmc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 4d2e3c2..a27048a 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1520,7 +1520,10 @@ static void dw_mci_tasklet_func(unsigned long priv) if (test_and_clear_bit(EVENT_DATA_ERROR, &host->pending_events)) { dw_mci_stop_dma(host); - send_stop_abort(host, data); + if (data->stop || + !(host->data_status & (SDMMC_INT_DRTO | + SDMMC_INT_EBE))) + send_stop_abort(host, data); state = STATE_DATA_ERROR; break; } @@ -1547,7 +1550,10 @@ static void dw_mci_tasklet_func(unsigned long priv) if (test_and_clear_bit(EVENT_DATA_ERROR, &host->pending_events)) { dw_mci_stop_dma(host); - send_stop_abort(host, data); + if (data->stop || + !(host->data_status & (SDMMC_INT_DRTO | + SDMMC_INT_EBE))) + send_stop_abort(host, data); state = STATE_DATA_ERROR; break; } -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/