]> git.karo-electronics.de Git - karo-tx-linux.git/commit
scsi: fix eh wakeup (scsi_schedule_eh vs scsi_restart_operations)
authorDan Williams <dan.j.williams@intel.com>
Fri, 6 Apr 2012 23:35:36 +0000 (16:35 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 11 Apr 2012 02:15:23 +0000 (19:15 -0700)
commitfcc1ce20ffbc553b25b6c635f4bb838940f58d2d
treedf2007f4517226ffceeeec1eebac3d4ffe53ceb5
parentfcf62bdd26101fe6ae8760c5e9eb4d5e49e0a5ec
scsi: fix eh wakeup (scsi_schedule_eh vs scsi_restart_operations)

Rapid ata hotplug on a libsas controller results in cases where libsas
is waiting indefinitely on eh to perform an ata probe.

A race exists between scsi_schedule_eh() and scsi_restart_operations()
in the case when scsi_restart_operations() issues i/o to other devices
in the sas domain.  When this happens the host state transitions from
SHOST_RECOVERY (set by scsi_schedule_eh) back to SHOST_RUNNING and
->host_busy is non-zero so we put the eh thread to sleep even though
->host_eh_scheduled is active.

Before putting the error handler to sleep we need to check if the
host_state needs to return to SHOST_RECOVERY for another trip through
eh.

Cc: Tejun Heo <tj@kernel.org>
Reported-by: Tom Jackson <thomas.p.jackson@intel.com>
Tested-by: Tom Jackson <thomas.p.jackson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/scsi_error.c