netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ibmvnic: Fix error recovery on login failure
@ 2018-07-16 15:29 John Allen
  2018-07-16 21:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: John Allen @ 2018-07-16 15:29 UTC (permalink / raw)
  To: tlfalcon, netdev; +Cc: John Allen

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>
---
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 ||

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ibmvnic: Fix error recovery on login failure
  2018-07-16 15:29 [PATCH net] ibmvnic: Fix error recovery on login failure John Allen
@ 2018-07-16 21:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-16 21:40 UTC (permalink / raw)
  To: jallen; +Cc: tlfalcon, netdev, jallen

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-16 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-16 15:29 [PATCH net] ibmvnic: Fix error recovery on login failure John Allen
2018-07-16 21:40 ` David Miller

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).