* [PATCH] solve deadlock problem in atmel-mci (kernel 3.2)
@ 2012-05-07 11:27 Steffen Kühn
0 siblings, 0 replies; only message in thread
From: Steffen Kühn @ 2012-05-07 11:27 UTC (permalink / raw)
To: nicolas.ferre; +Cc: linux-kernel
Dear Nicolas,
the appended patch solves a deadlock problem which appears when a SD
card is removing and a process is reading from the card at the same
time. The problem occurs not always but only when there are
error-messages like 'end_request: I/O error, dev mmcblk0, sector XXX'
(probably a timing thing).
When the error occurs, the autodetection for SD card insertion does not
work anymore and unloading of the driver with 'rmmod' is no longer possible.
The patch seems to work very well with our hardware. But I have to say,
that I have not understand the mechanisms in the driver entirely. Please
check, if the patch make sense.
Best regards,
Steffen
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 94c377d..407648f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1480,8 +1480,10 @@ static void atmci_tasklet_func(unsigned long priv)
}
if (!atmci_test_and_clear_pending(host,
- EVENT_XFER_COMPLETE))
+ EVENT_XFER_COMPLETE)) {
+ host->stop_transfer(host);
break;
+ }
atmci_set_completed(host, EVENT_XFER_COMPLETE);
prev_state = state = STATE_DATA_BUSY;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-07 11:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 11:27 [PATCH] solve deadlock problem in atmel-mci (kernel 3.2) Steffen Kühn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox