summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Elwell <phil@raspberrypi.org>2015-05-07 09:22:23 +0100
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:13:21 +0100
commit6e2339c634adc32971915ec4e4daf24f99398f8d (patch)
treede51fb990e5e2eca2a6336f75d2f63e3d01fd74a
parentf41cad34369ac3022cd0720b22a91562a1473e1d (diff)
downloadlinux-6e2339c634adc32971915ec4e4daf24f99398f8d.tar.gz
bcm2835-sdhost: Error handling fix, and code clarification
-rw-r--r--drivers/mmc/host/bcm2835-sdhost.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c
index 0c311b56fe3e..542ae120b812 100644
--- a/drivers/mmc/host/bcm2835-sdhost.c
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -1041,13 +1041,14 @@ static u32 bcm2835_sdhost_data_irq(struct bcm2835_host *host, u32 intmask)
host->cmd->error = -EILSEQ;
/* Use the block interrupt for writes after the first block */
- if (!(host->data->flags & MMC_DATA_READ)) {
+ if (host->data->flags & MMC_DATA_WRITE) {
host->hcfg &= ~(SDHCFG_DATA_IRPT_EN);
host->hcfg |= SDHCFG_BLOCK_IRPT_EN;
bcm2835_sdhost_write(host, host->hcfg, SDHCFG);
if (host->data->error)
bcm2835_sdhost_finish_data(host);
- bcm2835_sdhost_transfer_pio(host);
+ else
+ bcm2835_sdhost_transfer_pio(host);
} else {
if (!host->data->error) {
bcm2835_sdhost_transfer_pio(host);
@@ -1132,12 +1133,12 @@ static irqreturn_t bcm2835_sdhost_irq(int irq, void *dev_id)
bcm2835_sdhost_dumpregs(host);
}
- if (loops)
- early |= handled;
-
if (!handled)
break;
+ if (loops)
+ early |= handled;
+
result = IRQ_HANDLED;
/* Clear all interrupts and notifications */