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>
int scrq_num = (int)(napi - adapter->napi);
int frames_processed = 0;
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;
restart_poll:
while (frames_processed < budget) {
struct sk_buff *skb;
u16 offset;
u8 flags = 0;
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]);
if (!pending_scrq(adapter, adapter->rx_scrq[scrq_num]))
break;
next = ibmvnic_next_scrq(adapter, adapter->rx_scrq[scrq_num]);