Skip to content

Commit e676d81

Browse files
jallen93davem330
authored andcommitted
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 <jallen@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ced6823 commit e676d81

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,12 +1739,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
17391739
rc = reset_rx_pools(adapter);
17401740
if (rc)
17411741
return rc;
1742-
1743-
if (reset_state == VNIC_CLOSED)
1744-
return 0;
17451742
}
17461743
}
17471744

1745+
adapter->state = VNIC_CLOSED;
1746+
1747+
if (reset_state == VNIC_CLOSED)
1748+
return 0;
1749+
17481750
rc = __ibmvnic_open(netdev);
17491751
if (rc) {
17501752
if (list_empty(&adapter->rwi_list))

0 commit comments

Comments
 (0)