Skip to content

Commit 0775ebc

Browse files
Lijun Pandavem330
authored andcommitted
ibmvnic: avoid calling napi_disable() twice
__ibmvnic_open calls napi_disable without checking whether NAPI polling has already been disabled or not. This could cause napi_disable being called twice, which could generate deadlock. For example, the first napi_disable will spin until NAPI_STATE_SCHED is cleared by napi_complete_done, then set it again. When napi_disable is called the second time, it will loop infinitely because no dev->poll will be running to clear NAPI_STATE_SCHED. To prevent above scenario from happening, call ibmvnic_napi_disable() which checks if napi is disabled or not before calling napi_disable. Fixes: bfc32f2 ("ibmvnic: Move resource initialization to its own routine") Suggested-by: Thomas Falcon <[email protected]> Signed-off-by: Lijun Pan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 453a778 commit 0775ebc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,7 @@ static int __ibmvnic_open(struct net_device *netdev)
11491149

11501150
rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP);
11511151
if (rc) {
1152-
for (i = 0; i < adapter->req_rx_queues; i++)
1153-
napi_disable(&adapter->napi[i]);
1152+
ibmvnic_napi_disable(adapter);
11541153
release_resources(adapter);
11551154
return rc;
11561155
}

0 commit comments

Comments
 (0)