aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeungwon Jeon <tgih.jun@samsung.com>2012-07-31 20:30:30 -0400
committerChris Ball <cjb@laptop.org>2012-09-04 13:58:08 -0400
commit182c90815993452f1902837cc342ac2c05ef13f5 (patch)
treea1c07245f4654ae67e5d6e4f161a23a55bb783c7
parent077d40731edc90ee9dedf63249034c8cd5f694ce (diff)
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>
-rw-r--r--drivers/mmc/host/dw_mmc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 72dc3cde646..7baed457dc3 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1547,12 +1547,11 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
1547static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) 1547static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1548{ 1548{
1549 struct dw_mci *host = dev_id; 1549 struct dw_mci *host = dev_id;
1550 u32 status, pending; 1550 u32 pending;
1551 unsigned int pass_count = 0; 1551 unsigned int pass_count = 0;
1552 int i; 1552 int i;
1553 1553
1554 do { 1554 do {
1555 status = mci_readl(host, RINTSTS);
1556 pending = mci_readl(host, MINTSTS); /* read-only mask reg */ 1555 pending = mci_readl(host, MINTSTS); /* read-only mask reg */
1557 1556
1558 /* 1557 /*
@@ -1570,7 +1569,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1570 1569
1571 if (pending & DW_MCI_CMD_ERROR_FLAGS) { 1570 if (pending & DW_MCI_CMD_ERROR_FLAGS) {
1572 mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS); 1571 mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
1573 host->cmd_status = status; 1572 host->cmd_status = pending;
1574 smp_wmb(); 1573 smp_wmb();
1575 set_bit(EVENT_CMD_COMPLETE, &host->pending_events); 1574 set_bit(EVENT_CMD_COMPLETE, &host->pending_events);
1576 } 1575 }
@@ -1578,7 +1577,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1578 if (pending & DW_MCI_DATA_ERROR_FLAGS) { 1577 if (pending & DW_MCI_DATA_ERROR_FLAGS) {
1579 /* if there is an error report DATA_ERROR */ 1578 /* if there is an error report DATA_ERROR */
1580 mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS); 1579 mci_writel(host, RINTSTS, DW_MCI_DATA_ERROR_FLAGS);
1581 host->data_status = status; 1580 host->data_status = pending;
1582 smp_wmb(); 1581 smp_wmb();
1583 set_bit(EVENT_DATA_ERROR, &host->pending_events); 1582 set_bit(EVENT_DATA_ERROR, &host->pending_events);
1584 if (!(pending & (SDMMC_INT_DTO | SDMMC_INT_DCRC | 1583 if (!(pending & (SDMMC_INT_DTO | SDMMC_INT_DCRC |
@@ -1589,7 +1588,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1589 if (pending & SDMMC_INT_DATA_OVER) { 1588 if (pending & SDMMC_INT_DATA_OVER) {
1590 mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER); 1589 mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER);
1591 if (!host->data_status) 1590 if (!host->data_status)
1592 host->data_status = status; 1591 host->data_status = pending;
1593 smp_wmb(); 1592 smp_wmb();
1594 if (host->dir_status == DW_MCI_RECV_STATUS) { 1593 if (host->dir_status == DW_MCI_RECV_STATUS) {
1595 if (host->sg != NULL) 1594 if (host->sg != NULL)
@@ -1613,7 +1612,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1613 1612
1614 if (pending & SDMMC_INT_CMD_DONE) { 1613 if (pending & SDMMC_INT_CMD_DONE) {
1615 mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE); 1614 mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
1616 dw_mci_cmd_interrupt(host, status); 1615 dw_mci_cmd_interrupt(host, pending);
1617 } 1616 }
1618 1617
1619 if (pending & SDMMC_INT_CD) { 1618 if (pending & SDMMC_INT_CD) {