Skip to contentSkip to conversation

Patch "USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails" has been added to the 3.14-stable tree

PATCH [email protected] 2 participants 3 messages Jul 28, 2016 – Jul 30, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails

to the 3.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:
usb-ohci-don-t-mark-eds-as-ed_oper-if-scheduling-fails.patch
and it can be found in the queue-3.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 c66f59ee5050447b3da92d36f5385a847990a894 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Micha=C5=82=20Pecio?= <[email protected]>
Date: Tue, 7 Jun 2016 12:34:45 +0200
Subject: USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails

From: Michał Pecio <[email protected]>

commit c66f59ee5050447b3da92d36f5385a847990a894 upstream.

Since ed_schedule begins with marking the ED as "operational", the ED may be left in such state even if scheduling actually fails.

This allows future submission attempts to smuggle this ED to the hardware behind the scheduler's back and without linking it to the ohci->eds_in_use list.

The former causes bandwidth saturation and data loss on isoc endpoints, the latter crashes the kernel when attempt is made to unlink such ED from this list.

Fix ed_schedule to update ED state only on successful return.

---
 drivers/usb/host/ohci-q.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/host/ohci-q.c +2 -1
@@ -183,7 +183,6 @@ static int ed_schedule (struct ohci_hcd
 {
 	int	branch;
 
-	ed->state = ED_OPER;
 	ed->ed_prev = NULL;
 	ed->ed_next = NULL;
 	ed->hwNextED = 0;
@@ -263,6 +262,8 @@ static int ed_schedule (struct ohci_hcd
 	/* the HC may not see the schedule updates yet, but if it does
 	 * then they'll be properly ordered.
 	 */
+
+	ed->state = ED_OPER;
 	return 0;
 }
 

Patches currently in stable-queue which might be from [email protected] are

queue-3.14/usb-ohci-don-t-mark-eds-as-ed_oper-if-scheduling-fails.patch

#1 lore raw

Hi, this was intended for 3.18+ as indicated in my submission email.

Quoted 5 lines

This is a note to let you know that I've just added the patch titled

USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails

to the 3.14-stable tree

author maintainer
#2 lore raw
Quoted 7 lines · Michał Pecio

Hi, this was intended for 3.18+ as indicated in my submission email.

Quoted 5 lines

This is a note to let you know that I've just added the patch titled

USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails

to the 3.14-stable tree

Oops, now dropped, thanks for letting me know.

greg k-h