diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2023-05-11 03:13:52 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-05-22 17:05:20 -0400 |
commit | 18bd7718b5c489b3161b6c2ab4685d57c1e2da3b (patch) | |
tree | e610d9db43c4dd75e14f72d12ff5262fbef323df /block/bounce.c | |
parent | eafe804bda7ba01da562c43351068b8a76a579af (diff) |
scsi: ata: libata: Handle completion of CDL commands using policy 0xD
A CDL timeout for policy 0xF is defined as a NCQ error, just with a CDL
specific sk/asc/ascq in the sense data. Therefore, the existing code in
libata does not need to be modified to handle a policy 0xF CDL timeout.
For Command Duration Limits policy 0xD:
The device shall complete the command without error with the additional
sense code set to DATA CURRENTLY UNAVAILABLE.
Since a CDL timeout for policy 0xD is not an error, we cannot use the NCQ
Command Error log (10h).
Instead, we need to read the Sense Data for Successful NCQ Commands log
(0Fh).
In the success case, just like in the error case, we cannot simply read a
log page from the interrupt handler itself, since reading a log page
involves sending a READ LOG DMA EXT or READ LOG EXT command.
Therefore, we add a new EH action ATA_EH_GET_SUCCESS_SENSE. When a command
completes without error, and when the ATA_SENSE bit is set, this new action
is set as pending, and EH is scheduled.
This way, similar to the NCQ error case, the log page will be read from EH
context.
An alternative would have been to add a new kthread or workqueue to handle
this. However, extending EH can be done with minimal changes and avoids the
need to synchronize a new kthread/workqueue with EH.
Co-developed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20230511011356.227789-20-nks@flawful.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'block/bounce.c')
0 files changed, 0 insertions, 0 deletions