scsi: qla2xxx: Simplify the functions for dumping firmware
authorBart Van Assche <bvanassche@acm.org>
Mon, 18 May 2020 21:17:00 +0000 (14:17 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 20 May 2020 01:43:04 +0000 (21:43 -0400)
Instead of passing an argument to the firmware dumping functions that tells
these functions whether or not to obtain the hardware lock, obtain that
lock before calling these functions. This patch fixes the following
recently introduced C=2 build error:

  CHECK   drivers/scsi/qla2xxx/qla_tmpl.c
drivers/scsi/qla2xxx/qla_tmpl.c:1133:1: error: Expected ; at end of statement
drivers/scsi/qla2xxx/qla_tmpl.c:1133:1: error: got }
drivers/scsi/qla2xxx/qla_tmpl.h:247:0: error: Expected } at end of function
drivers/scsi/qla2xxx/qla_tmpl.h:247:0: error: got end-of-input

Link: https://lore.kernel.org/r/20200518211712.11395-4-bvanassche@acm.org
Fixes: cbb01c2f2f63 ("scsi: qla2xxx: Fix MPI failure AEN (8200) handling")
Cc: Arun Easi <aeasi@marvell.com>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_nx2.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_tmpl.c

index 97b51c477972bee59f522a512f6040c522dd3f00..3af7ca68ec44dea7d27e6eb51daacd93f804ba7c 100644 (file)
@@ -691,7 +691,7 @@ qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config,
                 * dump and reset the chip.
                 */
                if (ret) {
-                       ha->isp_ops->fw_dump(vha, 0);
+                       qla2xxx_dump_fw(vha);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                }
                rval = -EINVAL;
@@ -896,7 +896,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
                                         * doesn't work take FCoE dump and then
                                         * reset the chip.
                                         */
-                                       ha->isp_ops->fw_dump(vha, 0);
+                                       qla2xxx_dump_fw(vha);
                                        set_bit(ISP_ABORT_NEEDED,
                                            &vha->dpc_flags);
                                }
index 1206f7c1ce6a8191ac82d0c36e905c1afd3ba0f2..07a8c674b7412a3e9005aa13438d636a24634041 100644 (file)
@@ -716,35 +716,37 @@ qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval)
        }
 }
 
+void qla2xxx_dump_fw(scsi_qla_host_t *vha)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&vha->hw->hardware_lock, flags);
+       vha->hw->isp_ops->fw_dump(vha);
+       spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
+}
+
 /**
  * qla2300_fw_dump() - Dumps binary data from the 2300 firmware.
  * @vha: HA context
- * @hardware_locked: Called with the hardware_lock
  */
 void
-qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla2300_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
        uint16_t __iomem *dmp_reg;
-       unsigned long   flags;
        struct qla2300_fw_dump  *fw;
        void            *nxt;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       flags = 0;
-
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
+       lockdep_assert_held(&ha->hardware_lock);
 
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd002,
                    "No buffer available for dump.\n");
-               goto qla2300_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
@@ -752,7 +754,7 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                    "Firmware has been previously dumped (%p) "
                    "-- ignoring request.\n",
                    ha->fw_dump);
-               goto qla2300_fw_dump_failed;
+               return;
        }
        fw = &ha->fw_dump->isp.isp23;
        qla2xxx_prep_dump(ha, ha->fw_dump);
@@ -876,48 +878,31 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                qla2xxx_copy_queues(ha, nxt);
 
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla2300_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 /**
  * qla2100_fw_dump() - Dumps binary data from the 2100/2200 firmware.
  * @vha: HA context
- * @hardware_locked: Called with the hardware_lock
  */
 void
-qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla2100_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt, timer;
-       uint16_t        risc_address;
-       uint16_t        mb0, mb2;
+       uint16_t        risc_address = 0;
+       uint16_t        mb0 = 0, mb2 = 0;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
        uint16_t __iomem *dmp_reg;
-       unsigned long   flags;
        struct qla2100_fw_dump  *fw;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       risc_address = 0;
