From: Martin Wilck <mwilck@xxxxxxxx> After commit 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip"), it is possible that FC commands are scheduled after the adapter firmware has been shut down. IO sent to the firmware in this situation hangs indefinitely. Avoid this for the LOGO code path that is typically taken when adapters are shut down. Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip") Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- drivers/scsi/qla2xxx/qla_mbx.c | 3 +++ drivers/scsi/qla2xxx/qla_os.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index bb6811b..e129df4 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -2643,6 +2643,9 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x106d, "Entered %s.\n", __func__); + if (!ha->flags.fw_started) + return QLA_FUNCTION_FAILED; + lg = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma); if (lg == NULL) { ql_log(ql_log_warn, vha, 0x106e, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 2450ba9..43d0aa0 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4891,6 +4891,9 @@ qla2x00_post_work(struct scsi_qla_host *vha, struct qla_work_evt *e) unsigned long flags; bool q = false; + if (!vha->hw->flags.fw_started) + return QLA_FUNCTION_FAILED; + spin_lock_irqsave(&vha->work_lock, flags); list_add_tail(&e->list, &vha->work_list); -- 2.24.0