public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RFC: mmc: dw_mmc: Don't clear errors we aren't handling
@ 2013-03-15 21:30 Doug Anderson
  0 siblings, 0 replies; only message in thread
From: Doug Anderson @ 2013-03-15 21:30 UTC (permalink / raw)
  To: Chris Ball
  Cc: Will Newton, Seungwon Jeon, Bing Zhao, Jaehoon Chung,
	Ashok Nagarajan, Paul Stewart, Olof Johansson, Doug Anderson,
	linux-mmc, linux-kernel

Although there are no known cases of this being a problem (and it may
be technically impossible for the hardware to report more errors once
already in the error state), it seems unwise for us to be clearing
error interrupts that we didn't actually read.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/mmc/host/dw_mmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 9834221..84ae704 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1583,7 +1583,8 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 			break;
 
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
-			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
+			mci_writel(host, RINTSTS,
+				   pending & DW_MCI_CMD_ERROR_FLAGS);
 			host->cmd_status = pending;
 			smp_wmb();
 			set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
@@ -1591,7 +1592,8 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 
 		if (pending & DW_MCI_DATA_ERROR_FLAGS) {
 			/* if there is an error report DATA_ERROR */
-			mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS);
+			mci_writel(host, RINTSTS,
+				   pending & DW_MCI_DATA_ERROR_FLAGS);
 			host->data_status = pending;
 			smp_wmb();
 			set_bit(EVENT_DATA_ERROR, &host->pending_events);
-- 
1.8.1.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-03-15 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 21:30 [PATCH] RFC: mmc: dw_mmc: Don't clear errors we aren't handling Doug Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox