diff options
author | Saurav Kashyap <skashyap@marvell.com> | 2024-05-15 14:40:59 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-25 09:50:40 +0200 |
commit | 80c971d99c048ba93ce366ba965fbc0b7aa5b915 (patch) | |
tree | cfed6a3d0b5d8c61f306a6d98399f2d081f4ed09 /drivers/scsi | |
parent | 74fac04ec2f4e413ef6b0c7800166f6438622183 (diff) | |
download | linux-rpi-80c971d99c048ba93ce366ba965fbc0b7aa5b915.tar.gz linux-rpi-80c971d99c048ba93ce366ba965fbc0b7aa5b915.tar.bz2 linux-rpi-80c971d99c048ba93ce366ba965fbc0b7aa5b915.zip |
scsi: qedf: Don't process stag work during unload and recovery
[ Upstream commit 51071f0831ea975fc045526dd7e17efe669dc6e1 ]
Stag work can cause issues during unload and recovery, hence don't process
it.
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20240515091101.18754-2-skashyap@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qedf/qedf_main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 91f3f1d7098e..c27e27cff079 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3996,6 +3996,22 @@ void qedf_stag_change_work(struct work_struct *work) struct qedf_ctx *qedf = container_of(work, struct qedf_ctx, stag_work.work); + if (!qedf) { + QEDF_ERR(&qedf->dbg_ctx, "qedf is NULL"); + return; + } + + if (test_bit(QEDF_IN_RECOVERY, &qedf->flags)) { + QEDF_ERR(&qedf->dbg_ctx, + "Already is in recovery, hence not calling software context reset.\n"); + return; + } + + if (test_bit(QEDF_UNLOADING, &qedf->flags)) { + QEDF_ERR(&qedf->dbg_ctx, "Driver unloading\n"); + return; + } + printk_ratelimited("[%s]:[%s:%d]:%d: Performing software context reset.", dev_name(&qedf->pdev->dev), __func__, __LINE__, qedf->dbg_ctx.host_no); |