aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/atmel-mci.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-05 09:16:59 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-10-05 14:39:21 -0400
commitca55f46e13dd07b029b0a3d64637f983a6627b23 (patch)
tree4451919320800974f1a937fe5ee25552307166a6 /drivers/mmc/host/atmel-mci.c
parent65e8b083fc8ec303499baa1924ae032d46d29990 (diff)
atmel-mci: Don't overwrite error bits when NOTBUSY is set
After a data error, we wait for the NOTBUSY bit to be set so that we can be sure the data transfer is completely finished. However, when NOTBUSY is set, the interrupt handler copies the contents of SR into data_status, overwriting any error bits we may have detected earlier. To avoid this, initialize data_status to 0 before starting a request, and don't overwrite it unless it still contains 0. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r--drivers/mmc/host/atmel-mci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index d45dfa259386..02529af7c747 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -694,6 +694,7 @@ static void atmci_start_request(struct atmel_mci *host,
694 694
695 host->pending_events = 0; 695 host->pending_events = 0;
696 host->completed_events = 0; 696 host->completed_events = 0;
697 host->data_status = 0;
697 698
698 if (host->need_reset) { 699 if (host->need_reset) {
699 mci_writel(host, CR, MCI_CR_SWRST); 700 mci_writel(host, CR, MCI_CR_SWRST);
@@ -1408,7 +1409,8 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
1408 if (pending & MCI_NOTBUSY) { 1409 if (pending & MCI_NOTBUSY) {
1409 mci_writel(host, IDR, 1410 mci_writel(host, IDR,
1410 ATMCI_DATA_ERROR_FLAGS | MCI_NOTBUSY); 1411 ATMCI_DATA_ERROR_FLAGS | MCI_NOTBUSY);
1411 host->data_status = status; 1412 if (!host->data_status)
1413 host->data_status = status;
1412 smp_wmb(); 1414 smp_wmb();
1413 atmci_set_pending(host, EVENT_DATA_COMPLETE); 1415 atmci_set_pending(host, EVENT_DATA_COMPLETE);
1414 tasklet_schedule(&host->tasklet); 1416 tasklet_schedule(&host->tasklet);