aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/at91_mci.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index e1f91a42d521..e4d018b2fe9f 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -663,6 +663,7 @@ static void at91_mci_process_next(struct at91mci_host *host)
663static void at91_mci_completed_command(struct at91mci_host *host, unsigned int status) 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 struct mmc_data *data = cmd->data;
666 667
667 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB)); 668 at91_mci_write(host, AT91_MCI_IDR, 0xffffffff & ~(AT91_MCI_SDIOIRQA | AT91_MCI_SDIOIRQB));
668 669
@@ -685,15 +686,25 @@ static void at91_mci_completed_command(struct at91mci_host *host, unsigned int s
685 cmd->error = 0; 686 cmd->error = 0;
686 } 687 }
687 else { 688 else {
688 if (status & (AT91_MCI_RTOE | AT91_MCI_DTOE)) 689 if (status & (AT91_MCI_DTOE | AT91_MCI_DCRCE)) {
689 cmd->error = -ETIMEDOUT; 690 if (data) {
690 else if (status & (AT91_MCI_RCRCE | AT91_MCI_DCRCE)) 691 if (status & AT91_MCI_DTOE)
691 cmd->error = -EILSEQ; 692 data->error = -ETIMEDOUT;
692 else 693 else if (status & AT91_MCI_DCRCE)
693 cmd->error = -EIO; 694 data->error = -EILSEQ;
695 }
696 } else {
697 if (status & AT91_MCI_RTOE)
698 cmd->error = -ETIMEDOUT;
699 else if (status & AT91_MCI_RCRCE)
700 cmd->error = -EILSEQ;
701 else
702 cmd->error = -EIO;
703 }
694 704
695 pr_debug("Error detected and set to %d (cmd = %d, retries = %d)\n", 705 pr_debug("Error detected and set to %d/%d (cmd = %d, retries = %d)\n",
696 cmd->error, cmd->opcode, cmd->retries); 706 cmd->error, data ? data->error : 0,
707 cmd->opcode, cmd->retries);
697 } 708 }
698 } 709 }
699 else 710 else