aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-scsi.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index dd310b27b24c..006f1bf9d78b 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -849,25 +849,24 @@ static void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk,
849 /* Bad address mark */ 849 /* Bad address mark */
850 {0x01, MEDIUM_ERROR, 0x13, 0x00}, // Address mark not found Address mark not found for data field 850 {0x01, MEDIUM_ERROR, 0x13, 0x00}, // Address mark not found Address mark not found for data field
851 /* TRK0 */ 851 /* TRK0 */
852 {0x02, HARDWARE_ERROR, 0x00, 0x00}, // Track 0 not found Hardware error 852 {0x02, HARDWARE_ERROR, 0x00, 0x00}, // Track 0 not found Hardware error
853 /* Abort & !ICRC */ 853 /* Abort: 0x04 is not translated here, see below */
854 {0x04, ABORTED_COMMAND, 0x00, 0x00}, // Aborted command Aborted command
855 /* Media change request */ 854 /* Media change request */
856 {0x08, NOT_READY, 0x04, 0x00}, // Media change request FIXME: faking offline 855 {0x08, NOT_READY, 0x04, 0x00}, // Media change request FIXME: faking offline
857 /* SRV */ 856 /* SRV/IDNF */
858 {0x10, ABORTED_COMMAND, 0x14, 0x00}, // ID not found Recorded entity not found 857 {0x10, ILLEGAL_REQUEST, 0x21, 0x00}, // ID not found Logical address out of range
859 /* Media change */ 858 /* MC */
860 {0x08, NOT_READY, 0x04, 0x00}, // Media change FIXME: faking offline 859 {0x20, UNIT_ATTENTION, 0x28, 0x00}, // Media Changed Not ready to ready change, medium may have changed
861 /* ECC */ 860 /* ECC */
862 {0x40, MEDIUM_ERROR, 0x11, 0x04}, // Uncorrectable ECC error Unrecovered read error 861 {0x40, MEDIUM_ERROR, 0x11, 0x04}, // Uncorrectable ECC error Unrecovered read error
863 /* BBD - block marked bad */ 862 /* BBD - block marked bad */
864 {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error 863 {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error
865 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark 864 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
866 }; 865 };
867 static const unsigned char stat_table[][4] = { 866 static const unsigned char stat_table[][4] = {
868 /* Must be first because BUSY means no other bits valid */ 867 /* Must be first because BUSY means no other bits valid */
869 {0x80, ABORTED_COMMAND, 0x47, 0x00}, // Busy, fake parity for now 868 {0x80, ABORTED_COMMAND, 0x47, 0x00}, // Busy, fake parity for now
870 {0x20, HARDWARE_ERROR, 0x00, 0x00}, // Device fault 869 {0x20, HARDWARE_ERROR, 0x44, 0x00}, // Device fault, internal target failure
871 {0x08, ABORTED_COMMAND, 0x47, 0x00}, // Timed out in xfer, fake parity for now 870 {0x08, ABORTED_COMMAND, 0x47, 0x00}, // Timed out in xfer, fake parity for now
872 {0x04, RECOVERED_ERROR, 0x11, 0x00}, // Recovered ECC error Medium error, recovered 871 {0x04, RECOVERED_ERROR, 0x11, 0x00}, // Recovered ECC error Medium error, recovered
873 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark 872 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
@@ -892,13 +891,13 @@ static void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk,
892 goto translate_done; 891 goto translate_done;
893 } 892 }
894 } 893 }
895 /* No immediate match */
896 if (verbose)
897 printk(KERN_WARNING "ata%u: no sense translation for "
898 "error 0x%02x\n", id, drv_err);
899 } 894 }
900 895
901 /* Fall back to interpreting status bits */ 896 /*
897 * Fall back to interpreting status bits. Note that if the drv_err
898 * has only the ABRT bit set, we decode drv_stat. ABRT by itself
899 * is not descriptive enough.
900 */
902 for (i = 0; stat_table[i][0] != 0xFF; i++) { 901 for (i = 0; stat_table[i][0] != 0xFF; i++) {
903 if (stat_table[i][0] & drv_stat) { 902 if (stat_table[i][0] & drv_stat) {
904 *sk = stat_table[i][1]; 903 *sk = stat_table[i][1];
@@ -907,13 +906,11 @@ static void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk,
907 goto translate_done; 906 goto translate_done;
908 } 907 }
909 } 908 }
910 /* No error? Undecoded? */
911 if (verbose)
912 printk(KERN_WARNING "ata%u: no sense translation for "
913 "status: 0x%02x\n", id, drv_stat);
914 909
915 /* We need a sensible error return here, which is tricky, and one 910 /*
916 that won't cause people to do things like return a disk wrongly */ 911 * We need a sensible error return here, which is tricky, and one
912 * that won't cause people to do things like return a disk wrongly.
913 */
917 *sk = ABORTED_COMMAND; 914 *sk = ABORTED_COMMAND;
918 *asc = 0x00; 915 *asc = 0x00;
919 *ascq = 0x00; 916 *ascq = 0x00;