Dan Williams 57fc2e335f [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.  Since i/o that is released by scsi_restart_operations has been
blocked for at least one eh cycle, this implementation allows those
i/o's to run before another eh cycle starts to discourage hung task
timeouts.

Cc: <stable@vger.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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-07-20 08:58:46 +01:00
..
2012-05-26 12:22:27 -07:00
2012-05-24 16:22:53 -04:00
2012-07-17 21:30:31 -07:00
2012-05-26 12:42:29 -07:00
2012-05-23 14:07:06 -07:00
2012-07-16 09:20:33 -07:00
2012-05-22 16:02:13 -07:00
2012-07-04 15:55:19 +08:00
2012-07-13 09:56:26 -07:00
2012-07-11 12:44:25 -07:00
2012-05-22 16:02:13 -07:00
2012-05-16 12:46:37 -04:00
2012-07-10 19:16:25 +10:00
2012-07-13 09:54:26 -07:00
2012-07-11 16:17:14 -07:00
2012-05-26 12:42:29 -07:00
2012-06-15 17:17:15 -07:00
2012-05-22 16:34:21 -07:00
2012-05-26 12:22:27 -07:00