From: Gerd Hoffmann <kraxel@redhat.com>
To: linux-rpi-kernel@lists.infradead.org
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Eric Anholt <eric@anholt.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org, Gerd Hoffmann <kraxel@redhat.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM
BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...),
Stephen Warren <swarren@wwwdotorg.org>,
Lee Jones <lee@kernel.org>,
linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM
BCM2835 ARM ARCHITECTURE),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 07/13] mmc: bcm2835: call bcm2835_busy_irq from irqthread
Date: Fri, 27 Jan 2017 00:37:20 +0100 [thread overview]
Message-ID: <1485473846-24537-8-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1485473846-24537-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/mmc/host/bcm2835.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 33eaebd..814812b 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -170,6 +170,7 @@ struct bcm2835_host {
/* for threaded irq handler */
bool irq_block;
+ bool irq_busy;
/* DMA part */
struct dma_chan *dma_chan_rx;
@@ -996,28 +997,19 @@ static void bcm2835_check_data_error(struct bcm2835_host *host, u32 intmask)
host->data->error = -ETIMEDOUT;
}
-static void bcm2835_busy_irq(struct bcm2835_host *host, u32 intmask)
+static void bcm2835_busy_irq(struct bcm2835_host *host)
{
- struct device *dev = &host->pdev->dev;
-
- if (!host->cmd) {
- dev_err(dev, "got command busy interrupt 0x%08x even though no command operation was in progress.\n",
- (unsigned int)intmask);
+ if (WARN_ON(!host->cmd)) {
bcm2835_dumpregs(host);
return;
}
- if (!host->use_busy) {
- dev_err(dev, "got command busy interrupt 0x%08x even though not expecting one.\n",
- (unsigned int)intmask);
+ if (WARN_ON(!host->use_busy)) {
bcm2835_dumpregs(host);
return;
}
host->use_busy = false;
- if (bcm2835_check_cmd_error(host, intmask))
- return;
-
bcm2835_finish_command(host, NULL);
}
@@ -1091,8 +1083,12 @@ static irqreturn_t bcm2835_irq(int irq, void *dev_id)
}
if (intmask & SDHSTS_BUSY_IRPT) {
- bcm2835_busy_irq(host, intmask);
- result = IRQ_HANDLED;
+ if (!bcm2835_check_cmd_error(host, intmask)) {
+ host->irq_busy = true;
+ result = IRQ_WAKE_THREAD;
+ } else {
+ result = IRQ_HANDLED;
+ }
}
/* There is no true data interrupt status bit, so it is
@@ -1114,15 +1110,19 @@ static irqreturn_t bcm2835_threaded_irq(int irq, void *dev_id)
{
struct bcm2835_host *host = dev_id;
unsigned long flags;
- bool block;
+ bool block, busy;
spin_lock_irqsave(&host->lock, flags);
block = host->irq_block;
+ busy = host->irq_busy;
host->irq_block = false;
+ host->irq_busy = false;
if (block)
bcm2835_block_irq(host);
+ if (busy)
+ bcm2835_busy_irq(host);
spin_unlock_irqrestore(&host->lock, flags);
--
1.8.3.1
next prev parent reply other threads:[~2017-01-26 23:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1485473846-24537-1-git-send-email-kraxel@redhat.com>
2017-01-26 23:37 ` [PATCH 01/13] mmc: bcm2835: add bcm2835_read_wait_sdcmd Gerd Hoffmann
2017-01-26 23:51 ` Florian Fainelli
2017-01-27 8:04 ` Gerd Hoffmann
2017-01-27 18:23 ` Florian Fainelli
2017-02-15 10:59 ` Jeremy McNicoll
2017-01-27 2:03 ` Shawn Lin
2017-01-27 10:28 ` Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 02/13] mmc: bcm2835: use bcm2835_read_wait_sdcmd in bcm2835_send_command Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 03/13] mmc: bcm2835: add bcm2835_threaded_irq Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 04/13] mmc: bcm2835: add bcm2835_check_data_error Gerd Hoffmann
2017-01-27 2:05 ` Shawn Lin
2017-01-27 10:31 ` Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 05/13] mmc: bcm2835: call bcm2835_block_irq from irqthread Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 06/13] mmc: bcm2835: add bcm2835_check_cmd_error Gerd Hoffmann
2017-01-26 23:37 ` Gerd Hoffmann [this message]
2017-01-26 23:37 ` [PATCH 08/13] mmc: bcm2835: split bcm2835_data_irq Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 09/13] mmc: bcm2835: switch locking to mutex Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 10/13] mmc: bcm2835: work queue is dead code now, zap Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 11/13] mmc: bcm2835: kill tasklet Gerd Hoffmann
2017-01-26 23:37 ` [PATCH 12/13] mmc: bcm2835: move timeout to thread context Gerd Hoffmann
2017-01-27 2:08 ` Shawn Lin
2017-01-26 23:37 ` [PATCH 13/13] mmc: bcm2835: use bcm2835_read_wait_sdcmd in bcm2835_finish_command Gerd Hoffmann
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=1485473846-24537-8-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=stefan.wahren@i2se.com \
--cc=swarren@wwwdotorg.org \
--cc=ulf.hansson@linaro.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
all inboxes | Powered by JetHome®