diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2014-12-04 10:21:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 12:58:49 -0500 |
commit | 6d89252a998a695ecb0348fc2d717dc33d90cae9 (patch) | |
tree | 0f5595e1a4d31c87f22d39ddf2241590b03a0729 /drivers/usb | |
parent | f161ead70fa6a62e432dff6e9dab8e3cfbeabea6 (diff) |
USB: EHCI: fix initialization bug in iso_stream_schedule()
Commit c3ee9b76aa93 (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: Alan Stern <stern@rowland.harvard.edu>
Fixes: c3ee9b76aa93
Reported-by: Joe Bryant <tenminjoe@yahoo.com>
Tested-by: Joe Bryant <tenminjoe@yahoo.com>
Tested-by: Martin Long <martin@longhome.co.uk>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index e113fd73aeae..c399606f154e 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1581,6 +1581,10 @@ iso_stream_schedule ( | |||
1581 | else | 1581 | else |
1582 | next = (now + 2 + 7) & ~0x07; /* full frame cache */ | 1582 | next = (now + 2 + 7) & ~0x07; /* full frame cache */ |
1583 | 1583 | ||
1584 | /* If needed, initialize last_iso_frame so that this URB will be seen */ | ||
1585 | if (ehci->isoc_count == 0) | ||
1586 | ehci->last_iso_frame = now >> 3; | ||
1587 | |||
1584 | /* | 1588 | /* |
1585 | * Use ehci->last_iso_frame as the base. There can't be any | 1589 | * Use ehci->last_iso_frame as the base. There can't be any |
1586 | * TDs scheduled for earlier than that. | 1590 | * TDs scheduled for earlier than that. |
@@ -1671,10 +1675,6 @@ iso_stream_schedule ( | |||
1671 | urb->start_frame = start & (mod - 1); | 1675 | urb->start_frame = start & (mod - 1); |
1672 | if (!stream->highspeed) | 1676 | if (!stream->highspeed) |
1673 | urb->start_frame >>= 3; | 1677 | urb->start_frame >>= 3; |
1674 | |||
1675 | /* Make sure scan_isoc() sees these */ | ||
1676 | if (ehci->isoc_count == 0) | ||
1677 | ehci->last_iso_frame = now >> 3; | ||
1678 | return status; | 1678 | return status; |
1679 | 1679 | ||
1680 | fail: | 1680 | fail: |