Skip to contentSkip to conversation

ibmvnic: Fix error recovery on login failure

PATCH Applied John Allen 2 participants 2 messages Jul 16, 2018

Subsystems (4)
lore
Share & tools
lore

John Allen

author
#0 lore raw

PATCH 1/1 ibmvnic: Fix error recovery on login failure

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.

---

drivers/net/ethernet/ibm/ibmvnic.c +2 -2
index d0e196b..c1e23bb 100644
@@ -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 ||
maintainer Applied
#1 lore raw

From: John Allen <[email protected]>
Date: Mon, 16 Jul 2018 10:29:30 -0500

Quoted 11 lines

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.

Applied, thanks.