aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-11-14 08:36:12 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-01 22:45:55 -0500
commit8a93758170a58b5afe3e45d7d5bebbdd401a24c2 (patch)
treefcc4682ba6204b15daeaa6aa2d5bbc4cfafa7945 /drivers/ata/libata-eh.c
parent5e56a37c3706498b25049bb556928c461875250f (diff)
[PATCH] libata: improve failed qc reporting
Improve failed qc reporting. The original message didn't include the actual command nor full error status and it was necessary to temporarily patch the code to find out exactly which command is causing problem. This patch makes EH report full command and result TFs along with data direction and length. This change will make bug reports more useful. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index e69f3df2ea39..3771eb83875f 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1433,16 +1433,38 @@ static void ata_eh_report(struct ata_port *ap)
1433 } 1433 }
1434 1434
1435 for (tag = 0; tag < ATA_MAX_QUEUE; tag++) { 1435 for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
1436 static const char *dma_str[] = {
1437 [DMA_BIDIRECTIONAL] = "bidi",
1438 [DMA_TO_DEVICE] = "out",
1439 [DMA_FROM_DEVICE] = "in",
1440 [DMA_NONE] = "",
1441 };
1436 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag); 1442 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
1443 struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
1444 unsigned int nbytes;
1437 1445
1438 if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask) 1446 if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
1439 continue; 1447 continue;
1440 1448
1441 ata_dev_printk(qc->dev, KERN_ERR, "tag %d cmd 0x%x " 1449 nbytes = qc->nbytes;
1442 "Emask 0x%x stat 0x%x err 0x%x (%s)\n", 1450 if (!nbytes)
1443 qc->tag, qc->tf.command, qc->err_mask, 1451 nbytes = qc->nsect << 9;
1444 qc->result_tf.command, qc->result_tf.feature, 1452
1445 ata_err_string(qc->err_mask)); 1453 ata_dev_printk(qc->dev, KERN_ERR,
1454 "cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
1455 "tag %d data %u %s\n "
1456 "res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
1457 "Emask 0x%x (%s)\n",
1458 cmd->command, cmd->feature, cmd->nsect,
1459 cmd->lbal, cmd->lbam, cmd->lbah,
1460 cmd->hob_feature, cmd->hob_nsect,
1461 cmd->hob_lbal, cmd->hob_lbam, cmd->hob_lbah,
1462 cmd->device, qc->tag, nbytes, dma_str[qc->dma_dir],
1463 res->command, res->feature, res->nsect,
1464 res->lbal, res->lbam, res->lbah,
1465 res->hob_feature, res->hob_nsect,
1466 res->hob_lbal, res->hob_lbam, res->hob_lbah,
1467 res->device, qc->err_mask, ata_err_string(qc->err_mask));
1446 } 1468 }
1447} 1469}
1448 1470