Patch "rt2x00usb: mark device removed when get ENOENT usb error" has been added to the 4.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
rt2x00usb: mark device removed when get ENOENT usb error
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
rt2x00usb-mark-device-removed-when-get-enoent-usb-error.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
bfa62a52cad93686bb8d8171ea5288813248a7c6Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <[email protected]>
Date: Thu, 9 Nov 2017 11:59:24 +0100
Subject: rt2x00usb: mark device removed when get ENOENT usb error
From: Stanislaw Gruszka <[email protected]>
commit bfa62a52cad93686bb8d8171ea5288813248a7c6 upstream.
ENOENT usb error mean "specified interface or endpoint does not exist or is not enabled". Mark device not present when we encounter this error similar like we do with ENODEV error.
Otherwise we can have infinite loop in rt2x00usb_work_rxdone(), because we remove and put again RX entries to the queue infinitely.
We can have similar situation when submit urb will fail all the time with other error, so we need consider to limit number of entries processed by rxdone work. But for now, since the patch fixes reproducible soft lockup issue on single processor systems and taken ENOENT error meaning, let apply this fix.
Patch adds additional ENOENT check not only in rx kick routine, but also on other places where we check for ENODEV error.
--- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +3 -3
@@ -57,7 +57,7 @@ int rt2x00usb_vendor_request(struct rt2xif (status >=0 )return 0 ; -if (status == -ENODEV ) { +if (status == -ENODEV || status == -ENOENT ) {/* Device has disappeared. */ clear_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags);break ;
@@ -321,7 +321,7 @@ static bool rt2x00usb_kick_tx_entry(stru status =usb_submit_urb (entry_priv->urb,GFP_ATOMIC );if (status) { -if (status == -ENODEV ) +if (status == -ENODEV || status == -ENOENT )clear_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags);set_bit (ENTRY_DATA_IO_FAILED , &entry->flags);rt2x00lib_dmadone (entry);
@@ -410,7 +410,7 @@ static bool rt2x00usb_kick_rx_entry(stru status =usb_submit_urb (entry_priv->urb,GFP_ATOMIC );if (status) { -if (status == -ENODEV ) +if (status == -ENODEV || status == -ENOENT )clear_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags);set_bit (ENTRY_DATA_IO_FAILED , &entry->flags);rt2x00lib_dmadone (entry);
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/rt2x00usb-mark-device-removed-when-get-enoent-usb-error.patch