Skip to content

Commit 5a26389

Browse files
mwilckmartinkpetersen
authored andcommitted
scsi: qla2xxx: check UNLOADING before posting async work
qlt_free_session_done() tries to post async PRLO / LOGO, and waits for the completion of these async commands. If UNLOADING is set, this is doomed to timeout, because the async logout command will never complete. The only way to avoid waiting pointlessly is to fail posting these commands in the first place if the driver is in UNLOADING state. In general, posting any command should be avoided when the driver is UNLOADING. With this patch, "rmmod qla2xxx" completes without noticeable delay. Link: https://lore.kernel.org/r/[email protected] Fixes: 4523502 ("scsi: qla2xxx: Fix driver unload by shutting down chip") Acked-by: Arun Easi <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin Wilck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 856e152 commit 5a26389

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4862,6 +4862,9 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type)
48624862
struct qla_work_evt *e;
48634863
uint8_t bail;
48644864

4865+
if (test_bit(UNLOADING, &vha->dpc_flags))
4866+
return NULL;
4867+
48654868
QLA_VHA_MARK_BUSY(vha, bail);
48664869
if (bail)
48674870
return NULL;

0 commit comments

Comments
 (0)