Skip to content

Commit 51071f0

Browse files
Saurav Kashyapmartinkpetersen
authored andcommitted
scsi: qedf: Don't process stag work during unload and recovery
Stag work can cause issues during unload and recovery, hence don't process it. Signed-off-by: Saurav Kashyap <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 9fad9d5 commit 51071f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/scsi/qedf/qedf_main.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3997,6 +3997,22 @@ void qedf_stag_change_work(struct work_struct *work)
39973997
struct qedf_ctx *qedf =
39983998
container_of(work, struct qedf_ctx, stag_work.work);
39993999

4000+
if (!qedf) {
4001+
QEDF_ERR(&qedf->dbg_ctx, "qedf is NULL");
4002+
return;
4003+
}
4004+
4005+
if (test_bit(QEDF_IN_RECOVERY, &qedf->flags)) {
4006+
QEDF_ERR(&qedf->dbg_ctx,
4007+
"Already is in recovery, hence not calling software context reset.\n");
4008+
return;
4009+
}
4010+
4011+
if (test_bit(QEDF_UNLOADING, &qedf->flags)) {
4012+
QEDF_ERR(&qedf->dbg_ctx, "Driver unloading\n");
4013+
return;
4014+
}
4015+
40004016
printk_ratelimited("[%s]:[%s:%d]:%d: Performing software context reset.",
40014017
dev_name(&qedf->pdev->dev), __func__, __LINE__,
40024018
qedf->dbg_ctx.host_no);

0 commit comments

Comments
 (0)