Skip to content
Commit 0775ebc4 authored by Lijun Pan's avatar Lijun Pan Committed by David S. Miller
Browse files

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: bfc32f29 ("ibmvnic: Move resource initialization to its own routine")
Suggested-by: default avatarThomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: default avatarLijun Pan <lijunp213@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 453a7789
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment