]> asedeno.scripts.mit.edu Git - linux.git/commit
scsi: cxlflash: Fix to avoid EEH and host reset collisions
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Fri, 2 Sep 2016 20:39:30 +0000 (15:39 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 14 Sep 2016 16:45:06 +0000 (12:45 -0400)
commit1d3324c382b1a617eb567e3650dcb51f22dfec9a
tree9a7fb64a89a7cbdd5e3f6c74df0d8be1af9cb10f
parentbabf985d1e1b0677cb264acd01319d2b9c8f4327
scsi: cxlflash: Fix to avoid EEH and host reset collisions

The EEH reset handler is ignorant to the current state of the driver
when processing a frozen event and initiating a device reset. This can
be an issue if an EEH event occurs while a user or stack initiated reset
is executing. More specifically, if an EEH occurs while the SCSI host
reset handler is active, the reset initiated by the EEH thread will
likely collide with the host reset thread. This can leave the device in
an inconsistent state, or worse, cause a system crash.

As a remedy, the EEH handler is updated to evaluate the device state and
take appropriate action (proceed, wait, or disconnect host). The host
reset handler is also updated to handle situations where an EEH occurred
during a host reset. In such situations, the host reset handler will
delay reporting back a success to give the EEH reset an opportunity to
complete.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Acked-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/main.c