aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorLalit Chandivade <lalit.chandivade@qlogic.com>2010-05-28 18:08:26 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:25 -0400
commit0547fb37ca1f8da18e65b7452f99e9784f026be2 (patch)
treee3eae134005f2d2eacade8d1d13d319d06d1e592 /drivers/scsi/qla2xxx
parentcdbb0a4f31c486e4f6fb6e673a892f4f5205f91c (diff)
[SCSI] qla2xxx: Fix flash write failure on ISP82xx.
Driver was not unprotecting correctly, use correct bits to unprotect the flash on ISP 82xx. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 512ba8a4ac57..ee575b4efbee 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -19,6 +19,7 @@
19#define QLA82XX_PCI_OCM0_2M (0xc0000) 19#define QLA82XX_PCI_OCM0_2M (0xc0000)
20#define VALID_OCM_ADDR(addr) (((addr) & 0x3f800) != 0x3f800) 20#define VALID_OCM_ADDR(addr) (((addr) & 0x3f800) != 0x3f800)
21#define GET_MEM_OFFS_2M(addr) (addr & MASK(18)) 21#define GET_MEM_OFFS_2M(addr) (addr & MASK(18))
22#define BLOCK_PROTECT_BITS 0x0F
22 23
23/* CRB window related */ 24/* CRB window related */
24#define CRB_BLK(off) ((off >> 20) & 0x3f) 25#define CRB_BLK(off) ((off >> 20) & 0x3f)
@@ -3147,10 +3148,10 @@ qla82xx_unprotect_flash(struct qla_hw_data *ha)
3147 if (ret < 0) 3148 if (ret < 0)
3148 goto done_unprotect; 3149 goto done_unprotect;
3149 3150
3150 val &= ~(0x7 << 2); 3151 val &= ~(BLOCK_PROTECT_BITS << 2);
3151 ret = qla82xx_write_status_reg(ha, val); 3152 ret = qla82xx_write_status_reg(ha, val);
3152 if (ret < 0) { 3153 if (ret < 0) {
3153 val |= (0x7 << 2); 3154 val |= (BLOCK_PROTECT_BITS << 2);
3154 qla82xx_write_status_reg(ha, val); 3155 qla82xx_write_status_reg(ha, val);
3155 } 3156 }
3156 3157
@@ -3178,7 +3179,7 @@ qla82xx_protect_flash(struct qla_hw_data *ha)
3178 if (ret < 0) 3179 if (ret < 0)
3179 goto done_protect; 3180 goto done_protect;
3180 3181
3181 val |= (0x7 << 2); 3182 val |= (BLOCK_PROTECT_BITS << 2);
3182 /* LOCK all sectors */ 3183 /* LOCK all sectors */
3183 ret = qla82xx_write_status_reg(ha, val); 3184 ret = qla82xx_write_status_reg(ha, val);
3184 if (ret < 0) 3185 if (ret < 0)