]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net: usbnet: fix softirq storm on suspend
authorBjørn Mork <bjorn@mork.no>
Sun, 2 Sep 2012 22:26:18 +0000 (22:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 17:39:22 +0000 (10:39 -0700)
commit5a899124734999d85d0b23371a367d92cfb82ee2
treecf5cf0439b63ff3e814b51802702e50563630189
parent623678ee75bbe765b6688ff05f0a435e959fa016
net: usbnet: fix softirq storm on suspend

commit 85e87870fa18ec9f5df98e2d3b48f3699560a570 upstream.

Suspending an open usbnet device results in constant
rescheduling of usbnet_bh.

commit 65841fd5 "usbnet: handle remote wakeup asap"
refactored the usbnet_bh code to allow sharing the
urb allocate and submit code with usbnet_resume. In
this process, a test for, and immediate return on,
ENOLINK from rx_submit was unintentionally dropped.

The rx queue will not grow if rx_submit fails,
making usbnet_bh reschedule itself.  This results
in a softirq storm if the error is persistent.
rx_submit translates the usb_submit_urb error
EHOSTUNREACH into ENOLINK, so this is an expected
and persistent error for a suspended device. The
old code tested for this condition and avoided
rescheduling.  Putting this test back.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/usbnet.c