-       mb0 = mb2 = 0;
-       flags = 0;
-
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
+       lockdep_assert_held(&ha->hardware_lock);
 
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd004,
                    "No buffer available for dump.\n");
-               goto qla2100_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
@@ -925,7 +910,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                    "Firmware has been previously dumped (%p) "
                    "-- ignoring request.\n",
                    ha->fw_dump);
-               goto qla2100_fw_dump_failed;
+               return;
        }
        fw = &ha->fw_dump->isp.isp21;
        qla2xxx_prep_dump(ha, ha->fw_dump);
@@ -1080,18 +1065,10 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]);
 
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla2100_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 void
-qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla24xx_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt;
@@ -1100,28 +1077,23 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint32_t __iomem *dmp_reg;
        uint32_t        *iter_reg;
        uint16_t __iomem *mbx_reg;
-       unsigned long   flags;
        struct qla24xx_fw_dump *fw;
        void            *nxt;
        void            *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
+       lockdep_assert_held(&ha->hardware_lock);
+
        if (IS_P3P_TYPE(ha))
                return;
 
-       flags = 0;
        ha->fw_dump_cap_flags = 0;
 
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
-
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd006,
                    "No buffer available for dump.\n");
-               goto qla24xx_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
@@ -1129,7 +1101,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                    "Firmware has been previously dumped (%p) "
                    "-- ignoring request.\n",
                    ha->fw_dump);
-               goto qla24xx_fw_dump_failed;
+               return;
        }
        QLA_FW_STOPPED(ha);
        fw = &ha->fw_dump->isp.isp24;
@@ -1339,18 +1311,10 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
 qla24xx_fw_dump_failed_0:
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla24xx_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 void
-qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla25xx_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt;
@@ -1359,24 +1323,19 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint32_t __iomem *dmp_reg;
        uint32_t        *iter_reg;
        uint16_t __iomem *mbx_reg;
-       unsigned long   flags;
        struct qla25xx_fw_dump *fw;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       flags = 0;
-       ha->fw_dump_cap_flags = 0;
+       lockdep_assert_held(&ha->hardware_lock);
 
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
+       ha->fw_dump_cap_flags = 0;
 
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd008,
                    "No buffer available for dump.\n");
-               goto qla25xx_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
@@ -1384,7 +1343,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                    "Firmware has been previously dumped (%p) "
                    "-- ignoring request.\n",
                    ha->fw_dump);
-               goto qla25xx_fw_dump_failed;
+               return;
        }
        QLA_FW_STOPPED(ha);
        fw = &ha->fw_dump->isp.isp25;
@@ -1665,18 +1624,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
 qla25xx_fw_dump_failed_0:
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla25xx_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 void
-qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla81xx_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt;
@@ -1685,24 +1636,19 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint32_t __iomem *dmp_reg;
        uint32_t        *iter_reg;
        uint16_t __iomem *mbx_reg;
-       unsigned long   flags;
        struct qla81xx_fw_dump *fw;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       flags = 0;
-       ha->fw_dump_cap_flags = 0;
+       lockdep_assert_held(&ha->hardware_lock);
 
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
+       ha->fw_dump_cap_flags = 0;
 
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd00a,
                    "No buffer available for dump.\n");
-               goto qla81xx_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
@@ -1710,7 +1656,7 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
                    "Firmware has been previously dumped (%p) "
                    "-- ignoring request.\n",
                    ha->fw_dump);
-               goto qla81xx_fw_dump_failed;
+               return;
        }
        fw = &ha->fw_dump->isp.isp81;
        qla2xxx_prep_dump(ha, ha->fw_dump);
@@ -1993,18 +1939,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
 qla81xx_fw_dump_failed_0:
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla81xx_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 void
-qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla83xx_fw_dump(scsi_qla_host_t *vha)
 {
        int             rval;
        uint32_t        cnt;
@@ -2013,31 +1951,26 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint32_t __iomem *dmp_reg;
        uint32_t        *iter_reg;
        uint16_t __iomem *mbx_reg;
-       unsigned long   flags;
        struct qla83xx_fw_dump *fw;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       flags = 0;
-       ha->fw_dump_cap_flags = 0;
+       lockdep_assert_held(&ha->hardware_lock);
 
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&ha->hardware_lock, flags);
-#endif
+       ha->fw_dump_cap_flags = 0;
 
        if (!ha->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd00c,
                    "No buffer available for dump!!!\n");
-               goto qla83xx_fw_dump_failed;
+               return;
        }
 
        if (ha->fw_dumped) {
                ql_log(ql_log_warn, vha, 0xd00d,
                    "Firmware has been previously dumped (%p) -- ignoring "
                    "request...\n", ha->fw_dump);
-               goto qla83xx_fw_dump_failed;
+               return;
        }
        QLA_FW_STOPPED(ha);
        fw = &ha->fw_dump->isp.isp83;
@@ -2507,14 +2440,6 @@ copy_queue:
 
 qla83xx_fw_dump_failed_0:
        qla2xxx_dump_post_process(base_vha, rval);
-
-qla83xx_fw_dump_failed:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&ha->hardware_lock, flags);
-#else
-       ;
-#endif
 }
 
 /****************************************************************************/
index 172ea4e5887d90319a9c7a245b121f13d4bc1ed2..5ca46b15ca3cf4b10b34daa3794c66b2fb24d095 100644 (file)
@@ -3222,7 +3222,7 @@ struct isp_operations {
        int (*write_nvram)(struct scsi_qla_host *, void *, uint32_t,
                uint32_t);
 
-       void (*fw_dump) (struct scsi_qla_host *, int);
+       void (*fw_dump)(struct scsi_qla_host *vha);
        void (*mpi_fw_dump)(struct scsi_qla_host *, int);
 
        int (*beacon_on) (struct scsi_qla_host *);
index f62b71e47581e6b059483274af6ff725fb2645e8..061f91b521b3ff9a102d0e285beedab5fa69c4c8 100644 (file)
@@ -637,15 +637,16 @@ extern int qla24xx_read_fcp_prio_cfg(scsi_qla_host_t *);
 /*
  * Global Function Prototypes in qla_dbg.c source file.
  */
-extern void qla2100_fw_dump(scsi_qla_host_t *, int);
-extern void qla2300_fw_dump(scsi_qla_host_t *, int);
-extern void qla24xx_fw_dump(scsi_qla_host_t *, int);
-extern void qla25xx_fw_dump(scsi_qla_host_t *, int);
-extern void qla81xx_fw_dump(scsi_qla_host_t *, int);
-extern void qla82xx_fw_dump(scsi_qla_host_t *, int);
-extern void qla8044_fw_dump(scsi_qla_host_t *, int);
-
-extern void qla27xx_fwdump(scsi_qla_host_t *, int);
+void qla2xxx_dump_fw(scsi_qla_host_t *vha);
+void qla2100_fw_dump(scsi_qla_host_t *vha);
+void qla2300_fw_dump(scsi_qla_host_t *vha);
+void qla24xx_fw_dump(scsi_qla_host_t *vha);
+void qla25xx_fw_dump(scsi_qla_host_t *vha);
+void qla81xx_fw_dump(scsi_qla_host_t *vha);
+void qla82xx_fw_dump(scsi_qla_host_t *vha);
+void qla8044_fw_dump(scsi_qla_host_t *vha);
+
+void qla27xx_fwdump(scsi_qla_host_t *vha);
 extern void qla27xx_mpi_fwdump(scsi_qla_host_t *, int);
 extern ulong qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *, void *);
 extern int qla27xx_fwdt_template_valid(void *);
@@ -873,7 +874,7 @@ extern int qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t,
        uint16_t *, uint16_t *);
 
 /* 83xx related functions */
