diff options
author | Thomas Falcon <tlfalcon@linux.vnet.ibm.com> | 2017-06-15 07:50:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-15 21:29:00 +0300 |
commit | 21ecba6c48f903781d844b62854bedd8137df470 (patch) | |
tree | fb0e1abc90a1e1bd09cab91a0781e4c60e4e1232 | |
parent | 1cf9cc72bd7024af69419b5adee42c39ad4caf6f (diff) | |
download | linux-21ecba6c48f903781d844b62854bedd8137df470.tar.xz |
ibmvnic: Exit polling routine correctly during adapter reset
This patch fixes a bug where, in the case of a device reset,
the polling routine will never complete, causing napi_disable
to sleep indefinitely when attempting to close the device.
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index ebe443fe51db..9923b9fa0c74 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1505,9 +1505,6 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) int scrq_num = (int)(napi - adapter->napi); int frames_processed = 0; - if (adapter->resetting) - return 0; - restart_poll: while (frames_processed < budget) { struct sk_buff *skb; @@ -1517,6 +1514,12 @@ restart_poll: u16 offset; u8 flags = 0; + if (unlikely(adapter->resetting)) { + enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); + napi_complete_done(napi, frames_processed); + return frames_processed; + } + if (!pending_scrq(adapter, adapter->rx_scrq[scrq_num])) break; next = ibmvnic_next_scrq(adapter, adapter->rx_scrq[scrq_num]); |