aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 1c7d993fa8ad..6a7a60fc0a4e 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -58,6 +58,28 @@ void scsi_eh_wakeup(struct Scsi_Host *shost)
58} 58}
59 59
60/** 60/**
61 * scsi_schedule_eh - schedule EH for SCSI host
62 * @shost: SCSI host to invoke error handling on.
63 *
64 * Schedule SCSI EH without scmd.
65 **/
66void scsi_schedule_eh(struct Scsi_Host *shost)
67{
68 unsigned long flags;
69
70 spin_lock_irqsave(shost->host_lock, flags);
71
72 if (scsi_host_set_state(shost, SHOST_RECOVERY) == 0 ||
73 scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY) == 0) {
74 shost->host_eh_scheduled++;
75 scsi_eh_wakeup(shost);
76 }
77
78 spin_unlock_irqrestore(shost->host_lock, flags);
79}
80EXPORT_SYMBOL_GPL(scsi_schedule_eh);
81
82/**
61 * scsi_eh_scmd_add - add scsi cmd to error handling. 83 * scsi_eh_scmd_add - add scsi cmd to error handling.
62 * @scmd: scmd to run eh on. 84 * @scmd: scmd to run eh on.
63 * @eh_flag: optional SCSI_EH flag. 85 * @eh_flag: optional SCSI_EH flag.
@@ -1515,7 +1537,7 @@ int scsi_error_handler(void *data)
1515 */ 1537 */
1516 set_current_state(TASK_INTERRUPTIBLE); 1538 set_current_state(TASK_INTERRUPTIBLE);
1517 while (!kthread_should_stop()) { 1539 while (!kthread_should_stop()) {
1518 if (shost->host_failed == 0 || 1540 if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) ||
1519 shost->host_failed != shost->host_busy) { 1541 shost->host_failed != shost->host_busy) {
1520 SCSI_LOG_ERROR_RECOVERY(1, 1542 SCSI_LOG_ERROR_RECOVERY(1,
1521 printk("Error handler scsi_eh_%d sleeping\n", 1543 printk("Error handler scsi_eh_%d sleeping\n",