diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2010-04-28 02:10:37 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-02 15:39:38 -0400 |
commit | c301b0266c65c8781361ca152981cff4fac05498 (patch) | |
tree | 65a9d2b77242b63921f31369d3aae073c253f07c /drivers/scsi/qla4xxx/ql4_init.c | |
parent | c2393cd2dfdd435416cc097a70cc5f5e4f91a87e (diff) |
[SCSI] qla4xxx: Updated firmware ready timeout algorithm
Updated firmware ready timeout algorithm to prevent
long delays and use jiffies to time out instead of
counter. Also use msleep_interruptible instead of msleep.
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_init.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 7f6cc2ebf46..beaeb18a66a 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
@@ -1046,7 +1046,7 @@ static void qla4x00_pci_config(struct scsi_qla_host *ha) | |||
1046 | static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) | 1046 | static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) |
1047 | { | 1047 | { |
1048 | int status = QLA_ERROR; | 1048 | int status = QLA_ERROR; |
1049 | uint32_t max_wait_time; | 1049 | unsigned long max_wait_time; |
1050 | unsigned long flags; | 1050 | unsigned long flags; |
1051 | uint32_t mbox_status; | 1051 | uint32_t mbox_status; |
1052 | 1052 | ||
@@ -1078,7 +1078,10 @@ static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) | |||
1078 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1078 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1079 | 1079 | ||
1080 | /* Wait for firmware to come UP. */ | 1080 | /* Wait for firmware to come UP. */ |
1081 | max_wait_time = FIRMWARE_UP_TOV * 4; | 1081 | DEBUG2(printk(KERN_INFO "scsi%ld: %s: Wait up to %d seconds for " |
1082 | "boot firmware to complete...\n", | ||
1083 | ha->host_no, __func__, FIRMWARE_UP_TOV)); | ||
1084 | max_wait_time = jiffies + (FIRMWARE_UP_TOV * HZ); | ||
1082 | do { | 1085 | do { |
1083 | uint32_t ctrl_status; | 1086 | uint32_t ctrl_status; |
1084 | 1087 | ||
@@ -1092,16 +1095,15 @@ static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) | |||
1092 | if (mbox_status == MBOX_STS_COMMAND_COMPLETE) | 1095 | if (mbox_status == MBOX_STS_COMMAND_COMPLETE) |
1093 | break; | 1096 | break; |
1094 | 1097 | ||
1095 | DEBUG2(printk("scsi%ld: %s: Waiting for boot firmware to " | 1098 | DEBUG2(printk(KERN_INFO "scsi%ld: %s: Waiting for boot " |
1096 | "complete... ctrl_sts=0x%x, remaining=%d\n", | 1099 | "firmware to complete... ctrl_sts=0x%x\n", |
1097 | ha->host_no, __func__, ctrl_status, | 1100 | ha->host_no, __func__, ctrl_status)); |
1098 | max_wait_time)); | ||
1099 | 1101 | ||
1100 | msleep(250); | 1102 | msleep_interruptible(250); |
1101 | } while ((max_wait_time--)); | 1103 | } while (!time_after_eq(jiffies, max_wait_time)); |
1102 | 1104 | ||
1103 | if (mbox_status == MBOX_STS_COMMAND_COMPLETE) { | 1105 | if (mbox_status == MBOX_STS_COMMAND_COMPLETE) { |
1104 | DEBUG(printk("scsi%ld: %s: Firmware has started\n", | 1106 | DEBUG(printk(KERN_INFO "scsi%ld: %s: Firmware has started\n", |
1105 | ha->host_no, __func__)); | 1107 | ha->host_no, __func__)); |
1106 | 1108 | ||
1107 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1109 | spin_lock_irqsave(&ha->hardware_lock, flags); |