Commit cbf7cdd6 authored by Alan Stern's avatar Alan Stern Committed by Luis Henriques

USB: EHCI: fix initialization bug in iso_stream_schedule()

commit 6d89252a upstream.

Commit c3ee9b76 (EHCI: improved logic for isochronous scheduling)
introduced the idea of using ehci->last_iso_frame as the origin (or
base) for the circular calculations involved in modifying the
isochronous schedule.  However, the new code it added used
ehci->last_iso_frame before the value was properly initialized.  This
patch rectifies the mistake by moving the initialization lines earlier
in iso_stream_schedule().

This fixes Bugzilla #72891.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Fixes: c3ee9b76Reported-by: default avatarJoe Bryant <tenminjoe@yahoo.com>
Tested-by: default avatarJoe Bryant <tenminjoe@yahoo.com>
Tested-by: default avatarMartin Long <martin@longhome.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 4ecfd6af
...@@ -1581,6 +1581,10 @@ iso_stream_schedule ( ...@@ -1581,6 +1581,10 @@ iso_stream_schedule (
else else
next = (now + 2 + 7) & ~0x07; /* full frame cache */ next = (now + 2 + 7) & ~0x07; /* full frame cache */
/* If needed, initialize last_iso_frame so that this URB will be seen */
if (ehci->isoc_count == 0)
ehci->last_iso_frame = now >> 3;
/* /*
* Use ehci->last_iso_frame as the base. There can't be any * Use ehci->last_iso_frame as the base. There can't be any
* TDs scheduled for earlier than that. * TDs scheduled for earlier than that.
...@@ -1671,10 +1675,6 @@ iso_stream_schedule ( ...@@ -1671,10 +1675,6 @@ iso_stream_schedule (
urb->start_frame = start & (mod - 1); urb->start_frame = start & (mod - 1);
if (!stream->highspeed) if (!stream->highspeed)
urb->start_frame >>= 3; urb->start_frame >>= 3;
/* Make sure scan_isoc() sees these */
if (ehci->isoc_count == 0)
ehci->last_iso_frame = now >> 3;
return status; return status;
fail: fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment