77a20e61081e29824a87314a3268131a9f418033
[openwrt/staging/robimarko.git] /
1 From bdc90a7b7ee57434a37adcfcb07f98309cb3426b 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 that
5 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) {