Skip to content

Commit

Permalink
[SCSI] qla2xxx: Fix flash write failure on ISP82xx.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lalit Chandivade authored and James Bottomley committed Jul 27, 2010
1 parent cdbb0a4 commit 0547fb3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/scsi/qla2xxx/qla_nx.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define QLA82XX_PCI_OCM0_2M (0xc0000)
#define VALID_OCM_ADDR(addr) (((addr) & 0x3f800) != 0x3f800)
#define GET_MEM_OFFS_2M(addr) (addr & MASK(18))
#define BLOCK_PROTECT_BITS 0x0F

/* CRB window related */
#define CRB_BLK(off) ((off >> 20) & 0x3f)
Expand Down Expand Up @@ -3147,10 +3148,10 @@ qla82xx_unprotect_flash(struct qla_hw_data *ha)
if (ret < 0)
goto done_unprotect;

val &= ~(0x7 << 2);
val &= ~(BLOCK_PROTECT_BITS << 2);
ret = qla82xx_write_status_reg(ha, val);
if (ret < 0) {
val |= (0x7 << 2);
val |= (BLOCK_PROTECT_BITS << 2);
qla82xx_write_status_reg(ha, val);
}

Expand Down Expand Up @@ -3178,7 +3179,7 @@ qla82xx_protect_flash(struct qla_hw_data *ha)
if (ret < 0)
goto done_protect;

val |= (0x7 << 2);
val |= (BLOCK_PROTECT_BITS << 2);
/* LOCK all sectors */
ret = qla82xx_write_status_reg(ha, val);
if (ret < 0)
Expand Down

0 comments on commit 0547fb3

Please sign in to comment.