libata: add human-readable error value decoding v3
PATCH 1/1 libata: add human-readable error value decoding v3
This adds human-readable decoding of the ATA status and error registers (similar to what drivers/ide does) as well as the SATA Serror register to libata error handling output. This prevents the need to pore through standards documents to figure out the meaning of the bits in these registers when looking at error reports. Some bits that drivers/ide decoded are not decoded here, since the bits are either command-dependent or obsolete, and properly parsing them would add too much complexity.
---
Rebased to apply to 2.6.23-rc1-mm2.
include/linux/ata.h +9 -0
@@ -274,6 +274,15 @@ enum {SERR_PROTOCOL = (1 <<10 ),/* protocol violation */ SERR_INTERNAL = (1 <<11 ),/* host internal error */ SERR_PHYRDY_CHG = (1 <<16 ),/* PHY RDY changed */ +SERR_PHY_INT_ERR = (1 <<17 ),/* PHY internal error */ +SERR_COMM_WAKE = (1 <<18 ),/* Comm wake */ +SERR_10B_8B_ERR = (1 <<19 ),/* 10b to 8b decode error */ +SERR_DISPARITY = (1 <<20 ),/* Disparity */ +SERR_CRC = (1 <<21 ),/* CRC error */ +SERR_HANDSHAKE = (1 <<22 ),/* Handshake error */ +SERR_LINK_SEQ_ERR = (1 <<23 ),/* Link sequence error */ +SERR_TRANS_ST_ERROR = (1 <<24 ),/* Transport state trans. error */ +SERR_UNRECOG_FIS = (1 <<25 ),/* Unrecognized FIS */ SERR_DEV_XCHG = (1 <<26 ),/* device exchanged */ /* struct ata_taskfile flags */
drivers/ata/libata-eh.c +45 -0
57 lines not on this page · raw message
Quoted 7 lines · On Fri, 03 Aug 2007 12:00:57 -0600 Robert Hancock <[email protected]> wrote:
This adds human-readable decoding of the ATA status and error registers (similar to what
drivers/idedoes) as well as the SATA Serror register to libata error handling output. This prevents the need to pore through standards documents to figure out the meaning of the bits in these registers when looking at error reports. Some bits thatdrivers/idedecoded are not decoded here, since the bits are either command-dependent or obsolete, and properly parsing them would add too much complexity.
Not sure its really worth it. Does "ABRT IDNF" actually tell you any more than the hex code ? In fact I find the hex code clearer because its usually the combination of state (0x51) etc that tells the story.
No objection to it going in and on a correctness basis
Quoted 8 lines · Robert Hancock
This adds human-readable decoding of the ATA status and error registers (similar to what
drivers/idedoes) as well as the SATA Serror register to libata error handling output. This prevents the need to pore through standards documents to figure out the meaning of the bits in these registers when looking at error reports. Some bits thatdrivers/idedecoded are not decoded here, since the bits are either command-dependent or obsolete, and properly parsing them would add too much complexity.
This is really nice.
Maybe make it configurable, though?
Quoted 8 lines · Robert Hancock
This adds human-readable decoding of the ATA status and error registers (similar to what
drivers/idedoes) as well as the SATA Serror register to libata error handling output. This prevents the need to pore through standards documents to figure out the meaning of the bits in these registers when looking at error reports. Some bits thatdrivers/idedecoded are not decoded here, since the bits are either command-dependent or obsolete, and properly parsing them would add too much complexity.
Quoted 5 lines
Signed-off-by Robert Hancock <[email protected]>---
Rebased to apply to 2.6.23-rc1-mm2.
I'm applying this manually.... sorry it took so long, the asymmetry of "{DRDY }" bugged me, so I did a few cleanups.