Skip to content

Commit

Permalink
bcm2835-sdhost: Error handling fix, and code clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elwell authored and popcornmix committed May 15, 2015
1 parent 88a6d66 commit 63c657c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/mmc/host/bcm2835-sdhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 63c657c

Please sign in to comment.