-extern void qla83xx_fw_dump(scsi_qla_host_t *, int);
+void qla83xx_fw_dump(scsi_qla_host_t *vha);
 
 /* Minidump related functions */
 extern int qla82xx_md_get_template_size(scsi_qla_host_t *);
index a9e8513e1cf127f8cbe02a9628f251062807decd..54e1ecdc0cdb5c8792cf1ed374b1ff9e8872d45c 100644 (file)
@@ -220,7 +220,7 @@ qla2100_intr_handler(int irq, void *dev_id)
                        WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
                        RD_REG_WORD(&reg->hccr);
 
-                       ha->isp_ops->fw_dump(vha, 1);
+                       ha->isp_ops->fw_dump(vha);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        break;
                } else if ((RD_REG_WORD(&reg->istatus) & ISR_RISC_INT) == 0)
@@ -351,7 +351,7 @@ qla2300_intr_handler(int irq, void *dev_id)
                        WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
                        RD_REG_WORD(&reg->hccr);
 
-                       ha->isp_ops->fw_dump(vha, 1);
+                       ha->isp_ops->fw_dump(vha);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        break;
                } else if ((stat & HSR_RISC_INT) == 0)
@@ -777,7 +777,7 @@ qla27xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb)
               "MPI Heartbeat stop. FW dump needed\n");
 
        if (ql2xfulldump_on_mpifail) {
-               ha->isp_ops->fw_dump(vha, 1);
+               ha->isp_ops->fw_dump(vha);
                reset_isp_needed = 1;
        }
 
@@ -908,7 +908,7 @@ skip_rio:
                if ((IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
                    RD_REG_WORD(&reg24->mailbox7) & BIT_8)
                        ha->isp_ops->mpi_fw_dump(vha, 1);
-               ha->isp_ops->fw_dump(vha, 1);
+               ha->isp_ops->fw_dump(vha);
                ha->flags.fw_init_done = 0;
                QLA_FW_STOPPED(ha);
 
@@ -3473,7 +3473,7 @@ qla24xx_intr_handler(int irq, void *dev_id)
 
                        qla2xxx_check_risc_status(vha);
 
-                       ha->isp_ops->fw_dump(vha, 1);
+                       ha->isp_ops->fw_dump(vha);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        break;
                } else if ((stat & HSRX_RISC_INT) == 0)
@@ -3602,7 +3602,7 @@ qla24xx_msix_default(int irq, void *dev_id)
 
                        qla2xxx_check_risc_status(vha);
 
-                       ha->isp_ops->fw_dump(vha, 1);
+                       ha->isp_ops->fw_dump(vha);
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        break;
                } else if ((stat & HSRX_RISC_INT) == 0)
index 9fd83d1bffe02d1e5d87c0e0d0a66d20f7717025..fb3e481bfa0cddb95ca2ce8bf5d75389b411a910 100644 (file)
@@ -462,7 +462,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
                         * a dump
                         */
                        if (mcp->mb[0] != MBC_GEN_SYSTEM_ERROR)
-                               ha->isp_ops->fw_dump(vha, 0);
+                               qla2xxx_dump_fw(vha);
                        rval = QLA_FUNCTION_TIMEOUT;
                 }
        }
@@ -6213,7 +6213,7 @@ qla83xx_restart_nic_firmware(scsi_qla_host_t *vha)
                ql_dbg(ql_dbg_mbx, vha, 0x1144,
                    "Failed=%x mb[0]=%x mb[1]=%x.\n",
                    rval, mcp->mb[0], mcp->mb[1]);
-               ha->isp_ops->fw_dump(vha, 0);
+               qla2xxx_dump_fw(vha);
        } else {
                ql_dbg(ql_dbg_mbx, vha, 0x1145, "Done %s.\n", __func__);
        }
@@ -6258,7 +6258,7 @@ qla83xx_access_control(scsi_qla_host_t *vha, uint16_t options,
                    "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x mb[3]=%x mb[4]=%x.\n",
                    rval, mcp->mb[0], mcp->mb[1], mcp->mb[2], mcp->mb[3],
                    mcp->mb[4]);
