linux/include
Niklas Cassel 18bd7718b5 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>
2023-05-22 17:05:20 -04:00
..
acpi Power management updates for 6.4-rc1 2023-04-25 18:44:10 -07:00
asm-generic Locking changes in v6.4: 2023-05-05 12:56:55 -07:00
clocksource
crypto This update includes the following changes: 2023-04-26 08:32:52 -07:00
drm - Nick Piggin's "shoot lazy tlbs" series, to improve the peformance of 2023-04-27 19:42:02 -07:00
dt-bindings - mailbox api: allow direct registration to a channel 2023-05-07 10:17:33 -07:00
keys
kunit
kvm s390: 2023-05-01 12:06:20 -07:00
linux scsi: ata: libata: Handle completion of CDL commands using policy 0xD 2023-05-22 17:05:20 -04:00
math-emu
media media: i2c: Drop unused sr030pc30 camera sensor driver 2023-04-15 09:56:49 +01:00
memory
misc
net Including fixes from netfilter. 2023-05-05 19:12:01 -07:00
pcmcia
ras
rdma RDMA: Add ib_virt_dma_to_page() 2023-04-16 11:08:07 +03:00
rv
scsi scsi: core: Allow enabling and disabling command duration limits 2023-05-22 17:05:19 -04:00
soc Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
sound ASoC: Updates for v6.4 2023-04-24 15:15:31 +02:00
target
trace NFSD 6.4 Release Notes 2023-04-29 11:04:14 -07:00
uapi scsi: block: Introduce ioprio hints 2023-05-22 17:05:18 -04:00
ufs SCSI misc on 20230426 2023-04-26 15:39:25 -07:00
vdso
video
xen