[PATCH] lpfc_scsi: use ssleep() instead of schedule_timeout() From: Nishanth Aravamudan Replace schedule_timeout() with ssleep() 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-12-05 13:19:48.000000000 +0300 +++ linux-kj/drivers/scsi/lpfc/lpfc_scsi.c 2005-12-05 13:19:59.000000000 +0300 @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -825,7 +826,7 @@ __lpfc_abort_handler(struct scsi_cmnd *c while (lpfc_cmd->pCmd == cmnd) { spin_unlock_irq(phba->host->host_lock); - schedule_timeout_uninterruptible(LPFC_ABORT_WAIT*HZ); + ssleep(LPFC_ABORT_WAIT); spin_lock_irq(phba->host->host_lock); if (++loop_count > (2 * phba->cfg_nodev_tmo)/LPFC_ABORT_WAIT) @@ -884,7 +885,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn if (pnode->nlp_state != NLP_STE_MAPPED_NODE) { spin_unlock_irq(phba->host->host_lock); - schedule_timeout_uninterruptible(msecs_to_jiffies(500)); + msleep(500); spin_lock_irq(phba->host->host_lock); } if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE)) @@ -937,7 +938,7 @@ __lpfc_reset_lun_handler(struct scsi_cmn cmnd->device->id, cmnd->device->lun, LPFC_CTX_LUN))) { spin_unlock_irq(phba->host->host_lock); - schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); + ssleep(LPFC_RESET_WAIT); spin_lock_irq(phba->host->host_lock); if (++loopcnt @@ -1035,7 +1036,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); - schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); + ssleep(LPFC_RESET_WAIT); spin_lock_irq(phba->host->host_lock); if (++loopcnt