Skip to content

Commit

Permalink
ibmvnic: Fix reset return from closed state
Browse files Browse the repository at this point in the history
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 <jallen@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John Allen authored and David S. Miller committed Mar 14, 2018
1 parent ced6823 commit e676d81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e676d81

Please sign in to comment.