All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: michal.pecio@gmail.com, gregkh@linuxfoundation.org,
	stern@rowland.harvard.edu
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails" has been added to the 3.14-stable tree
Date: Thu, 28 Jul 2016 14:25:45 -0700	[thread overview]
Message-ID: <146974114592105@kroah.com> (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 <stable@vger.kernel.org> know about it.


>From c66f59ee5050447b3da92d36f5385a847990a894 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Pecio?= <michal.pecio@gmail.com>
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 <michal.pecio@gmail.com>

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.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/ohci-q.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -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 michal.pecio@gmail.com are

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

             reply	other threads:[~2016-07-28 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 21:25 gregkh [this message]
2016-07-30 14:14 ` Patch "USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails" has been added to the 3.14-stable tree Michał Pecio
2016-07-30 16:14   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=146974114592105@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=michal.pecio@gmail.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.