aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-06-30 17:40:37 -0400
committerPierre Ossman <drzeus@drzeus.cx>2008-07-15 08:14:48 -0400
commitff8c804f1fdecb198c4be57155c61800e0d37bd2 (patch)
tree779472a077e4c1d32a918b27ad44c4ed3d97dd72 /drivers
parent50a845700b3b55f825b0eb901b03d6091f66d9f4 (diff)
MMC: S3C24XX: Update error debugging.
Add better debugging to show where errors are being generated, as some error codes can come from several different code paths. Also fix the error return path from s3cmci_setup_data() to return the error it returned to the request. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/s3cmci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 62d73d3497f0..2b4839536975 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -450,6 +450,7 @@ static irqreturn_t s3cmci_irq(int irq, void *dev_id)
450 } 450 }
451 451
452 if (mci_csta & S3C2410_SDICMDSTAT_CMDTIMEOUT) { 452 if (mci_csta & S3C2410_SDICMDSTAT_CMDTIMEOUT) {
453 dbg(host, dbg_err, "CMDSTAT: error CMDTIMEOUT\n");
453 cmd->error = -ETIMEDOUT; 454 cmd->error = -ETIMEDOUT;
454 host->status = "error: command timeout"; 455 host->status = "error: command timeout";
455 goto fail_transfer; 456 goto fail_transfer;
@@ -505,12 +506,14 @@ static irqreturn_t s3cmci_irq(int irq, void *dev_id)
505 /* Check for FIFO failure */ 506 /* Check for FIFO failure */
506 if (host->is2440) { 507 if (host->is2440) {
507 if (mci_fsta & S3C2440_SDIFSTA_FIFOFAIL) { 508 if (mci_fsta & S3C2440_SDIFSTA_FIFOFAIL) {
509 dbg(host, dbg_err, "FIFO failure\n");
508 host->mrq->data->error = -EILSEQ; 510 host->mrq->data->error = -EILSEQ;
509 host->status = "error: 2440 fifo failure"; 511 host->status = "error: 2440 fifo failure";
510 goto fail_transfer; 512 goto fail_transfer;
511 } 513 }
512 } else { 514 } else {
513 if (mci_dsta & S3C2410_SDIDSTA_FIFOFAIL) { 515 if (mci_dsta & S3C2410_SDIDSTA_FIFOFAIL) {
516 dbg(host, dbg_err, "FIFO failure\n");
514 cmd->data->error = -EILSEQ; 517 cmd->data->error = -EILSEQ;
515 host->status = "error: fifo failure"; 518 host->status = "error: fifo failure";
516 goto fail_transfer; 519 goto fail_transfer;
@@ -518,18 +521,21 @@ static irqreturn_t s3cmci_irq(int irq, void *dev_id)
518 } 521 }
519 522
520 if (mci_dsta & S3C2410_SDIDSTA_RXCRCFAIL) { 523 if (mci_dsta & S3C2410_SDIDSTA_RXCRCFAIL) {
524 dbg(host, dbg_err, "bad data crc (outgoing)\n");
521 cmd->data->error = -EILSEQ; 525 cmd->data->error = -EILSEQ;
522 host->status = "error: bad data crc (outgoing)"; 526 host->status = "error: bad data crc (outgoing)";
523 goto fail_transfer; 527 goto fail_transfer;
524 } 528 }
525 529
526 if (mci_dsta & S3C2410_SDIDSTA_CRCFAIL) { 530 if (mci_dsta & S3C2410_SDIDSTA_CRCFAIL) {
531 dbg(host, dbg_err, "bad data crc (incoming)\n");
527 cmd->data->error = -EILSEQ; 532 cmd->data->error = -EILSEQ;
528 host->status = "error: bad data crc (incoming)"; 533 host->status = "error: bad data crc (incoming)";
529 goto fail_transfer; 534 goto fail_transfer;
530 } 535 }
531 536
532 if (mci_dsta & S3C2410_SDIDSTA_DATATIMEOUT) { 537 if (mci_dsta & S3C2410_SDIDSTA_DATATIMEOUT) {
538 dbg(host, dbg_err, "data timeout\n");
533 cmd->data->error = -ETIMEDOUT; 539 cmd->data->error = -ETIMEDOUT;
534 host->status = "error: data timeout"; 540 host->status = "error: data timeout";
535 goto fail_transfer; 541 goto fail_transfer;
@@ -956,8 +962,9 @@ static void s3cmci_send_request(struct mmc_host *mmc)
956 host->dcnt++; 962 host->dcnt++;
957 963
958 if (res) { 964 if (res) {
959 cmd->error = -EINVAL; 965 dbg(host, dbg_err, "setup data error %d\n", res);
960 cmd->data->error = -EINVAL; 966 cmd->error = res;
967 cmd->data->error = res;
961 968
962 mmc_request_done(mmc, mrq); 969 mmc_request_done(mmc, mrq);
963 return; 970 return;
@@ -969,6 +976,7 @@ static void s3cmci_send_request(struct mmc_host *mmc)
969 res = s3cmci_prepare_pio(host, cmd->data); 976 res = s3cmci_prepare_pio(host, cmd->data);
970 977
971 if (res) { 978 if (res) {
979 dbg(host, dbg_err, "data prepare error %d\n", res);
972 cmd->error = res; 980 cmd->error = res;
973 cmd->data->error = res; 981 cmd->data->error = res;
974 982