linux-stable/drivers/scsi
Uma Krishnan a3feb6ef50 scsi: cxlflash: Synchronize reset and remove ops
The following Oops can be encountered if a device removal or system shutdown
is initiated while an EEH recovery is in process:

[c000000ff2f479c0] c008000015256f18 cxlflash_pci_slot_reset+0xa0/0x100
                                      [cxlflash]
[c000000ff2f47a30] c00800000dae22e0 cxl_pci_slot_reset+0x168/0x290 [cxl]
[c000000ff2f47ae0] c00000000003ef1c eeh_report_reset+0xec/0x170
[c000000ff2f47b20] c00000000003d0b8 eeh_pe_dev_traverse+0x98/0x170
[c000000ff2f47bb0] c00000000003f80c eeh_handle_normal_event+0x56c/0x580
[c000000ff2f47c60] c00000000003fba4 eeh_handle_event+0x2a4/0x338
[c000000ff2f47d10] c0000000000400b8 eeh_event_handler+0x1f8/0x200
[c000000ff2f47dc0] c00000000013da48 kthread+0x1a8/0x1b0
[c000000ff2f47e30] c00000000000b528 ret_from_kernel_thread+0x5c/0xb4

The remove handler frees AFU memory while the EEH recovery is in progress,
leading to a race condition. This can result in a crash if the recovery thread
tries to access this memory.

To resolve this issue, the cxlflash remove handler will evaluate the device
state and yield to any active reset or probing threads.

Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-04-18 19:32:50 -04:00
..
aacraid scsi: aacraid: Insure command thread is not recursively stopped 2018-04-09 21:08:30 -04:00
aic7xxx
aic94xx
arcmsr
arm
be2iscsi
bfa
bnx2fc
bnx2i
csiostor
cxgbi scsi: cxgb4i: silence overflow warning in t4_uld_rx_handler() 2018-04-09 21:32:45 -04:00
cxlflash scsi: cxlflash: Synchronize reset and remove ops 2018-04-18 19:32:50 -04:00
device_handler
dpt
esas2r
fcoe
fnic
hisi_sas
ibmvscsi
ibmvscsi_tgt
isci
libfc
libsas
lpfc
megaraid
mpt3sas
mvsas
osd
pcmcia
pm8001
qedf
qedi
qla2xxx scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION 2018-04-09 21:04:36 -04:00
qla4xxx
smartpqi
snic
sym53c8xx_2
ufs
.gitignore
3w-9xxx.c
3w-9xxx.h
3w-sas.c
3w-sas.h
3w-xxxx.c
3w-xxxx.h
53c700.c
53c700.h
53c700.scr
53c700_d.h_shipped
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
dpt_i2o.c scsi: dpt_i2o: Use after free in I2ORESETCMD ioctl 2018-04-09 21:31:37 -04:00
dpti.h
esp_scsi.c
esp_scsi.h
FlashPoint.c
g_NCR5380.c
gdth.c
gdth.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c
gvp11.h
hosts.c
hpsa.c
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c
imm.h
initio.c
initio.h
ipr.c
ipr.h
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c
iscsi_tcp.h
jazz_esp.c
Kconfig
lasi700.c
libiscsi.c
libiscsi_tcp.c
mac53c94.c
mac53c94.h
mac_esp.c
mac_scsi.c
Makefile
megaraid.c
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
ncr53c8xx.c
ncr53c8xx.h
NCR5380.c
NCR5380.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c
osst.h
osst_detect.h
osst_options.h
pmcraid.c
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c
scsi.h
scsi_common.c
scsi_debug.c
scsi_debugfs.c
scsi_debugfs.h
scsi_devinfo.c scsi: devinfo: Add Microsoft iSCSI target to 1024 sector blacklist 2018-04-09 22:07:05 -04:00
scsi_dh.c scsi: scsi_dh: Don't look for NULL devices handlers by name 2018-04-09 16:35:12 -04:00
scsi_error.c
scsi_ioctl.c
scsi_lib.c scsi: core: Make scsi_result_to_blk_status() recognize CONDITION MET 2018-04-09 21:31:37 -04:00
scsi_lib_dma.c
scsi_logging.c
scsi_logging.h
scsi_netlink.c
scsi_pm.c
scsi_priv.h
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c
scsi_sysctl.c
scsi_sysfs.c
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_iscsi.c
scsi_transport_sas.c
scsi_transport_spi.c
scsi_transport_srp.c
scsi_typedefs.h
scsicam.c
sd.c
sd.h
sd_dif.c
sd_zbc.c
sense_codes.h
ses.c
sg.c
sgiwd93.c
sim710.c
sni_53c710.c
sr.c sr: get/drop reference to device in revalidate and check_events 2018-04-11 11:26:09 -06:00
sr.h
sr_ioctl.c
sr_vendor.c
st.c
st.h
st_options.h
stex.c
storvsc_drv.c
sun3_scsi.c
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
virtio_scsi.c
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd719x.c
wd719x.h
xen-scsifront.c
zalon.c
zorro7xx.c