-               ha->isp_ops->fw_dump(vha, 0);
+               qla2xxx_dump_fw(vha);
        } else {
                if (subcode & BIT_5)
                        *sector_size = mcp->mb[1];
index d2037253e2d796d891d19b2ce2abdc1e069c014c..ec4d6675c62fd29881fc221996a41721f7da9e8d 100644 (file)
@@ -4514,7 +4514,7 @@ exit:
 }
 
 void
-qla82xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla82xx_fw_dump(scsi_qla_host_t *vha)
 {
        struct qla_hw_data *ha = vha->hw;
 
index b5c3e56edabad83a221f0bdc369fd2a66c4697f7..df94294283162b439c82a9efb1f7ae731b159dcc 100644 (file)
@@ -4070,7 +4070,7 @@ exit_isp_reset:
 }
 
 void
-qla8044_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
+qla8044_fw_dump(scsi_qla_host_t *vha)
 {
        struct qla_hw_data *ha = vha->hw;
 
index 382e1f977d01b517a06272091324ededa7b76f6c..8f96d37a866c724f7eefcdf910c86a6902131ccb 100644 (file)
@@ -7575,7 +7575,7 @@ qla2xxx_pci_mmio_enabled(struct pci_dev *pdev)
        if (risc_paused) {
                ql_log(ql_log_info, base_vha, 0x9003,
                    "RISC paused -- mmio_enabled, Dumping firmware.\n");
-               ha->isp_ops->fw_dump(base_vha, 0);
+               qla2xxx_dump_fw(base_vha);
 
                return PCI_ERS_RESULT_NEED_RESET;
        } else
index f3255aa70dcc7aace07c61273e86973e1742dd48..3af8a8a7f9978b9e21b7712ac4dca42c536242b4 100644 (file)
@@ -5670,9 +5670,9 @@ static int qlt_chk_unresolv_exchg(struct scsi_qla_host *vha,
                            vha, 0xffff, (uint8_t *)entry, sizeof(*entry));
 
                        if (qpair == ha->base_qpair)
-                               ha->isp_ops->fw_dump(vha, 1);
+                               ha->isp_ops->fw_dump(vha);
                        else
-                               ha->isp_ops->fw_dump(vha, 0);
+                               qla2xxx_dump_fw(vha);
 
                        set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                        qla2xxx_wake_dpc(vha);
index 281973b317a813990738c94f12fb5cf04803c458..4a4d92046cbfbc665bb76107bcf14689fbeb1ccb 100644 (file)
@@ -1081,14 +1081,9 @@ bailout:
 }
 
 void
-qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
+qla27xx_fwdump(scsi_qla_host_t *vha)
 {
-       ulong flags = 0;
-
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_lock_irqsave(&vha->hw->hardware_lock, flags);
-#endif
+       lockdep_assert_held(&vha->hw->hardware_lock);
 
        if (!vha->hw->fw_dump) {
                ql_log(ql_log_warn, vha, 0xd01e, "-> fwdump no buffer\n");
@@ -1105,11 +1100,11 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
                if (!fwdt->template) {
                        ql_log(ql_log_warn, vha, 0xd012,
                               "-> fwdt0 no template\n");
-                       goto bailout;
+                       return;
                }
                len = qla27xx_execute_fwdt_template(vha, fwdt->template, buf);
                if (len == 0) {
-                       goto bailout;
+                       return;
                } else if (len != fwdt->dump_size) {
                        ql_log(ql_log_warn, vha, 0xd013,
                               "-> fwdt0 fwdump residual=%+ld\n",
@@ -1124,10 +1119,4 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
                    vha->host_no, vha->hw->fw_dump, vha->hw->fw_dump_cap_flags);
                qla2x00_post_uevent_work(vha, QLA_UEVENT_CODE_FW_DUMP);
        }
-
-bailout:
-#ifndef __CHECKER__
-       if (!hardware_locked)
-               spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
-#endif
 }