Commit 8ae17876 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Simplify the functions for dumping firmware

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: cbb01c2f ("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: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent fbbc95a4
...@@ -691,7 +691,7 @@ qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config, ...@@ -691,7 +691,7 @@ qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config,
* dump and reset the chip. * dump and reset the chip.
*/ */
if (ret) { if (ret) {
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
} }
rval = -EINVAL; rval = -EINVAL;
...@@ -896,7 +896,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job) ...@@ -896,7 +896,7 @@ qla2x00_process_loopback(struct bsg_job *bsg_job)
* doesn't work take FCoE dump and then * doesn't work take FCoE dump and then
* reset the chip. * reset the chip.
*/ */
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
set_bit(ISP_ABORT_NEEDED, set_bit(ISP_ABORT_NEEDED,
&vha->dpc_flags); &vha->dpc_flags);
} }
......
...@@ -716,35 +716,37 @@ qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval) ...@@ -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. * qla2300_fw_dump() - Dumps binary data from the 2300 firmware.
* @vha: HA context * @vha: HA context
* @hardware_locked: Called with the hardware_lock
*/ */
void void
qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla2300_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt; uint32_t cnt;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
uint16_t __iomem *dmp_reg; uint16_t __iomem *dmp_reg;
unsigned long flags;
struct qla2300_fw_dump *fw; struct qla2300_fw_dump *fw;
void *nxt; void *nxt;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
flags = 0; lockdep_assert_held(&ha->hardware_lock);
#ifndef __CHECKER__
if (!hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
#endif
if (!ha->fw_dump) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd002, ql_log(ql_log_warn, vha, 0xd002,
"No buffer available for dump.\n"); "No buffer available for dump.\n");
goto qla2300_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
...@@ -752,7 +754,7 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -752,7 +754,7 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
"Firmware has been previously dumped (%p) " "Firmware has been previously dumped (%p) "
"-- ignoring request.\n", "-- ignoring request.\n",
ha->fw_dump); ha->fw_dump);
goto qla2300_fw_dump_failed; return;
} }
fw = &ha->fw_dump->isp.isp23; fw = &ha->fw_dump->isp.isp23;
qla2xxx_prep_dump(ha, ha->fw_dump); qla2xxx_prep_dump(ha, ha->fw_dump);
...@@ -876,48 +878,31 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -876,48 +878,31 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla2xxx_copy_queues(ha, nxt); qla2xxx_copy_queues(ha, nxt);
qla2xxx_dump_post_process(base_vha, rval); 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. * qla2100_fw_dump() - Dumps binary data from the 2100/2200 firmware.
* @vha: HA context * @vha: HA context
* @hardware_locked: Called with the hardware_lock
*/ */
void void
qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla2100_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt, timer; uint32_t cnt, timer;
uint16_t risc_address; uint16_t risc_address = 0;
uint16_t mb0, mb2; uint16_t mb0 = 0, mb2 = 0;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
uint16_t __iomem *dmp_reg; uint16_t __iomem *dmp_reg;
unsigned long flags;
struct qla2100_fw_dump *fw; struct qla2100_fw_dump *fw;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
risc_address = 0; lockdep_assert_held(&ha->hardware_lock);
mb0 = mb2 = 0;
flags = 0;
#ifndef __CHECKER__
if (!hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
#endif
if (!ha->fw_dump) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd004, ql_log(ql_log_warn, vha, 0xd004,
"No buffer available for dump.\n"); "No buffer available for dump.\n");
goto qla2100_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
...@@ -925,7 +910,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -925,7 +910,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
"Firmware has been previously dumped (%p) " "Firmware has been previously dumped (%p) "
"-- ignoring request.\n", "-- ignoring request.\n",
ha->fw_dump); ha->fw_dump);
goto qla2100_fw_dump_failed; return;
} }
fw = &ha->fw_dump->isp.isp21; fw = &ha->fw_dump->isp.isp21;
qla2xxx_prep_dump(ha, ha->fw_dump); qla2xxx_prep_dump(ha, ha->fw_dump);
...@@ -1080,18 +1065,10 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1080,18 +1065,10 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]); qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]);
qla2xxx_dump_post_process(base_vha, rval); 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 void
qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla24xx_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt; uint32_t cnt;
...@@ -1100,28 +1077,23 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1100,28 +1077,23 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
uint32_t __iomem *dmp_reg; uint32_t __iomem *dmp_reg;
uint32_t *iter_reg; uint32_t *iter_reg;
uint16_t __iomem *mbx_reg; uint16_t __iomem *mbx_reg;
unsigned long flags;
struct qla24xx_fw_dump *fw; struct qla24xx_fw_dump *fw;
void *nxt; void *nxt;
void *nxt_chain; void *nxt_chain;
uint32_t *last_chain = NULL; uint32_t *last_chain = NULL;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
lockdep_assert_held(&ha->hardware_lock);
if (IS_P3P_TYPE(ha)) if (IS_P3P_TYPE(ha))
return; return;
flags = 0;
ha->fw_dump_cap_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) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd006, ql_log(ql_log_warn, vha, 0xd006,
"No buffer available for dump.\n"); "No buffer available for dump.\n");
goto qla24xx_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
...@@ -1129,7 +1101,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1129,7 +1101,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
"Firmware has been previously dumped (%p) " "Firmware has been previously dumped (%p) "
"-- ignoring request.\n", "-- ignoring request.\n",
ha->fw_dump); ha->fw_dump);
goto qla24xx_fw_dump_failed; return;
} }
QLA_FW_STOPPED(ha); QLA_FW_STOPPED(ha);
fw = &ha->fw_dump->isp.isp24; fw = &ha->fw_dump->isp.isp24;
...@@ -1339,18 +1311,10 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1339,18 +1311,10 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla24xx_fw_dump_failed_0: qla24xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval); 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 void
qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla25xx_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt; uint32_t cnt;
...@@ -1359,24 +1323,19 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1359,24 +1323,19 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
uint32_t __iomem *dmp_reg; uint32_t __iomem *dmp_reg;
uint32_t *iter_reg; uint32_t *iter_reg;
uint16_t __iomem *mbx_reg; uint16_t __iomem *mbx_reg;
unsigned long flags;
struct qla25xx_fw_dump *fw; struct qla25xx_fw_dump *fw;
void *nxt, *nxt_chain; void *nxt, *nxt_chain;
uint32_t *last_chain = NULL; uint32_t *last_chain = NULL;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
flags = 0; lockdep_assert_held(&ha->hardware_lock);
ha->fw_dump_cap_flags = 0;
#ifndef __CHECKER__ ha->fw_dump_cap_flags = 0;
if (!hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
#endif
if (!ha->fw_dump) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd008, ql_log(ql_log_warn, vha, 0xd008,
"No buffer available for dump.\n"); "No buffer available for dump.\n");
goto qla25xx_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
...@@ -1384,7 +1343,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1384,7 +1343,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
"Firmware has been previously dumped (%p) " "Firmware has been previously dumped (%p) "
"-- ignoring request.\n", "-- ignoring request.\n",
ha->fw_dump); ha->fw_dump);
goto qla25xx_fw_dump_failed; return;
} }
QLA_FW_STOPPED(ha); QLA_FW_STOPPED(ha);
fw = &ha->fw_dump->isp.isp25; fw = &ha->fw_dump->isp.isp25;
...@@ -1665,18 +1624,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1665,18 +1624,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla25xx_fw_dump_failed_0: qla25xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval); 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 void
qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla81xx_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt; uint32_t cnt;
...@@ -1685,24 +1636,19 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1685,24 +1636,19 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
uint32_t __iomem *dmp_reg; uint32_t __iomem *dmp_reg;
uint32_t *iter_reg; uint32_t *iter_reg;
uint16_t __iomem *mbx_reg; uint16_t __iomem *mbx_reg;
unsigned long flags;
struct qla81xx_fw_dump *fw; struct qla81xx_fw_dump *fw;
void *nxt, *nxt_chain; void *nxt, *nxt_chain;
uint32_t *last_chain = NULL; uint32_t *last_chain = NULL;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
flags = 0; lockdep_assert_held(&ha->hardware_lock);
ha->fw_dump_cap_flags = 0;
#ifndef __CHECKER__ ha->fw_dump_cap_flags = 0;
if (!hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
#endif
if (!ha->fw_dump) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd00a, ql_log(ql_log_warn, vha, 0xd00a,
"No buffer available for dump.\n"); "No buffer available for dump.\n");
goto qla81xx_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
...@@ -1710,7 +1656,7 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1710,7 +1656,7 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
"Firmware has been previously dumped (%p) " "Firmware has been previously dumped (%p) "
"-- ignoring request.\n", "-- ignoring request.\n",
ha->fw_dump); ha->fw_dump);
goto qla81xx_fw_dump_failed; return;
} }
fw = &ha->fw_dump->isp.isp81; fw = &ha->fw_dump->isp.isp81;
qla2xxx_prep_dump(ha, ha->fw_dump); qla2xxx_prep_dump(ha, ha->fw_dump);
...@@ -1993,18 +1939,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1993,18 +1939,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla81xx_fw_dump_failed_0: qla81xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval); 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 void
qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) qla83xx_fw_dump(scsi_qla_host_t *vha)
{ {
int rval; int rval;
uint32_t cnt; uint32_t cnt;
...@@ -2013,31 +1951,26 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -2013,31 +1951,26 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
uint32_t __iomem *dmp_reg; uint32_t __iomem *dmp_reg;
uint32_t *iter_reg; uint32_t *iter_reg;
uint16_t __iomem *mbx_reg; uint16_t __iomem *mbx_reg;
unsigned long flags;
struct qla83xx_fw_dump *fw; struct qla83xx_fw_dump *fw;
void *nxt, *nxt_chain; void *nxt, *nxt_chain;
uint32_t *last_chain = NULL; uint32_t *last_chain = NULL;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
flags = 0; lockdep_assert_held(&ha->hardware_lock);
ha->fw_dump_cap_flags = 0;
#ifndef __CHECKER__ ha->fw_dump_cap_flags = 0;
if (!hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags);
#endif
if (!ha->fw_dump) { if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0xd00c, ql_log(ql_log_warn, vha, 0xd00c,
"No buffer available for dump!!!\n"); "No buffer available for dump!!!\n");
goto qla83xx_fw_dump_failed; return;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
ql_log(ql_log_warn, vha, 0xd00d, ql_log(ql_log_warn, vha, 0xd00d,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) -- ignoring "
"request...\n", ha->fw_dump); "request...\n", ha->fw_dump);
goto qla83xx_fw_dump_failed; return;
} }
QLA_FW_STOPPED(ha); QLA_FW_STOPPED(ha);
fw = &ha->fw_dump->isp.isp83; fw = &ha->fw_dump->isp.isp83;
...@@ -2507,14 +2440,6 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -2507,14 +2440,6 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla83xx_fw_dump_failed_0: qla83xx_fw_dump_failed_0:
qla2xxx_dump_post_process(base_vha, rval); 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
} }
/****************************************************************************/ /****************************************************************************/
......
...@@ -3222,7 +3222,7 @@ struct isp_operations { ...@@ -3222,7 +3222,7 @@ struct isp_operations {
int (*write_nvram)(struct scsi_qla_host *, void *, uint32_t, int (*write_nvram)(struct scsi_qla_host *, void *, uint32_t,
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); void (*mpi_fw_dump)(struct scsi_qla_host *, int);
int (*beacon_on) (struct scsi_qla_host *); int (*beacon_on) (struct scsi_qla_host *);
......
...@@ -637,15 +637,16 @@ extern int qla24xx_read_fcp_prio_cfg(scsi_qla_host_t *); ...@@ -637,15 +637,16 @@ extern int qla24xx_read_fcp_prio_cfg(scsi_qla_host_t *);
/* /*
* Global Function Prototypes in qla_dbg.c source file. * Global Function Prototypes in qla_dbg.c source file.
*/ */
extern void qla2100_fw_dump(scsi_qla_host_t *, int); void qla2xxx_dump_fw(scsi_qla_host_t *vha);
extern void qla2300_fw_dump(scsi_qla_host_t *, int); void qla2100_fw_dump(scsi_qla_host_t *vha);
extern void qla24xx_fw_dump(scsi_qla_host_t *, int); void qla2300_fw_dump(scsi_qla_host_t *vha);
extern void qla25xx_fw_dump(scsi_qla_host_t *, int); void qla24xx_fw_dump(scsi_qla_host_t *vha);
extern void qla81xx_fw_dump(scsi_qla_host_t *, int); void qla25xx_fw_dump(scsi_qla_host_t *vha);
extern void qla82xx_fw_dump(scsi_qla_host_t *, int); void qla81xx_fw_dump(scsi_qla_host_t *vha);
extern void qla8044_fw_dump(scsi_qla_host_t *, int); void qla82xx_fw_dump(scsi_qla_host_t *vha);
void qla8044_fw_dump(scsi_qla_host_t *vha);
extern void qla27xx_fwdump(scsi_qla_host_t *, int);
void qla27xx_fwdump(scsi_qla_host_t *vha);
extern void qla27xx_mpi_fwdump(scsi_qla_host_t *, int); extern void qla27xx_mpi_fwdump(scsi_qla_host_t *, int);
extern ulong qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *, void *); extern ulong qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *, void *);
extern int qla27xx_fwdt_template_valid(void *); extern int qla27xx_fwdt_template_valid(void *);
...@@ -873,7 +874,7 @@ extern int qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t, ...@@ -873,7 +874,7 @@ extern int qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t,
uint16_t *, uint16_t *); uint16_t *, uint16_t *);
/* 83xx related functions */ /* 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 */ /* Minidump related functions */
extern int qla82xx_md_get_template_size(scsi_qla_host_t *); extern int qla82xx_md_get_template_size(scsi_qla_host_t *);
......
...@@ -220,7 +220,7 @@ qla2100_intr_handler(int irq, void *dev_id) ...@@ -220,7 +220,7 @@ qla2100_intr_handler(int irq, void *dev_id)
WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
RD_REG_WORD(&reg->hccr); 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); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
break; break;
} else if ((RD_REG_WORD(&reg->istatus) & ISR_RISC_INT) == 0) } else if ((RD_REG_WORD(&reg->istatus) & ISR_RISC_INT) == 0)
...@@ -351,7 +351,7 @@ qla2300_intr_handler(int irq, void *dev_id) ...@@ -351,7 +351,7 @@ qla2300_intr_handler(int irq, void *dev_id)
WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC); WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
RD_REG_WORD(&reg->hccr); 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); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
break; break;
} else if ((stat & HSR_RISC_INT) == 0) } else if ((stat & HSR_RISC_INT) == 0)
...@@ -777,7 +777,7 @@ qla27xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb) ...@@ -777,7 +777,7 @@ qla27xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb)
"MPI Heartbeat stop. FW dump needed\n"); "MPI Heartbeat stop. FW dump needed\n");
if (ql2xfulldump_on_mpifail) { if (ql2xfulldump_on_mpifail) {
ha->isp_ops->fw_dump(vha, 1); ha->isp_ops->fw_dump(vha);
reset_isp_needed = 1; reset_isp_needed = 1;
} }
...@@ -908,7 +908,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -908,7 +908,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
if ((IS_QLA27XX(ha) || IS_QLA28XX(ha)) && if ((IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
RD_REG_WORD(&reg24->mailbox7) & BIT_8) RD_REG_WORD(&reg24->mailbox7) & BIT_8)
ha->isp_ops->mpi_fw_dump(vha, 1); 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; ha->flags.fw_init_done = 0;
QLA_FW_STOPPED(ha); QLA_FW_STOPPED(ha);
...@@ -3473,7 +3473,7 @@ qla24xx_intr_handler(int irq, void *dev_id) ...@@ -3473,7 +3473,7 @@ qla24xx_intr_handler(int irq, void *dev_id)
qla2xxx_check_risc_status(vha); 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); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
break; break;
} else if ((stat & HSRX_RISC_INT) == 0) } else if ((stat & HSRX_RISC_INT) == 0)
...@@ -3602,7 +3602,7 @@ qla24xx_msix_default(int irq, void *dev_id) ...@@ -3602,7 +3602,7 @@ qla24xx_msix_default(int irq, void *dev_id)
qla2xxx_check_risc_status(vha); 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); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
break; break;
} else if ((stat & HSRX_RISC_INT) == 0) } else if ((stat & HSRX_RISC_INT) == 0)
......
...@@ -462,7 +462,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) ...@@ -462,7 +462,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
* a dump * a dump
*/ */
if (mcp->mb[0] != MBC_GEN_SYSTEM_ERROR) if (mcp->mb[0] != MBC_GEN_SYSTEM_ERROR)
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
rval = QLA_FUNCTION_TIMEOUT; rval = QLA_FUNCTION_TIMEOUT;
} }
} }
...@@ -6213,7 +6213,7 @@ qla83xx_restart_nic_firmware(scsi_qla_host_t *vha) ...@@ -6213,7 +6213,7 @@ qla83xx_restart_nic_firmware(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_mbx, vha, 0x1144, ql_dbg(ql_dbg_mbx, vha, 0x1144,
"Failed=%x mb[0]=%x mb[1]=%x.\n", "Failed=%x mb[0]=%x mb[1]=%x.\n",
rval, mcp->mb[0], mcp->mb[1]); rval, mcp->mb[0], mcp->mb[1]);
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
} else { } else {
ql_dbg(ql_dbg_mbx, vha, 0x1145, "Done %s.\n", __func__); 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, ...@@ -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", "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], rval, mcp->mb[0], mcp->mb[1], mcp->mb[2], mcp->mb[3],
mcp->mb[4]); mcp->mb[4]);
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
} else { } else {
if (subcode & BIT_5) if (subcode & BIT_5)
*sector_size = mcp->mb[1]; *sector_size = mcp->mb[1];
......
...@@ -4514,7 +4514,7 @@ qla82xx_beacon_off(struct scsi_qla_host *vha) ...@@ -4514,7 +4514,7 @@ qla82xx_beacon_off(struct scsi_qla_host *vha)
} }
void 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; struct qla_hw_data *ha = vha->hw;
......
...@@ -4070,7 +4070,7 @@ qla8044_abort_isp(scsi_qla_host_t *vha) ...@@ -4070,7 +4070,7 @@ qla8044_abort_isp(scsi_qla_host_t *vha)
} }
void 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; struct qla_hw_data *ha = vha->hw;
......
...@@ -7575,7 +7575,7 @@ qla2xxx_pci_mmio_enabled(struct pci_dev *pdev) ...@@ -7575,7 +7575,7 @@ qla2xxx_pci_mmio_enabled(struct pci_dev *pdev)
if (risc_paused) { if (risc_paused) {
ql_log(ql_log_info, base_vha, 0x9003, ql_log(ql_log_info, base_vha, 0x9003,
"RISC paused -- mmio_enabled, Dumping firmware.\n"); "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; return PCI_ERS_RESULT_NEED_RESET;
} else } else
......
...@@ -5670,9 +5670,9 @@ static int qlt_chk_unresolv_exchg(struct scsi_qla_host *vha, ...@@ -5670,9 +5670,9 @@ static int qlt_chk_unresolv_exchg(struct scsi_qla_host *vha,
vha, 0xffff, (uint8_t *)entry, sizeof(*entry)); vha, 0xffff, (uint8_t *)entry, sizeof(*entry));
if (qpair == ha->base_qpair) if (qpair == ha->base_qpair)
ha->isp_ops->fw_dump(vha, 1); ha->isp_ops->fw_dump(vha);
else else
ha->isp_ops->fw_dump(vha, 0); qla2xxx_dump_fw(vha);
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
qla2xxx_wake_dpc(vha); qla2xxx_wake_dpc(vha);
......
...@@ -1081,14 +1081,9 @@ qla27xx_mpi_fwdump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1081,14 +1081,9 @@ qla27xx_mpi_fwdump(scsi_qla_host_t *vha, int hardware_locked)
} }
void void
qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) qla27xx_fwdump(scsi_qla_host_t *vha)
{ {
ulong flags = 0; lockdep_assert_held(&vha->hw->hardware_lock);
#ifndef __CHECKER__
if (!hardware_locked)
spin_lock_irqsave(&vha->hw->hardware_lock, flags);
#endif
if (!vha->hw->fw_dump) { if (!vha->hw->fw_dump) {
ql_log(ql_log_warn, vha, 0xd01e, "-> fwdump no buffer\n"); 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) ...@@ -1105,11 +1100,11 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)
if (!fwdt->template) { if (!fwdt->template) {
ql_log(ql_log_warn, vha, 0xd012, ql_log(ql_log_warn, vha, 0xd012,
"-> fwdt0 no template\n"); "-> fwdt0 no template\n");
goto bailout; return;
} }
len = qla27xx_execute_fwdt_template(vha, fwdt->template, buf); len = qla27xx_execute_fwdt_template(vha, fwdt->template, buf);
if (len == 0) { if (len == 0) {
goto bailout; return;
} else if (len != fwdt->dump_size) { } else if (len != fwdt->dump_size) {
ql_log(ql_log_warn, vha, 0xd013, ql_log(ql_log_warn, vha, 0xd013,
"-> fwdt0 fwdump residual=%+ld\n", "-> fwdt0 fwdump residual=%+ld\n",
...@@ -1124,10 +1119,4 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -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); vha->host_no, vha->hw->fw_dump, vha->hw->fw_dump_cap_flags);
qla2x00_post_uevent_work(vha, QLA_UEVENT_CODE_FW_DUMP); 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
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment