On 11/29/19 9:26 PM, Martin Wilck wrote: > From: Martin Wilck <mwilck@xxxxxxxx> > > Since 45235022da99, the firmware is shut down early in the controller > shutdown process. This causes commands sent to the firmware (such as LOGO) > to hang forever. Eventually one or more timeouts will be triggered. > Move the stopping of the firmware until after sessions have terminated. > > Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip") > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> > --- > drivers/scsi/qla2xxx/qla_os.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c > index 43d0aa0..0cc127d 100644 > --- a/drivers/scsi/qla2xxx/qla_os.c > +++ b/drivers/scsi/qla2xxx/qla_os.c > @@ -3710,6 +3710,16 @@ qla2x00_remove_one(struct pci_dev *pdev) > } > qla2x00_wait_for_hba_ready(base_vha); > > + qla2x00_wait_for_sess_deletion(base_vha); > + > + /* > + * if UNLOAD flag is already set, then continue unload, > + * where it was set first. > + */ > + if (test_bit(UNLOADING, &base_vha->dpc_flags)) > + return; > + > + set_bit(UNLOADING, &base_vha->dpc_flags); > if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) || > IS_QLA28XX(ha)) { > if (ha->flags.fw_started) test_and_set_bit(), maybe? Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer