All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saurav Kashyap <skashyap@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <gbasrur@marvell.com>, <svernekar@marvell.com>,
	<linux-scsi@vger.kernel.org>
Subject: [PATCH 10/14] qedf: Check for module unloading bit before processing link update AEN.
Date: Fri, 23 Aug 2019 02:52:40 -0700	[thread overview]
Message-ID: <20190823095244.7830-11-skashyap@marvell.com> (raw)
In-Reply-To: <20190823095244.7830-1-skashyap@marvell.com>

- Prevent race where we're removing the module and we get link update

Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
---
 drivers/scsi/qedf/qedf_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 50b1fa8..ab9a932 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,
-- 
1.8.3.1


  parent reply	other threads:[~2019-08-23  9:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  9:52 [PATCH 00/14] qedf: Miscellaneous fixes Saurav Kashyap
2019-08-23  9:52 ` [PATCH 01/14] qedf: Print message during bailout conditions Saurav Kashyap
2019-08-23  9:52 ` [PATCH 02/14] qedf: Stop sending fipvlan request on unload Saurav Kashyap
2019-08-23  9:52 ` [PATCH 03/14] qedf: Fix crash during sg_reset Saurav Kashyap
2019-08-23  9:52 ` [PATCH 04/14] qedf: Update module description string Saurav Kashyap
2019-08-23  9:52 ` [PATCH 05/14] qedf: Add shutdown callback handler Saurav Kashyap
2019-08-23  9:52 ` [PATCH 06/14] qedf: Interpret supported caps value correctly Saurav Kashyap
2019-08-23  9:52 ` [PATCH 07/14] qedf: Add support for 20 Gbps speed Saurav Kashyap
2019-08-23  9:52 ` [PATCH 08/14] qedf: Add debug information for unsolicited processing Saurav Kashyap
2019-08-23  9:52 ` [PATCH 09/14] qedf: Initiator fails to re-login to switch after link down Saurav Kashyap
2019-08-23  9:52 ` Saurav Kashyap [this message]
2019-08-23  9:52 ` [PATCH 11/14] qedf: Decrease the LL2 MTU size to 2500 Saurav Kashyap
2019-08-23  9:52 ` [PATCH 12/14] qedf: Use discovery list to traverse rports Saurav Kashyap
2019-08-23  9:52 ` [PATCH 13/14] qedf: Fix race betwen fipvlan request and response path Saurav Kashyap
2019-08-23  9:52 ` [PATCH 14/14] qedf: Update the version to 8.42.3.0 Saurav Kashyap
2019-08-29 22:52 ` [PATCH 00/14] qedf: Miscellaneous fixes Martin K. Petersen
2019-08-30  6:43   ` Saurav Kashyap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190823095244.7830-11-skashyap@marvell.com \
    --to=skashyap@marvell.com \
    --cc=gbasrur@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=svernekar@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.