Commit c94f08ef authored by Maximilian Attems's avatar Maximilian Attems Committed by Dave Jones

[PATCH] scsi/qla_os: replace schedule_timeout() with msleep()

Use msleep() instead of schedule_timeout() to
guarantee the task delays for the desired time.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>

incremental patch adds missing include.
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarMax Attems <janitor@sternwelten.at>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent c2199d75
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/delay.h>
#include <scsi/scsi_tcq.h> #include <scsi/scsi_tcq.h>
#include <scsi/scsicam.h> #include <scsi/scsicam.h>
...@@ -969,8 +970,7 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha) ...@@ -969,8 +970,7 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) || test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) ||
ha->dpc_active) && time_before(jiffies, wait_online)) { ha->dpc_active) && time_before(jiffies, wait_online)) {
set_current_state(TASK_UNINTERRUPTIBLE); msleep(1000);
schedule_timeout(HZ);
} }
if (ha->flags.online) if (ha->flags.online)
return_status = QLA_SUCCESS; return_status = QLA_SUCCESS;
...@@ -1011,8 +1011,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha) ...@@ -1011,8 +1011,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
atomic_read(&ha->loop_state) == LOOP_DOWN) || atomic_read(&ha->loop_state) == LOOP_DOWN) ||
test_bit(CFG_ACTIVE, &ha->cfg_flags) || test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
atomic_read(&ha->loop_state) != LOOP_READY) { atomic_read(&ha->loop_state) != LOOP_READY) {
set_current_state(TASK_UNINTERRUPTIBLE); msleep(1000);
schedule_timeout(HZ);
if (time_after_eq(jiffies, loop_timeout)) { if (time_after_eq(jiffies, loop_timeout)) {
return_status = QLA_FUNCTION_FAILED; return_status = QLA_FUNCTION_FAILED;
break; break;
...@@ -2120,8 +2119,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) ...@@ -2120,8 +2119,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
qla2x00_check_fabric_devices(ha); qla2x00_check_fabric_devices(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(10);
schedule_timeout(HZ/100);
} }
pci_set_drvdata(pdev, ha); pci_set_drvdata(pdev, ha);
...@@ -2833,8 +2831,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2833,8 +2831,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - request_ring\n"); "Memory Allocation failed - request_ring\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2847,8 +2844,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2847,8 +2844,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - response_ring\n"); "Memory Allocation failed - response_ring\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2861,8 +2857,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2861,8 +2857,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - init_cb\n"); "Memory Allocation failed - init_cb\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2874,8 +2869,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2874,8 +2869,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - ioctl_mem\n"); "Memory Allocation failed - ioctl_mem\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2886,8 +2880,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2886,8 +2880,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"qla2x00_allocate_sp_pool()\n"); "qla2x00_allocate_sp_pool()\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2903,8 +2896,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2903,8 +2896,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - sns_cmd\n"); "Memory Allocation failed - sns_cmd\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2919,8 +2911,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2919,8 +2911,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - ms_iocb\n"); "Memory Allocation failed - ms_iocb\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2938,8 +2929,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2938,8 +2929,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - ct_sns\n"); "Memory Allocation failed - ct_sns\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
...@@ -2955,8 +2945,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) ...@@ -2955,8 +2945,7 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
"Memory Allocation failed - iodesc_pd\n"); "Memory Allocation failed - iodesc_pd\n");
qla2x00_mem_free(ha); qla2x00_mem_free(ha);
set_current_state(TASK_UNINTERRUPTIBLE); msleep(100);
schedule_timeout(HZ/10);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment