aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Allen <[email protected]>2018-03-14 10:41:29 -0500
committerDavid S. Miller <[email protected]>2018-03-14 13:08:14 -0400
commite676d81c8990f511d60698a1a8abaa438b3f9d3d (patch)
tree10f952c7f06fd745b47d9fd20c7942d018118686
parentced68234b6a244355aeab07c2681bc49f695eaed (diff)
ibmvnic: Fix reset return from closed state
The case in which we handle a reset from the state where the device is closed seems to be bugged for all types of reset. For most types of reset we currently exit the reset routine correctly, but don't set the state to indicate that we are back in the "closed" state. For some specific cases, we don't exit the reset routine at all and resetting will cause a closed device to be opened. This patch fixes the problem by unconditionally checking the reset_state and correctly setting the adapter state before returning. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 6ff43d7e5a72..9c7d19c926f9 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1739,12 +1739,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
rc = reset_rx_pools(adapter);
if (rc)
return rc;
-
- if (reset_state == VNIC_CLOSED)
- return 0;
}
}
+ adapter->state = VNIC_CLOSED;
+
+ if (reset_state == VNIC_CLOSED)
+ return 0;
+
rc = __ibmvnic_open(netdev);
if (rc) {
if (list_empty(&adapter->rwi_list))