aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 19:37:29 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 19:37:29 -0400
commit1212663fba7c5e003e05d24f043d5ed57eb18b24 (patch)
treed6d1327b1e852721952e2efc8aabca25e73573f0 /drivers/scsi/qla2xxx/qla_attr.c
parentaf76bbabbdf5cebea6a3863446f9f74b469c4bdc (diff)
parentaf2709fd0d127cd590e7a77ab50b23cdb9f6f48f (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (39 commits) [SCSI] qla2xxx: Update version number to 8.02.00-k5. [SCSI] qla2xxx: Correct display of ISP serial-number. [SCSI] qla2xxx: Correct residual-count handling discrepancies during UNDERRUN handling. [SCSI] qla2xxx: Make driver (mostly) legacy I/O port free. [SCSI] qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler. [SCSI] qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates. [SCSI] qla2xxx: Defer explicit interrupt-polling processing to init-time scenarios. [SCSI] qla2xxx: Resync with latest HBA SSID specification -- 2.2u. [SCSI] sym53c8xx: Remove sym_xpt_async_sent_bdr [SCSI] sym53c8xx: Remove pci_dev pointer from sym_shcb [SCSI] sym53c8xx: Make interrupt handler capable of returning IRQ_NONE [SCSI] sym53c8xx: Get rid of IRQ_FMT and IRQ_PRM [SCSI] sym53c8xx: Use scmd_printk where appropriate [SCSI] sym53c8xx: Simplify DAC DMA handling [SCSI] sym53c8xx: Remove tag_ctrl module parameter [SCSI] sym53c8xx: Remove io_ws, mmio_ws and ram_ws elements [SCSI] sym53c8xx: Remove ->device_id [SCSI] sym53c8xx: Use pdev->revision [SCSI] sym53c8xx: PCI Error Recovery support [SCSI] sym53c8xx: Stop overriding scsi_done ...
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 05fa7796a559..fb388b8c07cf 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -114,7 +114,6 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
114{ 114{
115 struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, 115 struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
116 struct device, kobj))); 116 struct device, kobj)));
117 unsigned long flags;
118 uint16_t cnt; 117 uint16_t cnt;
119 118
120 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size) 119 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->nvram_size)
@@ -144,11 +143,9 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj,
144 } 143 }
145 144
146 /* Write NVRAM. */ 145 /* Write NVRAM. */
147 spin_lock_irqsave(&ha->hardware_lock, flags);
148 ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count); 146 ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count);
149 ha->isp_ops->read_nvram(ha, (uint8_t *)ha->nvram, ha->nvram_base, 147 ha->isp_ops->read_nvram(ha, (uint8_t *)ha->nvram, ha->nvram_base,
150 count); 148 count);
151 spin_unlock_irqrestore(&ha->hardware_lock, flags);
152 149
153 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); 150 set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
154 151
@@ -397,16 +394,13 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj,
397{ 394{
398 struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj, 395 struct scsi_qla_host *ha = shost_priv(dev_to_shost(container_of(kobj,
399 struct device, kobj))); 396 struct device, kobj)));
400 unsigned long flags;
401 397
402 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) 398 if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size)
403 return 0; 399 return 0;
404 400
405 /* Write NVRAM. */ 401 /* Write NVRAM. */
406 spin_lock_irqsave(&ha->hardware_lock, flags);
407 ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); 402 ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count);
408 ha->isp_ops->read_nvram(ha, (uint8_t *)ha->vpd, ha->vpd_base, count); 403 ha->isp_ops->read_nvram(ha, (uint8_t *)ha->vpd, ha->vpd_base, count);
409 spin_unlock_irqrestore(&ha->hardware_lock, flags);
410 404
411 return count; 405 return count;
412} 406}
@@ -544,6 +538,9 @@ qla2x00_serial_num_show(struct class_device *cdev, char *buf)
544 scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev)); 538 scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
545 uint32_t sn; 539 uint32_t sn;
546 540
541 if (IS_FWI2_CAPABLE(ha))
542 return snprintf(buf, PAGE_SIZE, "\n");
543
547 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; 544 sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;
548 return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000, 545 return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000,
549 sn % 100000); 546 sn % 100000);