Skip to content

Commit 28ab976

Browse files
ipylypivfloatious
authored andcommitted
ata: libata-scsi: Honor the D_SENSE bit for CK_COND=1 and no error
SAT-5 revision 8 specification removed the text about the ANSI INCITS 431-2007 compliance which was requiring SCSI/ATA Translation (SAT) to return descriptor format sense data for the ATA PASS-THROUGH commands regardless of the setting of the D_SENSE bit. Let's honor the D_SENSE bit for ATA PASS-THROUGH commands while generating the "ATA PASS-THROUGH INFORMATION AVAILABLE" sense data. SAT-5 revision 7 ================ 12.2.2.8 Fixed format sense data Table 212 shows the fields returned in the fixed format sense data (see SPC-5) for ATA PASS-THROUGH commands. SATLs compliant with ANSI INCITS 431-2007, SCSI/ATA Translation (SAT) return descriptor format sense data for the ATA PASS-THROUGH commands regardless of the setting of the D_SENSE bit. SAT-5 revision 8 ================ 12.2.2.8 Fixed format sense data Table 211 shows the fields returned in the fixed format sense data (see SPC-5) for ATA PASS-THROUGH commands. Cc: [email protected] # 4.19+ Reported-by: Niklas Cassel <[email protected]> Closes: https://lore.kernel.org/linux-ide/[email protected] Reviewed-by: Niklas Cassel <[email protected]> Signed-off-by: Igor Pylypiv <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
1 parent 9798192 commit 28ab976

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/ata/libata-scsi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,8 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
941941
&sense_key, &asc, &ascq);
942942
ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
943943
} else {
944-
/*
945-
* ATA PASS-THROUGH INFORMATION AVAILABLE
946-
* Always in descriptor format sense.
947-
*/
948-
scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
944+
/* ATA PASS-THROUGH INFORMATION AVAILABLE */
945+
ata_scsi_set_sense(qc->dev, cmd, RECOVERED_ERROR, 0, 0x1D);
949946
}
950947
}
951948

0 commit comments

Comments
 (0)