All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: Dany Madden <drt@linux.ibm.com>, Lijun Pan <ljp@linux.ibm.com>,
	sukadev@linux.ibm.com
Subject: [PATCH 4/7] ibmvnic: switch order of checks in ibmvnic_reset
Date: Thu,  7 Jan 2021 23:12:33 -0800	[thread overview]
Message-ID: <20210108071236.123769-5-sukadev@linux.ibm.com> (raw)
In-Reply-To: <20210108071236.123769-1-sukadev@linux.ibm.com>

We check separately for REMOVING and PROBING in ibmvnic_reset().
Switch the order of checks to facilitate better locking  when
checking for REMOVING/REMOVED state.

Fixes: 6a2fb0e99f9c ("ibmvnic: driver initialization for kdump/kexec")

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index d1c2aaed1478..ad551418ac63 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2437,6 +2437,12 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 	struct net_device *netdev = adapter->netdev;
 	int ret;
 
+	if (adapter->state == VNIC_PROBING) {
+		netdev_warn(netdev, "Adapter reset during probe\n");
+		ret = adapter->init_done_rc = EAGAIN;
+		goto err;
+	}
+
 	/*
 	 * If failover is pending don't schedule any other reset.
 	 * Instead let the failover complete. If there is already a
@@ -2451,12 +2457,6 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 		goto err;
 	}
 
-	if (adapter->state == VNIC_PROBING) {
-		netdev_warn(netdev, "Adapter reset during probe\n");
-		ret = adapter->init_done_rc = EAGAIN;
-		goto err;
-	}
-
 	/* If we just received a transport event, clear
 	 * any pending resets and add just this reset.
 	 */
-- 
2.26.2


  parent reply	other threads:[~2021-01-08  7:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  7:12 [PATCH 0/7] ibmvnic: Use more consistent locking Sukadev Bhattiprolu
2021-01-08  7:12 ` [PATCH 1/7] ibmvnic: restore state in change-param reset Sukadev Bhattiprolu
2021-01-08  7:12 ` [PATCH 2/7] ibmvnic: update reset function prototypes Sukadev Bhattiprolu
2021-01-10  3:37   ` Jakub Kicinski
2021-01-11  3:12     ` Sukadev Bhattiprolu
2021-01-11 19:32       ` Jakub Kicinski
2021-01-11 19:57         ` Sukadev Bhattiprolu
2021-01-08  7:12 ` [PATCH 3/7] ibmvnic: avoid allocating rwi entries Sukadev Bhattiprolu
2021-01-08  7:12 ` Sukadev Bhattiprolu [this message]
2021-01-08  7:12 ` [PATCH 5/7] ibmvnic: use a lock to serialize remove/reset Sukadev Bhattiprolu
2021-01-10  3:41   ` Jakub Kicinski
2021-01-11  3:52     ` Sukadev Bhattiprolu
2021-01-11 19:43       ` Jakub Kicinski
2021-01-11 20:15         ` Sukadev Bhattiprolu
2021-01-08  7:12 ` [PATCH 6/7] ibmvnic: check adapter->state under state_lock Sukadev Bhattiprolu
2021-01-08  7:12 ` [PATCH 7/7] ibmvnic: add comments about adapter->state_lock Sukadev Bhattiprolu

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=20210108071236.123769-5-sukadev@linux.ibm.com \
    --to=sukadev@linux.ibm.com \
    --cc=drt@linux.ibm.com \
    --cc=ljp@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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.