LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: fix bug that cause mmc_test failture
@ 2015-01-26 12:04 Addy Ke
  2015-02-10  9:34 ` Olof Johansson
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Addy Ke @ 2015-01-26 12:04 UTC (permalink / raw)
  To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
	rdunlap, tgih.jun, jh80.chung, chris, ulf.hansson, dinguyen,
	heiko, olof, dianders, sonnyrao, amstan
  Cc: devicetree, linux-doc, linux-kernel, linux-mmc, linux-arm-kernel,
	linux-rockchip, zhenfu.fang, cf, lintao, chenfen, zyf, xjq,
	huangtao, zyw, yzq, hj, kever.yang, zhangqing, hl, Addy Ke

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 <addy.ke@rock-chips.com>
---
 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..4bd7df1 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) ||
+				    !(host->data_status & 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) ||
+				    !(host->data_status & SDMMC_INT_EBE))
+					send_stop_abort(host, data);
 				state = STATE_DATA_ERROR;
 				break;
 			}
-- 
1.8.3.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-02-27  7:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 12:04 [PATCH] mmc: dw_mmc: fix bug that cause mmc_test failture Addy Ke
2015-02-10  9:34 ` Olof Johansson
2015-02-11  3:03   ` Addy
2015-02-19 22:39 ` Doug Anderson
2015-02-20  2:55 ` [PATCH v2] " Addy Ke
2015-02-20 21:43   ` Doug Anderson
2015-02-25 18:17   ` Javier Martinez Canillas
2015-02-27  7:11     ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).