linux/drivers/scsi
Alexander Atanasov 066c5b46b6 scsi: core: Always send batch on reset or error handling command
In commit 8930a6c207 ("scsi: core: add support for request batching") the
block layer bd->last flag was mapped to SCMD_LAST and used as an indicator
to send the batch for the drivers that implement this feature. However, the
error handling code was not updated accordingly.

scsi_send_eh_cmnd() is used to send error handling commands and request
sense. The problem is that request sense comes as a single command that
gets into the batch queue and times out. As a result the device goes
offline after several failed resets. This was observed on virtio_scsi
during a device resize operation.

[  496.316946] sd 0:0:4:0: [sdd] tag#117 scsi_eh_0: requesting sense
[  506.786356] sd 0:0:4:0: [sdd] tag#117 scsi_send_eh_cmnd timeleft: 0
[  506.787981] sd 0:0:4:0: [sdd] tag#117 abort

To fix this always set SCMD_LAST flag in scsi_send_eh_cmnd() and
scsi_reset_ioctl().

Fixes: 8930a6c207 ("scsi: core: add support for request batching")
Cc: <stable@vger.kernel.org>
Signed-off-by: Alexander Atanasov <alexander.atanasov@virtuozzo.com>
Link: https://lore.kernel.org/r/20231215121008.2881653-1-alexander.atanasov@virtuozzo.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-12-18 21:09:41 -05:00
..
aacraid Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity" 2023-12-08 12:09:38 -05:00
aic7xxx scsi: aic79xx: Fix up NULL command in ahd_done() 2023-10-24 22:38:34 -04:00
aic94xx scsi: libsas: Delete sas_ata_task.retry_count 2023-08-21 17:50:59 -04:00
arcmsr
arm
be2iscsi scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() 2023-12-05 20:38:26 -05:00
bfa
bnx2fc scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() 2023-12-18 20:29:53 -05:00
bnx2i
csiostor
cxgbi scsi: cxgbi: Fix 'generated' typo 2023-10-13 14:15:54 -04:00
cxlflash
device_handler scsi: rdac: Fix sshdr use 2023-10-13 16:36:20 -04:00
elx scsi: target: Have drivers report if they support direct submissions 2023-10-13 15:53:57 -04:00
esas2r scsi: esas2r: Use FIELD_GET() to extract PCIe capability fields 2023-09-13 21:01:59 -04:00
fcoe
fnic SCSI misc on 20231102 2023-11-02 15:13:50 -10:00
hisi_sas As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
ibmvscsi Merge patch series "scsi: EH rework prep patches, part 1" 2023-10-13 14:25:20 -04:00
ibmvscsi_tgt scsi: target: Have drivers report if they support direct submissions 2023-10-13 15:53:57 -04:00
isci Merge patch series "libsas: Some tidy-up" 2023-08-24 21:06:16 -04:00
libfc scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() 2023-10-13 14:15:54 -04:00
libsas scsi: libsas: Declare sas_discover_end_dev() static 2023-09-13 21:06:44 -04:00
lpfc SCSI misc on 20231102 2023-11-02 15:13:50 -10:00
megaraid Merge patch series "megaraid_sas: Driver version update to 07.727.03.00-rc1" 2023-10-13 16:52:47 -04:00
mpi3mr scsi: mpi3mr: Split off bus_reset function from host_reset 2023-10-13 14:23:15 -04:00
mpt3sas SCSI misc on 20231102 2023-11-02 15:13:50 -10:00
mvsas scsi: libsas: Delete sas_ssp_task.task_prio 2023-08-21 17:50:58 -04:00
pcmcia
pm8001 scsi: pm8001: Remove PM8001_READ_VPD 2023-09-21 21:39:47 -04:00
qedf Merge patch series "scsi: EH rework prep patches, part 1" 2023-10-13 14:25:20 -04:00
qedi Merge branch '6.5/scsi-fixes' into 6.6/scsi-staging 2023-08-30 20:56:24 -04:00
qla2xxx Merge branch '6.7/scsi-staging' into 6.7/scsi-fixes 2023-11-14 11:40:40 -05:00
qla4xxx
smartpqi Merge patch series "smartpqi updates" 2023-08-24 22:58:36 -04:00
snic scsi: snic: Remove useless code in snic_dr_clean_pending_req() 2023-10-24 22:33:02 -04:00
sym53c8xx_2 scsi: sym53c8xx_2: Rework reset handling 2023-10-13 14:23:15 -04:00
.gitignore
3w-9xxx.c
3w-9xxx.h
3w-sas.c
3w-sas.h
3w-xxxx.c
3w-xxxx.h
53c700_d.h_shipped
53c700.c
53c700.h
53c700.scr
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c
aha1740.h
am53c974.c
atari_scsi.c
atp870u.c
atp870u.h
BusLogic.c
BusLogic.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c
dc395x.h
dmx3191d.c
esp_scsi.c
esp_scsi.h
fdomain_isa.c
fdomain_pci.c
fdomain.c
fdomain.h
FlashPoint.c
g_NCR5380.c
gvp11.c
gvp11.h
hosts.c
hpsa_cmd.h
hpsa.c
hpsa.h
hptiop.c
hptiop.h
imm.c scsi: imm: Add a module parameter for the transfer mode 2023-09-13 21:11:55 -04:00
imm.h scsi: imm: Add a module parameter for the transfer mode 2023-09-13 21:11:55 -04:00
initio.c
initio.h
ipr.c scsi: ipr: Do PCI error checks on own line 2023-10-10 16:40:19 -05:00
ipr.h
ips.c scsi: ips: Do not try to abort command from host reset 2023-10-13 14:23:15 -04:00
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c scsi: iscsi_tcp: restrict to TCP sockets 2023-09-17 17:46:13 +01:00
iscsi_tcp.h
jazz_esp.c
Kconfig scsi: imm: Add a module parameter for the transfer mode 2023-09-13 21:11:55 -04:00
lasi700.c
libiscsi_tcp.c
libiscsi.c
mac_esp.c
mac_scsi.c
mac53c94.c
mac53c94.h
Makefile
megaraid.c scsi: megaraid: Fix up debug message in megaraid_abort_and_reset() 2023-10-24 22:40:39 -04:00
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c scsi: core: Improve type safety of scsi_rescan_device() 2023-08-24 22:11:29 -04:00
mvumi.h
myrb.c
myrb.h
myrs.c
myrs.h
ncr53c8xx.c
ncr53c8xx.h
NCR5380.c
NCR5380.h
nsp32_debug.c
nsp32_io.h
nsp32.c
nsp32.h
pmcraid.c scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler() 2023-10-24 22:24:32 -04:00
pmcraid.h
ppa.c scsi: ppa: Fix accidentally reversed conditions for 16-bit and 32-bit EPP 2023-09-05 05:26:49 -04:00
ppa.h
ps3rom.c
qla1280.c scsi: qla1280: Separate out host reset function from qla1280_error_action() 2023-10-13 14:23:15 -04:00
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c
qlogicpti.h
raid_class.c scsi: core: raid_class: Remove raid_component_add() 2023-08-24 21:34:28 -04:00
script_asm.pl
scsi_bsg.c
scsi_common.c
scsi_debug.c scsi: scsi_debug: Delete some bogus error checking 2023-11-08 21:42:26 -05:00
scsi_debugfs.c scsi: core: Report error list information in debugfs 2023-08-24 22:13:03 -04:00
scsi_debugfs.h
scsi_devinfo.c
scsi_dh.c
scsi_error.c scsi: core: Always send batch on reset or error handling command 2023-12-18 21:09:41 -05:00
scsi_ioctl.c
scsi_lib_dma.c
scsi_lib.c scsi: core: Clean up scsi_dev_queue_ready() 2023-10-24 22:31:04 -04:00
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h scsi: core: Improve type safety of scsi_rescan_device() 2023-08-24 22:11:29 -04:00
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c scsi: Do not rescan devices with a suspended queue 2023-10-10 14:42:22 +09:00
scsi_sysctl.c scsi: Remove now superfluous sentinel element from ctl_table array 2023-10-11 12:16:13 -07:00
scsi_sysfs.c scsi: core: Improve type safety of scsi_rescan_device() 2023-08-24 22:11:29 -04:00
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_iscsi.c
scsi_transport_sas.c
scsi_transport_spi.c scsi: spi: Fix sshdr use 2023-10-13 16:36:20 -04:00
scsi_transport_srp.c
scsi.c SCSI misc on 20231102 2023-11-02 15:13:50 -10:00
scsicam.c
sd_dif.c
sd_trace.h
sd_zbc.c
sd.c scsi: sd: Fix system start for ATA devices 2023-11-24 20:44:21 -05:00
sd.h scsi: sd: Do not issue commands to suspended disks on shutdown 2023-09-28 21:23:18 +09:00
sense_codes.h
ses.c
sg.c scsi: Remove now superfluous sentinel element from ctl_table array 2023-10-11 12:16:13 -07:00
sgiwd93.c
sim710.c
sni_53c710.c
sr_ioctl.c
sr_vendor.c
sr.c scsi: sr: Fix sshdr use in sr_get_events 2023-10-13 16:36:20 -04:00
sr.h
st_options.h
st.c scsi: st: Add third party poweron reset handling 2023-08-24 22:16:28 -04:00
st.h
stex.c
storvsc_drv.c Merge branch '6.5/scsi-fixes' into 6.6/scsi-staging 2023-08-30 20:56:24 -04:00
sun_esp.c
sun3_scsi_vme.c
sun3_scsi.c
sun3x_esp.c
virtio_scsi.c scsi: core: Improve type safety of scsi_rescan_device() 2023-08-24 22:11:29 -04:00
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c
wd719x.h
xen-scsifront.c scsi: xen-scsifront: shost_priv() can never return NULL 2023-08-24 22:06:44 -04:00
zalon.c
zorro_esp.c
zorro7xx.c