linux-stable/include
Damien Le Moal 37ee7bd247 scsi: core: ata: Do no try to probe for CDL on old drives
commit 2132df16f5 upstream.

Some old drives (e.g. an Ultra320 SCSI disk as reported by John) do not
seem to execute MAINTENANCE_IN / MI_REPORT_SUPPORTED_OPERATION_CODES
commands correctly and hang when a non-zero service action is specified
(one command format with service action case in scsi_report_opcode()).

Currently, CDL probing with scsi_cdl_check_cmd() is the only caller using a
non zero service action for scsi_report_opcode(). To avoid issues with
these old drives, do not attempt CDL probe if the device reports support
for an SPC version lower than 5 (CDL was introduced in SPC-5). To keep
things working with ATA devices which probe for the CDL T2A and T2B pages
introduced with SPC-6, modify ata_scsiop_inq_std() to claim SPC-6 version
compatibility for ATA drives supporting CDL.

SPC-6 standard version number is defined as Dh (= 13) in SPC-6 r09. Fix
scsi_probe_lun() to correctly capture this value by changing the bit mask
for the second byte of the INQUIRY response from 0x7 to 0xf.
include/scsi/scsi.h is modified to add the definition SCSI_SPC_6 with the
value 14 (Dh + 1). The missing definitions for the SCSI_SPC_4 and
SCSI_SPC_5 versions are also added.

Reported-by: John David Anglin <dave.anglin@bell.net>
Fixes: 624885209f ("scsi: core: Detect support for command duration limits")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20230915022034.678121-1-dlemoal@kernel.org
Tested-by: David Gow <david@davidgow.net>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-06 13:16:21 +02:00
..
acpi More ACPI updates for 6.5-rc1 2023-07-06 22:25:06 -07:00
asm-generic hyperv-fixes for 6.5-rc5 2023-08-04 17:16:14 -07:00
clocksource
crypto crypto: api - Use work queue in crypto_destroy_instance 2023-09-13 09:53:05 +02:00
drm drm/tests: helpers: Avoid a driver uaf 2023-09-23 11:14:38 +02:00
dt-bindings dt-bindings: clock: qcom,gcc-sc8280xp: Add missing GDSCs 2023-09-13 09:53:27 +02:00
keys
kunit
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2023-07-13 22:23:34 +00:00
linux bpf: Annotate bpf_long_memcpy with data_race 2023-10-06 13:16:07 +02:00
math-emu
media media: cec: core: add adap_unconfigured() callback 2023-09-13 09:53:40 +02:00
memory
misc
net netfilter: nf_tables: fix memleak when more than 255 elements expired 2023-10-06 13:15:47 +02:00
pcmcia
ras
rdma
rv
scsi scsi: core: ata: Do no try to probe for CDL on old drives 2023-10-06 13:16:21 +02:00
soc Memory controller drivers - fixes for v6.5 2023-07-27 15:40:54 +02:00
sound ALSA: ump: Don't create unused substreams for static blocks 2023-09-13 09:53:27 +02:00
target
trace tcp: add missing family to tcp_set_ca_state() tracepoint 2023-08-09 13:45:19 -07:00
uapi bpf: Clarify error expectations from bpf_clone_redirect 2023-10-06 13:16:14 +02:00
ufs scsi: ufs: Fix residual handling 2023-09-13 09:53:36 +02:00
vdso
video fbdev: kyro: Remove unused declarations 2023-08-15 23:39:33 +02:00
xen xen/evtchn: Introduce new IOCTL to bind static evtchn 2023-07-26 08:42:34 +02:00