mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Steffen Kühn" <sk@ammonit.com>
To: Ludovic Desroches <ludovic.desroches@atmel.com>,
	Chris Ball <cjb@laptop.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Steffen Kühn" <sk@ammonit.com>
Subject: [PATCH] mmc: atmel-mci: fix deadlock
Date: Wed,  9 May 2012 11:23:36 +0200	[thread overview]
Message-ID: <1336555416-14640-1-git-send-email-sk@ammonit.com> (raw)

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

             reply	other threads:[~2012-05-09  9:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09  9:23 Steffen Kühn [this message]
     [not found] ` <4FAA4ADA.1080008@atmel.com>
2012-05-09 12:12   ` Steffen Kühn
2012-05-15 16:05   ` Steffen Kühn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336555416-14640-1-git-send-email-sk@ammonit.com \
    --to=sk@ammonit.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®