[PATCH] lpfc_scsi: use msleep() instead of schedule_timeout() From: Nishanth Aravamudan Replace schedule_timeout() with msleep() to guarantee the task delays as expected. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan Signed-off-by: Alexey Dobriyan Index: linux-kj/drivers/scsi/lpfc/lpfc_scsi.c =================================================================== --- linux-kj.orig/drivers/scsi/lpfc/lpfc_scsi.c 2005-09-21 01:35:54.000000000 +0400 +++ linux-kj/drivers/scsi/lpfc/lpfc_scsi.c 2005-09-21 01:41:10.000000000 +0400 @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -891,8 +892,7 @@ __lpfc_abort_handler(struct scsi_cmnd *c while (cmnd->host_scribble) { spin_unlock_irq(phba->host->host_lock); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(LPFC_ABORT_WAIT*HZ); + msleep(LPFC_ABORT_WAIT * 1000); spin_lock_irq(phba->host->host_lock); if (++loop_count > (2 * phba->cfg_nodev_tmo)/LPFC_ABORT_WAIT) @@ -958,8 +958,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn if (pnode->nlp_state != NLP_STE_MAPPED_NODE) { spin_unlock_irq(phba->host->host_lock); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout( HZ/2); + msleep(500); spin_lock_irq(phba->host->host_lock); } if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE)) @@ -1017,8 +1016,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn cmnd->device->id, cmnd->device->lun, LPFC_CTX_LUN))) { spin_unlock_irq(phba->host->host_lock); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(LPFC_RESET_WAIT*HZ); + msleep(LPFC_RESET_WAIT * 1000); spin_lock_irq(phba->host->host_lock); if (++loopcnt @@ -1116,8 +1114,7 @@ __lpfc_reset_bus_handler(struct scsi_cmn &phba->sli.ring[phba->sli.fcp_ring], 0, 0, LPFC_CTX_HOST))) { spin_unlock_irq(phba->host->host_lock); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(LPFC_RESET_WAIT*HZ); + msleep(LPFC_RESET_WAIT * 1000); spin_lock_irq(phba->host->host_lock); if (++loopcnt