]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: qla2xxx: check UNLOADING before posting async work
authorMartin Wilck <mwilck@suse.com>
Tue, 21 Apr 2020 20:46:21 +0000 (22:46 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Apr 2020 03:53:34 +0000 (23:53 -0400)
commita59df914e12521c6cc1dff964fde019324f20ab5
treecc90ddd5ab714690ee436ca4d5bdac276a5da20a
parentc4c93969c253aaacca16a6ffdb2f0286aa7d9259
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/20200421204621.19228-3-mwilck@suse.com
Fixes: 53925c151d15 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Acked-by: Arun Easi <aeasi@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c