aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorLalit Chandivade <lalit.chandivade@qlogic.com>2009-03-24 12:08:07 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:49 -0400
commit2533cf671da0603129c8af9c31c735e1d2654e20 (patch)
tree3ef7f6c0b4266823c07bc0687ac9009e1cc281c0 /drivers/scsi/qla2xxx/qla_attr.c
parent1d2874de809a14e6780246b99a18bbc0fc0a8f2a (diff)
[SCSI] qla2xxx: Correct ISP abort semantics for NVRAM, VPD, and flash update.
Ensure that an ISP-abort has completed before performing any update. After the update do not wait for an ISP-abort completion, instead just wait until the ISP is reset. This avoids long delays due to waiting for loop ready in qla2x00_abort_isp(). Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com> Additional cleanups and Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 41ce1c6e56b3..117517dcbe44 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -137,12 +137,21 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
137 *iter = chksum; 137 *iter = chksum;
138 } 138 }
139 139
140 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
141 qla_printk(KERN_WARNING, ha,
142 "HBA not online, failing NVRAM update.\n");
143 return -EAGAIN;
144 }
145
140 /* Write NVRAM. */ 146 /* Write NVRAM. */
141 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count); 147 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->nvram_base, count);
142 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base, 148 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->nvram, ha->nvram_base,
143 count); 149 count);
144 150
151 /* NVRAM settings take effect immediately. */
145 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 152 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
153 qla2xxx_wake_dpc(vha);
154 qla2x00_wait_for_chip_reset(vha);
146 155
147 return (count); 156 return (count);
148} 157}
@@ -330,6 +339,12 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj,
330 if (ha->optrom_state != QLA_SWRITING) 339 if (ha->optrom_state != QLA_SWRITING)
331 break; 340 break;
332 341
342 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
343 qla_printk(KERN_WARNING, ha,
344 "HBA not online, failing flash update.\n");
345 return -EAGAIN;
346 }
347
333 DEBUG2(qla_printk(KERN_INFO, ha, 348 DEBUG2(qla_printk(KERN_INFO, ha,
334 "Writing flash region -- 0x%x/0x%x.\n", 349 "Writing flash region -- 0x%x/0x%x.\n",
335 ha->optrom_region_start, ha->optrom_region_size)); 350 ha->optrom_region_start, ha->optrom_region_size));
@@ -380,6 +395,12 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj,
380 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) 395 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size)
381 return 0; 396 return 0;
382 397
398 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) {
399 qla_printk(KERN_WARNING, ha,
400 "HBA not online, failing VPD update.\n");
401 return -EAGAIN;
402 }
403
383 /* Write NVRAM. */ 404 /* Write NVRAM. */
384 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count); 405 ha->isp_ops->write_nvram(vha, (uint8_t *)buf, ha->vpd_base, count);
385 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count); 406 ha->isp_ops->read_nvram(vha, (uint8_t *)ha->vpd, ha->vpd_base, count);