aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2009-06-14 08:52:38 -0400
committerPierre Ossman <pierre@ossman.eu>2009-06-21 15:00:58 -0400
commit6882a8c071d609f4c088bee41e79572c7cfc1790 (patch)
tree563dd6353135c2332ece3751492a690d28bca2e2 /drivers/mmc/host/sdhci.c
parent0d1bb41ad4ebca92fafbab6d6c60438d7efef386 (diff)
sdhci: Add better ADMA error reporting
Update the ADMA error reporting to not only show the overall controller state but also to print the ADMA descriptor list. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 35789c6edc19..e54d6fba85e1 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1382,6 +1382,35 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask)
1382 sdhci_finish_command(host); 1382 sdhci_finish_command(host);
1383} 1383}
1384 1384
1385#ifdef DEBUG
1386static void sdhci_show_adma_error(struct sdhci_host *host)
1387{
1388 const char *name = mmc_hostname(host->mmc);
1389 u8 *desc = host->adma_desc;
1390 __le32 *dma;
1391 __le16 *len;
1392 u8 attr;
1393
1394 sdhci_dumpregs(host);
1395
1396 while (true) {
1397 dma = (__le32 *)(desc + 4);
1398 len = (__le16 *)(desc + 2);
1399 attr = *desc;
1400
1401 DBG("%s: %p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
1402 name, desc, le32_to_cpu(*dma), le16_to_cpu(*len), attr);
1403
1404 desc += 8;
1405
1406 if (attr & 2)
1407 break;
1408 }
1409}
1410#else
1411static void sdhci_show_adma_error(struct sdhci_host *host) { }
1412#endif
1413
1385static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) 1414static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
1386{ 1415{
1387 BUG_ON(intmask == 0); 1416 BUG_ON(intmask == 0);
@@ -1411,8 +1440,11 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
1411 host->data->error = -ETIMEDOUT; 1440 host->data->error = -ETIMEDOUT;
1412 else if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_END_BIT)) 1441 else if (intmask & (SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_END_BIT))
1413 host->data->error = -EILSEQ; 1442 host->data->error = -EILSEQ;
1414 else if (intmask & SDHCI_INT_ADMA_ERROR) 1443 else if (intmask & SDHCI_INT_ADMA_ERROR) {
1444 printk(KERN_ERR "%s: ADMA error\n", mmc_hostname(host->mmc));
1445 sdhci_show_adma_error(host);
1415 host->data->error = -EIO; 1446 host->data->error = -EIO;
1447 }
1416 1448
1417 if (host->data->error) 1449 if (host->data->error)
1418 sdhci_finish_data(host); 1450 sdhci_finish_data(host);