diff mbox series

[2/6] qla2xxx: Fix flash read for Qlogic ISPs

Message ID 20190830222402.23688-3-hmadhani@marvell.com (mailing list archive)
State Superseded
Headers show
Series qla2xxx: Bug fixes for the driver | expand

Commit Message

Himanshu Madhani Aug. 30, 2019, 10:23 p.m. UTC
From: Quinn Tran <qutran@marvell.com>

Use adapter specific callback to read flash instead of ISP
adapter specific.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 4 ++--
 drivers/scsi/qla2xxx/qla_nx.c   | 1 +
 drivers/scsi/qla2xxx/qla_sup.c  | 8 ++++----
 3 files changed, 7 insertions(+), 6 deletions(-)

Comments

Ewan Milne Sept. 3, 2019, 2:48 p.m. UTC | #1
On Fri, 2019-08-30 at 15:23 -0700, Himanshu Madhani wrote:
> From: Quinn Tran <qutran@marvell.com>
> 
> Use adapter specific callback to read flash instead of ISP
> adapter specific.
> 
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_init.c | 4 ++--
>  drivers/scsi/qla2xxx/qla_nx.c   | 1 +
>  drivers/scsi/qla2xxx/qla_sup.c  | 8 ++++----
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 632130b6165d..8161f08f3a4d 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -8229,7 +8229,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
>  		    active_regions.aux.vpd_nvram == QLA27XX_PRIMARY_IMAGE ?
>  		    "primary" : "secondary");
>  	}
> -	qla24xx_read_flash_data(vha, ha->vpd, faddr, ha->vpd_size >> 2);
> +	ha->isp_ops->read_optrom(vha, ha->vpd, faddr << 2, ha->vpd_size);
>  
>  	/* Get NVRAM data into cache and calculate checksum. */
>  	faddr = ha->flt_region_nvram;
> @@ -8241,7 +8241,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
>  	    "Loading %s nvram image.\n",
>  	    active_regions.aux.vpd_nvram == QLA27XX_PRIMARY_IMAGE ?
>  	    "primary" : "secondary");
> -	qla24xx_read_flash_data(vha, ha->nvram, faddr, ha->nvram_size >> 2);
> +	ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size);
>  
>  	dptr = (uint32_t *)nv;
>  	for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++, dptr++)
> diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
> index 65a675906188..a79f8da38abe 100644
> --- a/drivers/scsi/qla2xxx/qla_nx.c
> +++ b/drivers/scsi/qla2xxx/qla_nx.c
> @@ -2288,6 +2288,7 @@ qla82xx_disable_intrs(struct qla_hw_data *ha)
>  	scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
>  
>  	qla82xx_mbx_intr_disable(vha);
> +
>  	spin_lock_irq(&ha->hardware_lock);
>  	if (IS_QLA8044(ha))
>  		qla8044_wr_reg(ha, LEG_INTR_MASK_OFFSET, 1);
> diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
> index 764e1bb0f695..f2d5115b2d8d 100644
> --- a/drivers/scsi/qla2xxx/qla_sup.c
> +++ b/drivers/scsi/qla2xxx/qla_sup.c
> @@ -682,8 +682,8 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
>  
>  	ha->flt_region_flt = flt_addr;
>  	wptr = (uint16_t *)ha->flt;
> -	qla24xx_read_flash_data(vha, (void *)flt, flt_addr,
> -	    (sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE) >> 2);
> +	ha->isp_ops->read_optrom(vha, (void *)flt, flt_addr << 2,
> +	    (sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE));
>  
>  	if (le16_to_cpu(*wptr) == 0xffff)
>  		goto no_flash_data;
> @@ -950,11 +950,11 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha)
>  	struct req_que *req = ha->req_q_map[0];
>  	uint16_t cnt, chksum;
>  	uint16_t *wptr = (void *)req->ring;
> -	struct qla_fdt_layout *fdt = (void *)req->ring;
> +	struct qla_fdt_layout *fdt = (struct qla_fdt_layout *)req->ring;
>  	uint8_t	man_id, flash_id;
>  	uint16_t mid = 0, fid = 0;
>  
> -	qla24xx_read_flash_data(vha, (void *)fdt, ha->flt_region_fdt,
> +	ha->isp_ops->read_optrom(vha, fdt, ha->flt_region_fdt << 2,
>  	    OPTROM_BURST_DWORDS);
>  	if (le16_to_cpu(*wptr) == 0xffff)
>  		goto no_flash_data;

Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Martin Wilck Sept. 13, 2019, 8:36 p.m. UTC | #2
On Fri, 2019-08-30 at 15:23 -0700, Himanshu Madhani wrote:
> From: Quinn Tran <qutran@marvell.com>
> 
> Use adapter specific callback to read flash instead of ISP
> adapter specific.
> 
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_init.c | 4 ++--
>  drivers/scsi/qla2xxx/qla_nx.c   | 1 +
>  drivers/scsi/qla2xxx/qla_sup.c  | 8 ++++----
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 

Tested-by: Martin Wilck <mwilck@suse.com>

I believe this patch should be tagged with

Fixes: 5fa8774c7f38 (scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism)

I just bisected the FW initialization problems on my 8200 series CNA to
that commit, and I can confirm that this patch fixes it.
Martin K. Petersen Sept. 13, 2019, 10:37 p.m. UTC | #3
Hi Martin,

> I believe this patch should be tagged with
>
> Fixes: 5fa8774c7f38 (scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism)
>
> I just bisected the FW initialization problems on my 8200 series CNA
> to that commit, and I can confirm that this patch fixes it.

I am not going to rebase this late in the cycle. Himanshu or Quinn will
need to send a request to stable@ after Linus pulls 5.4/scsi-queue.
Himanshu Madhani Sept. 16, 2019, 4:19 p.m. UTC | #4
Hi Martin,  

On 9/13/19, 5:37 PM, "Martin K. Petersen" <martin.petersen@oracle.com> wrote:

    External Email
    
    ----------------------------------------------------------------------
    
    Hi Martin,
    
    > I believe this patch should be tagged with
    >
    > Fixes: 5fa8774c7f38 (scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism)
    >
    > I just bisected the FW initialization problems on my 8200 series CNA
    > to that commit, and I can confirm that this patch fixes it.
    
    I am not going to rebase this late in the cycle. Himanshu or Quinn will
    need to send a request to stable@ after Linus pulls 5.4/scsi-queue.
    
Sure. Will do.  

Thanks Martin W for pointing out missing tag.

-- Himanshu
    -- 
    Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 632130b6165d..8161f08f3a4d 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -8229,7 +8229,7 @@  qla81xx_nvram_config(scsi_qla_host_t *vha)
 		    active_regions.aux.vpd_nvram == QLA27XX_PRIMARY_IMAGE ?
 		    "primary" : "secondary");
 	}
