Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: gadget: dummy_hcd: Set transfer interval to 1 microframe

Currently, the transfer polling interval is set to 1ms, which is the
frame rate of full-speed and low-speed USB. The USB 2.0 specification
introduces microframes (125 microseconds) to improve the timing
precision of data transfers.

Reducing the transfer interval to 1 microframe increases data throughput
for high-speed and super-speed USB communication

Signed-off-by: Marcello Sylvester Bauer <marcello.bauer@9elements.com>
Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
Link: https://lore.kernel.org/r/6295dbb84ca76884551df9eb157cce569377a22c.1712843963.git.sylv@sylv.io
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Marcello Sylvester Bauer and committed by
Greg Kroah-Hartman
0a723ed3 a7f3813e

+4 -2
+4 -2
drivers/usb/gadget/udc/dummy_hcd.c
··· 50 50 #define POWER_BUDGET 500 /* in mA; use 8 for low-power port testing */ 51 51 #define POWER_BUDGET_3 900 /* in mA */ 52 52 53 + #define DUMMY_TIMER_INT_NSECS 125000 /* 1 microframe */ 54 + 53 55 static const char driver_name[] = "dummy_hcd"; 54 56 static const char driver_desc[] = "USB Host+Gadget Emulator"; 55 57 ··· 1304 1302 1305 1303 /* kick the scheduler, it'll do the rest */ 1306 1304 if (!hrtimer_active(&dum_hcd->timer)) 1307 - hrtimer_start(&dum_hcd->timer, ms_to_ktime(1), HRTIMER_MODE_REL); 1305 + hrtimer_start(&dum_hcd->timer, ns_to_ktime(DUMMY_TIMER_INT_NSECS), HRTIMER_MODE_REL); 1308 1306 1309 1307 done: 1310 1308 spin_unlock_irqrestore(&dum_hcd->dum->lock, flags); ··· 1995 1993 dum_hcd->udev = NULL; 1996 1994 } else if (dum_hcd->rh_state == DUMMY_RH_RUNNING) { 1997 1995 /* want a 1 msec delay here */ 1998 - hrtimer_start(&dum_hcd->timer, ms_to_ktime(1), HRTIMER_MODE_REL); 1996 + hrtimer_start(&dum_hcd->timer, ns_to_ktime(DUMMY_TIMER_INT_NSECS), HRTIMER_MODE_REL); 1999 1997 } 2000 1998 2001 1999 spin_unlock_irqrestore(&dum->lock, flags);