On 6/25/24 07:12, Igor Pylypiv wrote:
Current ata_gen_passthru_sense() code performs two actions:
- Generates sense data based on the ATA 'status' and ATA 'error' fields.
- Populates "ATA Status Return sense data descriptor" / "Fixed format sense data" with ATA taskfile fields.
The problem is that #1 generates sense data even when a valid sense data is already present (ATA_QCFLAG_SENSE_VALID is set). Factoring out #2 into a separate function allows us to generate sense data only when there is no valid sense data (ATA_QCFLAG_SENSE_VALID is not set).
As a bonus, we can now delete a FIXME comment in atapi_qc_complete() which states that we don't want to translate taskfile registers into sense descriptors for ATAPI.
Cc: stable@vger.kernel.org Signed-off-by: Igor Pylypiv ipylypiv@google.com
Reviewed-by: Damien Le Moal dlemoal@kernel.org