aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-06-22 02:25:42 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:47 -0400
commitb9d5c6b7ef570bea0d22746944d7b58fa7f17b13 (patch)
tree30976ba8c1e87478747fef775be6ab73f57a0a38 /drivers/scsi/scsi_error.c
parent36fed4980529b3d4090fcb677ad46b27e270be40 (diff)
[SCSI] cleanup setting task state in scsi_error_handler()
A quick reading of scsi_error_handler() one could come away with the impression that it does its wakeup event check while the task state is TASK_RUNNING. In fact it sets TASK_INTERRUPTIBLE at the bottom of the loop, but that is ~50 lines down. Just set TASK_INTERRUPTIBLE at the top of loop and be done. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 804f63270e37..4a6381c87253 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1818,15 +1818,14 @@ int scsi_error_handler(void *data)
1818 * We never actually get interrupted because kthread_run 1818 * We never actually get interrupted because kthread_run
1819 * disables signal delivery for the created thread. 1819 * disables signal delivery for the created thread.
1820 */ 1820 */
1821 set_current_state(TASK_INTERRUPTIBLE);
1822 while (!kthread_should_stop()) { 1821 while (!kthread_should_stop()) {
1822 set_current_state(TASK_INTERRUPTIBLE);
1823 if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) || 1823 if ((shost->host_failed == 0 && shost->host_eh_scheduled == 0) ||
1824 shost->host_failed != shost->host_busy) { 1824 shost->host_failed != shost->host_busy) {
1825 SCSI_LOG_ERROR_RECOVERY(1, 1825 SCSI_LOG_ERROR_RECOVERY(1,
1826 printk("Error handler scsi_eh_%d sleeping\n", 1826 printk("Error handler scsi_eh_%d sleeping\n",
1827 shost->host_no)); 1827 shost->host_no));
1828 schedule(); 1828 schedule();
1829 set_current_state(TASK_INTERRUPTIBLE);
1830 continue; 1829 continue;
1831 } 1830 }
1832 1831
@@ -1863,7 +1862,6 @@ int scsi_error_handler(void *data)
1863 scsi_restart_operations(shost); 1862 scsi_restart_operations(shost);
1864 if (!shost->eh_noresume) 1863 if (!shost->eh_noresume)
1865 scsi_autopm_put_host(shost); 1864 scsi_autopm_put_host(shost);
1866 set_current_state(TASK_INTERRUPTIBLE);
1867 } 1865 }
1868 __set_current_state(TASK_RUNNING); 1866 __set_current_state(TASK_RUNNING);
1869 1867