-	qla24xx_read_flash_data(vha, ha->vpd, faddr, ha->vpd_size >> 2);
+	ha->isp_ops->read_optrom(vha, ha->vpd, faddr << 2, ha->vpd_size);
 
 	/* Get NVRAM data into cache and calculate checksum. */
 	faddr = ha->flt_region_nvram;
@@ -8241,7 +8241,7 @@  qla81xx_nvram_config(scsi_qla_host_t *vha)
 	    "Loading %s nvram image.\n",
 	    active_regions.aux.vpd_nvram == QLA27XX_PRIMARY_IMAGE ?
 	    "primary" : "secondary");
-	qla24xx_read_flash_data(vha, ha->nvram, faddr, ha->nvram_size >> 2);
+	ha->isp_ops->read_optrom(vha, ha->nvram, faddr << 2, ha->nvram_size);
 
 	dptr = (uint32_t *)nv;
 	for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++, dptr++)
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 65a675906188..a79f8da38abe 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -2288,6 +2288,7 @@  qla82xx_disable_intrs(struct qla_hw_data *ha)
 	scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
 
 	qla82xx_mbx_intr_disable(vha);
+
 	spin_lock_irq(&ha->hardware_lock);
 	if (IS_QLA8044(ha))
 		qla8044_wr_reg(ha, LEG_INTR_MASK_OFFSET, 1);
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 764e1bb0f695..f2d5115b2d8d 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -682,8 +682,8 @@  qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
 
 	ha->flt_region_flt = flt_addr;
 	wptr = (uint16_t *)ha->flt;
-	qla24xx_read_flash_data(vha, (void *)flt, flt_addr,
-	    (sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE) >> 2);
+	ha->isp_ops->read_optrom(vha, (void *)flt, flt_addr << 2,
+	    (sizeof(struct qla_flt_header) + FLT_REGIONS_SIZE));
 
 	if (le16_to_cpu(*wptr) == 0xffff)
 		goto no_flash_data;
@@ -950,11 +950,11 @@  qla2xxx_get_fdt_info(scsi_qla_host_t *vha)
 	struct req_que *req = ha->req_q_map[0];
 	uint16_t cnt, chksum;
 	uint16_t *wptr = (void *)req->ring;
-	struct qla_fdt_layout *fdt = (void *)req->ring;
+	struct qla_fdt_layout *fdt = (struct qla_fdt_layout *)req->ring;
 	uint8_t	man_id, flash_id;
 	uint16_t mid = 0, fid = 0;
 
-	qla24xx_read_flash_data(vha, (void *)fdt, ha->flt_region_fdt,
+	ha->isp_ops->read_optrom(vha, fdt, ha->flt_region_fdt << 2,
 	    OPTROM_BURST_DWORDS);
 	if (le16_to_cpu(*wptr) == 0xffff)
 		goto no_flash_data;