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
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.
11 See https://bugs.launchpad.net/raspbian/+bug/1819560
13 https://github.com/raspberrypi/linux/issues/3883
15 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
17 drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 4 ++++
18 1 file changed, 4 insertions(+)
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
24 //hcd->fiq_state->kick_np_queues = 1;
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),
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;