Date:2011-03-16 13:20:24 (11 years 6 months ago)
Author:Lars C.
Commit:2a91a0daaf6fd2195782d4b76a94c0628c089581
Message:MMC: JZ4740: Read status register before clearing irq flags

The JZ4750 and JZ4760 have additional bits in the irq register for the different
error conditions. If the bit in the irq register is cleared the matching bit in
the status register is cleared as well, so the status register has to be read
before those bits are cleared, otherwise error conditions are undetected.
Files: drivers/mmc/host/jz4740_mmc.c (2 diffs)

Change Details

drivers/mmc/host/jz4740_mmc.c
528528    struct mmc_command *cmd = host->cmd;
529529    uint16_t irq_reg, status, tmp;
530530
531    status = readl(host->base + JZ_REG_MMC_STATUS);
531532    irq_reg = readw(host->base + JZ_REG_MMC_IREG);
532
533533    tmp = irq_reg;
534534    irq_reg &= ~host->irq_mask;
535535
...... 
549549        if (test_and_clear_bit(0, &host->waiting)) {
550550            del_timer(&host->timeout_timer);
551551
552            status = readl(host->base + JZ_REG_MMC_STATUS);
553
554552            if (status & JZ_MMC_STATUS_TIMEOUT_RES) {
555553                    cmd->error = -ETIMEDOUT;
556554            } else if (status & JZ_MMC_STATUS_CRC_RES_ERR) {

Archive Download the corresponding diff file



interactive