diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2023-09-13 17:04:43 +0200 |
---|---|---|
committer | Damien Le Moal <dlemoal@kernel.org> | 2023-09-16 21:12:19 +0900 |
commit | 5e35a9ac3fe3a0d571b899a16ca84253e53dc70c (patch) | |
tree | c7d2ac48a6950b5621a077f8e60e1fb5620fa5df /include/linux | |
parent | 7a3bc2b3989e05bbaa904a63279049a401491c84 (diff) | |
download | linux-stable-5e35a9ac3fe3a0d571b899a16ca84253e53dc70c.tar.gz linux-stable-5e35a9ac3fe3a0d571b899a16ca84253e53dc70c.tar.bz2 linux-stable-5e35a9ac3fe3a0d571b899a16ca84253e53dc70c.zip |
ata: libata-core: fetch sense data for successful commands iff CDL enabled
Currently, we fetch sense data for a _successful_ command if either:
1) Command was NCQ and ATA_DFLAG_CDL_ENABLED flag set (flag
ATA_DFLAG_CDL_ENABLED will only be set if the Successful NCQ command
sense data supported bit is set); or
2) Command was non-NCQ and regular sense data reporting is enabled.
This means that case 2) will trigger for a non-NCQ command which has
ATA_SENSE bit set, regardless if CDL is enabled or not.
This decision was by design. If the device reports that it has sense data
available, it makes sense to fetch that sense data, since the sk/asc/ascq
could be important information regardless if CDL is enabled or not.
However, the fetching of sense data for a successful command is done via
ATA EH. Considering how intricate the ATA EH is, we really do not want to
invoke ATA EH unless absolutely needed.
Before commit 18bd7718b5c4 ("scsi: ata: libata: Handle completion of CDL
commands using policy 0xD") we never fetched sense data for successful
commands.
In order to not invoke the ATA EH unless absolutely necessary, even if the
device claims support for sense data reporting, only fetch sense data for
successful (NCQ and non-NCQ commands) commands that are using CDL.
[Damien] Modified the check to test the qc flag ATA_QCFLAG_HAS_CDL
instead of the device support for CDL, which is implied for commands
using CDL.
Fixes: 3ac873c76d79 ("ata: libata-core: fix when to fetch sense data for successful commands")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions