aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/at91_mci.c
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2008-05-30 08:28:45 -0400
committerPierre Ossman <drzeus@drzeus.cx>2008-07-15 08:14:42 -0400
commitba7deeed96ca1855c153ad81c45baf6efe1a3362 (patch)
tree9abf223b5dff465f9dd1f0aa5e30d17f44afc685 /drivers/mmc/host/at91_mci.c
parent7a6588ba20aed4505da912f9dd73616e9bd9ba67 (diff)
mmc: at91_mci: do not read irq status twice as it will forget some errors
Reading AT91_MCI_SR again at the end of transfer can corrupt the error reporting. Some fields in the SR register are read-and-clear. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host/at91_mci.c')
-rw-r--r--drivers/mmc/host/at91_mci.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 9b546a97aa44..e1f91a42d521 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -660,10 +660,9 @@ static void at91_mci_process_next(struct at91mci_host *host)
660/* 660/*
661 * Handle a command that has been completed 661 * Handle a command that has been completed
662 */ 662 */
663static void at91_mci_completed_command(struct at91mci_host *host) 663static void at91_mci_completed_command(struct at91mci_host *host, unsigned int status)
664{ 664{
665 struct mmc_command *cmd = host->cmd; 665 struct mmc_command *cmd = host->cmd;
666 unsigned int status;
667 666
668 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB)); 667 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB));
669 668
@@ -677,10 +676,9 @@ static void at91_mci_completed_command(struct at91mci_host *host)
677 host->buffer = NULL; 676 host->buffer = NULL;
678 } 677 }
679 678
680 status = at91_mci_read(host, AT91_MCI_SR); 679 pr_debug("Status = %08X/%08x [%08X %08X %08X %08X]\n",
681 680 status, at91_mci_read(host, AT91_MCI_SR),
682 pr_debug("Status = %08X [%08X %08X %08X %08X]\n", 681 cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
683 status, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
684 682
685 if (status & AT91_MCI_ERRORS) { 683 if (status & AT91_MCI_ERRORS) {
686 if ((status & AT91_MCI_RCRCE) && !(mmc_resp_type(cmd) & MMC_RSP_CRC)) { 684 if ((status & AT91_MCI_RCRCE) && !(mmc_resp_type(cmd) & MMC_RSP_CRC)) {
@@ -877,7 +875,7 @@ static irqreturn_t at91_mci_irq(int irq, void *devid)
877 if (completed) { 875 if (completed) {
878 pr_debug("Completed command\n"); 876 pr_debug("Completed command\n");
879 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB)); 877 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB));
880 at91_mci_completed_command(host); 878 at91_mci_completed_command(host, int_status);
881 } else 879 } else
882 at91_mci_write(host, AT91_MCI_IDR, int_status & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB)); 880 at91_mci_write(host, AT91_MCI_IDR, int_status & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB));
883 881