diff options
author | 2019-08-23 02:52:40 -0700 | |
---|---|---|
committer | 2019-08-29 18:51:19 -0400 | |
commit | 0482262646e4e9e089c4e75f336244c5eaf360e1 (patch) | |
tree | 368f4cb1503a1989637bf41c53afd0d4b08b676d /drivers/scsi/qedf | |
parent | scsi: qedf: Initiator fails to re-login to switch after link down (diff) | |
download | linux-0482262646e4e9e089c4e75f336244c5eaf360e1.tar.gz linux-0482262646e4e9e089c4e75f336244c5eaf360e1.tar.bz2 linux-0482262646e4e9e089c4e75f336244c5eaf360e1.zip |
scsi: qedf: Check for module unloading bit before processing link update AEN
Prevent race where we're removing the module and we get link update
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r-- | drivers/scsi/qedf/qedf_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 50b1fa8740da..ab9a932089ae 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -533,6 +533,16 @@ static void qedf_link_update(void *dev, struct qed_link_output *link) { struct qedf_ctx *qedf = (struct qedf_ctx *)dev; + /* + * Prevent race where we're removing the module and we get link update + * for qed. + */ + if (test_bit(QEDF_UNLOADING, &qedf->flags)) { + QEDF_ERR(&qedf->dbg_ctx, + "Ignore link update, driver getting unload.\n"); + return; + } + if (link->link_up) { if (atomic_read(&qedf->link_state) == QEDF_LINK_UP) { QEDF_INFO((&qedf->dbg_ctx), QEDF_LOG_DISC, |