diff options
-rw-r--r-- | drivers/ata/libata-scsi.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 1ff018525e3b..318b41358187 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -933,7 +933,11 @@ static void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, | |||
933 | * block specified for the ATA pass through commands. Regardless | 933 | * block specified for the ATA pass through commands. Regardless |
934 | * of whether the command errored or not, return a sense | 934 | * of whether the command errored or not, return a sense |
935 | * block. Copy all controller registers into the sense | 935 | * block. Copy all controller registers into the sense |
936 | * block. Clear sense key, ASC & ASCQ if there is no error. | 936 | * block. If there was no error, we get the request from an ATA |
937 | * passthrough command, so we use the following sense data: | ||
938 | * sk = RECOVERED ERROR | ||
939 | * asc,ascq = ATA PASS-THROUGH INFORMATION AVAILABLE | ||
940 | * | ||
937 | * | 941 | * |
938 | * LOCKING: | 942 | * LOCKING: |
939 | * None. | 943 | * None. |
@@ -959,6 +963,10 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) | |||
959 | ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature, | 963 | ata_to_sense_error(qc->ap->print_id, tf->command, tf->feature, |
960 | &sb[1], &sb[2], &sb[3], verbose); | 964 | &sb[1], &sb[2], &sb[3], verbose); |
961 | sb[1] &= 0x0f; | 965 | sb[1] &= 0x0f; |
966 | } else { | ||
967 | sb[1] = RECOVERED_ERROR; | ||
968 | sb[2] = 0; | ||
969 | sb[3] = 0x1D; | ||
962 | } | 970 | } |
963 | 971 | ||
964 | /* | 972 | /* |
@@ -1733,10 +1741,12 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1733 | 1741 | ||
1734 | /* For ATA pass thru (SAT) commands, generate a sense block if | 1742 | /* For ATA pass thru (SAT) commands, generate a sense block if |
1735 | * user mandated it or if there's an error. Note that if we | 1743 | * user mandated it or if there's an error. Note that if we |
1736 | * generate because the user forced us to, a check condition | 1744 | * generate because the user forced us to [CK_COND =1], a check |
1737 | * is generated and the ATA register values are returned | 1745 | * condition is generated and the ATA register values are returned |
1738 | * whether the command completed successfully or not. If there | 1746 | * whether the command completed successfully or not. If there |
1739 | * was no error, SK, ASC and ASCQ will all be zero. | 1747 | * was no error, we use the following sense data: |
1748 | * sk = RECOVERED ERROR | ||
1749 | * asc,ascq = ATA PASS-THROUGH INFORMATION AVAILABLE | ||
1740 | */ | 1750 | */ |
1741 | if (((cdb[0] == ATA_16) || (cdb[0] == ATA_12)) && | 1751 | if (((cdb[0] == ATA_16) || (cdb[0] == ATA_12)) && |
1742 | ((cdb[2] & 0x20) || need_sense)) { | 1752 | ((cdb[2] & 0x20) || need_sense)) { |