提交 dcd7ed45 编写于 作者: M Martin Wilck 提交者: Yang Yingliang

scsi: qla2xxx: check UNLOADING before posting async work

commit 5a263892 upstream.

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: 45235022 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Acked-by: NArun Easi <aeasi@marvell.com>
Reviewed-by: NHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: NMartin Wilck <mwilck@suse.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 140375ba
...@@ -4645,6 +4645,9 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) ...@@ -4645,6 +4645,9 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type)
struct qla_work_evt *e; struct qla_work_evt *e;
uint8_t bail; uint8_t bail;
if (test_bit(UNLOADING, &vha->dpc_flags))
return NULL;
QLA_VHA_MARK_BUSY(vha, bail); QLA_VHA_MARK_BUSY(vha, bail);
if (bail) if (bail)
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册