9e1cb110db469712899a2a21980cb9b68704265e
[openwrt/staging/blogic.git] /
1 From 4e27de0597024fd7070c04a1bf0af82f1be77191 Mon Sep 17 00:00:00 2001
2 From: Jonathan Bell <jonathan@raspberrypi.com>
3 Date: Wed, 6 Oct 2021 15:27:53 +0100
4 Subject: [PATCH] dwc_otg: pay attention to qh->interval when
5 rescheduling periodic queues
6
7 A regression introduced in https://github.com/raspberrypi/linux/pull/3887
8 meant that if the newly scheduled transfer immediately returned data, and
9 the driver resubmitted a single URB after every transfer, then the effective
10 polling interval would end up being approx 1ms.
11
12 Use the larger of SCHEDULE_SLOP or the configured endpoint interval.
13
14 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
15 ---
16 drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
20 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
21 @@ -691,7 +691,7 @@ int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * h
22 } else {
23 /* If the QH wasn't in a schedule, then sched_frame is stale. */
24 qh->sched_frame = dwc_frame_num_inc(dwc_otg_hcd_get_frame_number(hcd),
25 - SCHEDULE_SLOP);
26 + max_t(uint32_t, qh->interval, SCHEDULE_SLOP));
27 status = schedule_periodic(hcd, qh);
28 qh->start_split_frame = qh->sched_frame;
29 if ( !hcd->periodic_qh_count ) {