]> git.ipfire.org Git - people/arne_f/kernel.git/commit
ibmvnic: avoid calling napi_disable() twice
authorLijun Pan <lijunp213@gmail.com>
Wed, 14 Apr 2021 07:46:14 +0000 (02:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 10:56:17 +0000 (12:56 +0200)
commitc6acd7d19124c5c8dc765079d19024ea47f21fbd
tree73ad6c86283fb15931ea4bb1c89056dcc6bc58a5
parent2bc14f5eca106247fa3761b9a17714973b30381f
ibmvnic: avoid calling napi_disable() twice

commit 0775ebc4cf8554bdcd2c212669a0868ab68df5c0 upstream.

__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: bfc32f297337 ("ibmvnic: Move resource initialization to its own routine")
Suggested-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: Lijun Pan <lijunp213@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/ibm/ibmvnic.c