netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lijun Pan <ljp@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: sukadev@linux.ibm.com, drt@linux.ibm.com, Lijun Pan <ljp@linux.ibm.com>
Subject: [PATCH net v2 3/3] ibmvnic: enhance resetting status check during module exit
Date: Mon, 23 Nov 2020 13:35:47 -0600	[thread overview]
Message-ID: <20201123193547.57225-4-ljp@linux.ibm.com> (raw)
In-Reply-To: <20201123193547.57225-1-ljp@linux.ibm.com>

Based on the discussion with Sukadev Bhattiprolu and Dany Madden,
we believe that checking adapter->resetting bit is preferred
since RESETTING state flag is not as strict as resetting bit.
RESETTING state flag is removed since it is verbose now.

Fixes: 7d7195a026ba ("ibmvnic: Do not process device remove during device reset")
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
v2: add fix tag

 drivers/net/ethernet/ibm/ibmvnic.c | 3 +--
 drivers/net/ethernet/ibm/ibmvnic.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 91b7a383debf..5cb4cfabe2de 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2251,7 +2251,6 @@ static void __ibmvnic_reset(struct work_struct *work)
 
 		if (!saved_state) {
 			reset_state = adapter->state;
-			adapter->state = VNIC_RESETTING;
 			saved_state = true;
 		}
 		spin_unlock_irqrestore(&adapter->state_lock, flags);
@@ -5357,7 +5356,7 @@ static int ibmvnic_remove(struct vio_dev *dev)
 	unsigned long flags;
 
 	spin_lock_irqsave(&adapter->state_lock, flags);
-	if (adapter->state == VNIC_RESETTING) {
+	if (test_bit(0, &adapter->resetting)) {
 		spin_unlock_irqrestore(&adapter->state_lock, flags);
 		return -EBUSY;
 	}
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index d15866cbc2a6..950f439bed32 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -943,8 +943,7 @@ enum vnic_state {VNIC_PROBING = 1,
 		 VNIC_CLOSING,
 		 VNIC_CLOSED,
 		 VNIC_REMOVING,
-		 VNIC_REMOVED,
-		 VNIC_RESETTING};
+		 VNIC_REMOVED};
 
 enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
 			   VNIC_RESET_MOBILITY,
-- 
2.23.0


  parent reply	other threads:[~2020-11-23 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 19:35 [PATCH net v2 0/3] ibmvnic: null pointer dereference Lijun Pan
2020-11-23 19:35 ` [PATCH net v2 1/3] ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues Lijun Pan
2020-11-23 19:35 ` [PATCH net v2 2/3] ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq Lijun Pan
2020-11-23 19:35 ` Lijun Pan [this message]
2020-11-25  0:40 ` [PATCH net v2 0/3] ibmvnic: null pointer dereference patchwork-bot+netdevbpf

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=20201123193547.57225-4-ljp@linux.ibm.com \
    --to=ljp@linux.ibm.com \
    --cc=drt@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=sukadev@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).