diff mbox series

[net] ibmvnic: Fix error recovery on login failure

Message ID 20180716152930.22255-1-jallen@linux.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] ibmvnic: Fix error recovery on login failure | expand

Commit Message

John Allen July 16, 2018, 3:29 p.m. UTC
Testing has uncovered a failure case that is not handled properly. In the
event that a login fails and we are not able to recover on the spot, we
return 0 from do_reset, preventing any error recovery code from being
triggered.  Additionally, the state is set to "probed" meaning that when we
are able to trigger the error recovery, the driver always comes up in the
probed state. To handle the case properly, we need to return a failure code
here and set the adapter state to the state that we entered the reset in
indicating the state that we would like to come out of the recovery reset
in.

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
---

Comments

David Miller July 16, 2018, 9:40 p.m. UTC | #1
From: John Allen <jallen@linux.ibm.com>
Date: Mon, 16 Jul 2018 10:29:30 -0500

> Testing has uncovered a failure case that is not handled properly. In the
> event that a login fails and we are not able to recover on the spot, we
> return 0 from do_reset, preventing any error recovery code from being
> triggered.  Additionally, the state is set to "probed" meaning that when we
> are able to trigger the error recovery, the driver always comes up in the
> probed state. To handle the case properly, we need to return a failure code
> here and set the adapter state to the state that we entered the reset in
> indicating the state that we would like to come out of the recovery reset
> in.
> 
> Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index d0e196b..c1e23bb 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1825,8 +1825,8 @@  static int do_reset(struct ibmvnic_adapter *adapter,
 
 		rc = ibmvnic_login(netdev);
 		if (rc) {
-			adapter->state = VNIC_PROBED;
-			return 0;
+			adapter->state = reset_state;
+			return rc;
 		}
 
 		if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM ||