linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Hannemann <arnd@arndnet.de>
To: linux-mmc@vger.kernel.org, Ian Molton <ian@mnementh.co.uk>
Cc: linux-sh@vger.kernel.org, Arnd Hannemann <arnd@arndnet.de>
Subject: [PATCH 2/2 v2] mmc: tmio: fix CMD irq handling
Date: Wed, 29 Dec 2010 13:21:14 +0000	[thread overview]
Message-ID: <1293628874-8140-3-git-send-email-arnd@arndnet.de> (raw)
In-Reply-To: <1293628874-8140-1-git-send-email-arnd@arndnet.de>

With current code card insert/eject interrupts will acknowledge outstanding
commands. Normally this seems to be no problem, however if the hardware gets
stuck and no interrupts for CMD_TIMEOUT or CMD_RESPEND are generated, then
inserting and ejecting cards will falsely acknowledge outstanding commands from
the core.

This patch changes the behavior so that CMDs are only acked, if
CMD_TIMEOUT or CMD_RESPEND is received.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
---
 drivers/mmc/host/tmio_mmc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index f980042..e4926c7 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -728,8 +728,10 @@ static irqreturn_t tmio_mmc_irq(int irq, void *devid)
  */
 
 		/* Command completion */
-		if (ireg & TMIO_MASK_CMD) {
-			ack_mmc_irqs(host, TMIO_MASK_CMD);
+		if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
+			ack_mmc_irqs(host,
+				     TMIO_STAT_CMDRESPEND |
+				     TMIO_STAT_CMDTIMEOUT);
 			tmio_mmc_cmd_irq(host, status);
 		}
 
-- 
1.7.2.3


  parent reply	other threads:[~2010-12-29 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 13:21 [PATCH 0/2 v2] mmc: tmio: handle missing HW interrupts Arnd Hannemann
2010-12-29 13:21 ` [PATCH 1/2 " Arnd Hannemann
2011-01-05 21:22   ` Chris Ball
2011-01-05 22:31     ` Arnd Hannemann
2011-01-05 22:44       ` Chris Ball
2010-12-29 13:21 ` Arnd Hannemann [this message]
2011-01-05 22:48   ` [PATCH 2/2 v2] mmc: tmio: fix CMD irq handling Chris Ball

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=1293628874-8140-3-git-send-email-arnd@arndnet.de \
    --to=arnd@arndnet.de \
    --cc=ian@mnementh.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).