aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-acpi.c
diff options
context:
space:
mode:
authorRobert Hancock <hancockrwd@gmail.com>2009-07-14 22:43:39 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-09-01 19:47:20 -0400
commit6521148c6449724c3b707820b9c535c7e8b8afcd (patch)
treeb976cb33b4e7f09bdc765a09702659c14474c540 /drivers/ata/libata-acpi.c
parent1e641060c4b564e820abdb6a4c7a603a0d386250 (diff)
libata: add command name parsing for error output
This patch improve libata's output for error/notification messages to allow easier comprehension and debugging: When ATAPI commands issued through the SCSI layer fail, use SCSI functions to print the CDB in human-readable form instead of just dumping out the CDB in hex. Print out the name of the failed command (as defined by the ATA specification) in error handling output along with the raw register contents. When reporting status of ACPI taskfile commands executed on resume, also output the names of the commands being executed (or not) in readable form. Since the extra data for printing command names increases kernel size slightly, a config option has been added to allow disabling command name output (as well as some of the error register parsing) for those highly sensitive to kernel text size. Signed-off-by: Robert Hancock <hancockrwd@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-acpi.c')
-rw-r--r--drivers/ata/libata-acpi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index ac176da1f94e..01964b6e6f6b 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -689,6 +689,7 @@ static int ata_acpi_run_tf(struct ata_device *dev,
689 struct ata_taskfile tf, ptf, rtf; 689 struct ata_taskfile tf, ptf, rtf;
690 unsigned int err_mask; 690 unsigned int err_mask;
691 const char *level; 691 const char *level;
692 const char *descr;
692 char msg[60]; 693 char msg[60];
693 int rc; 694 int rc;
694 695
@@ -736,11 +737,13 @@ static int ata_acpi_run_tf(struct ata_device *dev,
736 snprintf(msg, sizeof(msg), "filtered out"); 737 snprintf(msg, sizeof(msg), "filtered out");
737 rc = 0; 738 rc = 0;
738 } 739 }
740 descr = ata_get_cmd_descript(tf.command);
739 741
740 ata_dev_printk(dev, level, 742 ata_dev_printk(dev, level,
741 "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x %s\n", 743 "ACPI cmd %02x/%02x:%02x:%02x:%02x:%02x:%02x (%s) %s\n",
742 tf.command, tf.feature, tf.nsect, tf.lbal, 744 tf.command, tf.feature, tf.nsect, tf.lbal,
743 tf.lbam, tf.lbah, tf.device, msg); 745 tf.lbam, tf.lbah, tf.device,
746 (descr ? descr : "unknown"), msg);
744 747
745 return rc; 748 return rc;
746} 749}