linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Hannemann <arnd@arndnet.de>
To: linux-mmc@vger.kernel.org
Cc: Ian Molton <spyro@f2s.com>,
	linux-sh@vger.kernel.org, Arnd Hannemann <arnd@arndnet.de>
Subject: [PATCH 2/2] tmio_mmc: fix CMD irq handling
Date: Thu, 23 Sep 2010 13:33:54 +0000	[thread overview]
Message-ID: <1285248834-4434-2-git-send-email-arnd@arndnet.de> (raw)
In-Reply-To: <1285248834-4434-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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index cb66af5..75a0aca 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -430,8 +430,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.0.4


  reply	other threads:[~2010-09-23 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 13:33 [PATCH 1/2] tmio_mmc: handle missing HW interrupts Arnd Hannemann
2010-09-23 13:33 ` Arnd Hannemann [this message]
     [not found] <4C9B5BF4.3070109@arndnet.de>
     [not found] ` <AANLkTi=B=pcxVTMSxk2Orftp8zH7o8jebL1hbQ52dyzH@mail.gmail.com>
2010-09-24  8:13   ` [PATCH 2/2] tmio_mmc: fix CMD irq handling Arnd Hannemann

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=1285248834-4434-2-git-send-email-arnd@arndnet.de \
    --to=arnd@arndnet.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=spyro@f2s.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;
as well as URLs for NNTP newsgroup(s).