public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: atmel-mci: fix deadlock
@ 2012-05-09  9:23 Steffen Kühn
       [not found] ` <4FAA4ADA.1080008@atmel.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Steffen Kühn @ 2012-05-09  9:23 UTC (permalink / raw)
  To: Ludovic Desroches, Chris Ball, linux-mmc, linux-kernel; +Cc: Steffen Kühn

solves a deadlock problem which appears when a mmc card is
removing and a process is reading from the card at the same time.
---
 drivers/mmc/host/atmel-mci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index e94476b..effdc36 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1499,8 +1499,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;
--
1.7.2.5

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

end of thread, other threads:[~2012-05-15 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09  9:23 [PATCH] mmc: atmel-mci: fix deadlock Steffen Kühn
     [not found] ` <4FAA4ADA.1080008@atmel.com>
2012-05-09 12:12   ` Steffen Kühn
2012-05-15 16:05   ` 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