Skip to content

Commit 182c908

Browse files
Seungwon Jeoncjb
authored andcommitted
mmc: dw_mmc: amend using error interrupt status
RINTSTS status includes masked interrupts as well as unmasked. data_status and cmd_status are set by value of RINTSTS in interrupt handler and tasklet finally uses it to decide whether error is happened or not. In addition, MINTSTS status is used for setting data_status in PIO. Masked error interrupt will not be handled and that status can be considered non-error case. Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed By: Girish K S <girish.shivananjappa@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 077d407 commit 182c908

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,12 +1547,11 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
15471547
static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
15481548
{
15491549
struct dw_mci *host = dev_id;
1550-
u32 status, pending;
1550+
u32 pending;
15511551
unsigned int pass_count = 0;
15521552
int i;
15531553

15541554
do {
1555-
status = mci_readl(host, RINTSTS);
15561555
pending = mci_readl(host, MINTSTS); /* read-only mask reg */
15571556

15581557
/*
@@ -1570,15 +1569,15 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
15701569

15711570
if (pending & DW_MCI_CMD_ERROR_FLAGS) {
15721571
mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
1573-
host->cmd_status = status;
1572+
host->cmd_status = pending;
15741573
smp_wmb();
15751574
set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
15761575
}
15771576

15781577
if (pending & DW_MCI_DATA_ERROR_FLAGS) {
15791578
/* if there is an error report DATA_ERROR */
15801579
mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS);
1581-
host->data_status = status;
1580+
host->data_status = pending;
15821581
smp_wmb();
15831582
set_bit(EVENT_DATA_ERROR, &host->pending_events);
15841583
if (!(pending & (SDMMC_INT_DTO | SDMMC_INT_DCRC |
@@ -1589,7 +1588,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
15891588
if (pending & SDMMC_INT_DATA_OVER) {
15901589
mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER);
15911590
if (!host->data_status)
1592-
host->data_status = status;
1591+
host->data_status = pending;
15931592
smp_wmb();
15941593
if (host->dir_status == DW_MCI_RECV_STATUS) {
15951594
if (host->sg != NULL)
@@ -1613,7 +1612,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
16131612

16141613
if (pending & SDMMC_INT_CMD_DONE) {
16151614
mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
1616-
dw_mci_cmd_interrupt(host, status);
1615+
dw_mci_cmd_interrupt(host, pending);
16171616
}
16181617

16191618
if (pending & SDMMC_INT_CD) {

0 commit comments

Comments
 (0)