aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Pisa <ppisa@pikron.com>2007-03-07 18:00:40 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-03-12 12:49:37 -0400
commit2cb3320b3fb788eb95afbfea8686f11bb14e30b0 (patch)
treeb0f737af20fa8cb6cbc3ba3309eb45da86b4d338
parentb3c6b76ffb1a8c8d1f12e838a25c1a86f5316e2c (diff)
[ARM] 4256/1: i.MX/MX1 SDHC fix/workaround of SD card recognition problems
The SDHC controllers cannot process shorter transfers. They has to be handled as longer ones, but it such case CRC error is evaluated. There was a case in the code still, where this error is not ignored as it should to be process these transfers. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/mmc/imxmmc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c
index b060d4bfba29..0de5c9e94e74 100644
--- a/drivers/mmc/imxmmc.c
+++ b/drivers/mmc/imxmmc.c
@@ -569,10 +569,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
569 569
570 if(host->dma_dir == DMA_FROM_DEVICE) { 570 if(host->dma_dir == DMA_FROM_DEVICE) {
571 imxmci_busy_wait_for_status(host, &stat, 571 imxmci_busy_wait_for_status(host, &stat,
572 STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE, 572 STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE |
573 STATUS_TIME_OUT_READ,
573 50, "imxmci_cpu_driven_data read"); 574 50, "imxmci_cpu_driven_data read");
574 575
575 while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && 576 while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) &&
577 !(stat & STATUS_TIME_OUT_READ) &&
576 (host->data_cnt < 512)) { 578 (host->data_cnt < 512)) {
577 579
578 udelay(20); /* required for clocks < 8MHz*/ 580 udelay(20); /* required for clocks < 8MHz*/
@@ -602,6 +604,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat)
602 if(host->dma_size & 0x1ff) 604 if(host->dma_size & 0x1ff)
603 stat &= ~STATUS_CRC_READ_ERR; 605 stat &= ~STATUS_CRC_READ_ERR;
604 606
607 if(stat & STATUS_TIME_OUT_READ) {
608 dev_dbg(mmc_dev(host->mmc), "imxmci_cpu_driven_data read timeout STATUS = 0x%x\n",
609 stat);
610 trans_done = -1;
611 }
612
605 } else { 613 } else {
606 imxmci_busy_wait_for_status(host, &stat, 614 imxmci_busy_wait_for_status(host, &stat,
607 STATUS_APPL_BUFF_FE, 615 STATUS_APPL_BUFF_FE,
@@ -709,6 +717,9 @@ static void imxmci_tasklet_fnc(unsigned long data)
709 */ 717 */
710 stat |= host->status_reg; 718 stat |= host->status_reg;
711 719
720 if(test_bit(IMXMCI_PEND_CPU_DATA_b, &host->pending_events))
721 stat &= ~STATUS_CRC_READ_ERR;
722
712 if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { 723 if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) {
713 imxmci_busy_wait_for_status(host, &stat, 724 imxmci_busy_wait_for_status(host, &stat,
714 STATUS_END_CMD_RESP | STATUS_ERR_MASK, 725 STATUS_END_CMD_RESP | STATUS_ERR_MASK,