diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2012-08-08 11:48:10 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-09-12 03:36:56 +0100 |
commit | 18256787181341d60420bc17b345ca1ff6444661 (patch) | |
tree | e8522ef1ecb719aa02ec053d35f836f04d30f022 /arch/arm | |
parent | 4ca589e245b8806bc8dc055250c0168dc2a25a92 (diff) | |
download | lwn-18256787181341d60420bc17b345ca1ff6444661.tar.gz lwn-18256787181341d60420bc17b345ca1ff6444661.zip |
usb: gadget: u_ether: fix kworker 100% CPU issue with still used interfaces in eth_stop
commit b1b552a69b8805e7e338074a9e8b670b4a795218 upstream.
This patch fixes an issue introduced by patch:
72c973d usb: gadget: add usb_endpoint_descriptor to struct usb_ep
Without this patch we see a kworker taking 100% CPU, after this sequence:
- Connect gadget to a windows host
- load g_ether
- ifconfig up <ip>; ifconfig down; ifconfig up
- ping <windows host>
The "ifconfig down" results in calling eth_stop(), which will call
usb_ep_disable() and, if the carrier is still ok, usb_ep_enable():
usb_ep_disable(link->in_ep);
usb_ep_disable(link->out_ep);
if (netif_carrier_ok(net)) {
usb_ep_enable(link->in_ep);
usb_ep_enable(link->out_ep);
}
The ep should stay enabled, but will not, as ep_disable set the desc
pointer to NULL, therefore the subsequent ep_enable will fail. This leads
to permanent rescheduling of the eth_work() worker as usb_ep_queue()
(called by the worker) will fail due to the unconfigured endpoint.
We fix this issue by saving the ep descriptors and re-assign them before
usb_ep_enable().
Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/arm')
0 files changed, 0 insertions, 0 deletions