2a12614196572a28c4968b1cee8ec571c709cb68
[openwrt/staging/noltari.git] /
1 From 2ae3859a69cecc2820f768f4d22022000e9f2e22 Mon Sep 17 00:00:00 2001
2 From: Jonathan Bell <jonathan@raspberrypi.org>
3 Date: Wed, 7 Oct 2020 15:09:29 +0100
4 Subject: [PATCH] dwc_otg: initialise sched_frame for periodic QHs
5 that were parked
6
7 If a periodic QH has no remaining QTDs, then it is removed from all
8 periodic schedules. When re-adding, initialise the sched_frame and
9 start_split_frame from the current value of the frame counter.
10
11 See https://bugs.launchpad.net/raspbian/+bug/1819560
12 and
13 https://github.com/raspberrypi/linux/issues/3883
14
15 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
16 ---
17 drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 4 ++++
18 1 file changed, 4 insertions(+)
19
20 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
21 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
22 @@ -689,7 +689,11 @@ int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * h
23 &qh->qh_list_entry);
24 //hcd->fiq_state->kick_np_queues = 1;
25 } else {
26 + /* If the QH wasn't in a schedule, then sched_frame is stale. */
27 + qh->sched_frame = dwc_frame_num_inc(dwc_otg_hcd_get_frame_number(hcd),
28 + SCHEDULE_SLOP);
29 status = schedule_periodic(hcd, qh);
30 + qh->start_split_frame = qh->sched_frame;
31 if ( !hcd->periodic_qh_count ) {
32 intr_mask.b.sofintr = 1;
33 if (fiq_enable) {