On Sat, 2017-01-07 at 11:58 -0500, Alan Stern wrote: > On Fri, 6 Jan 2017, Todd Brandt wrote: > > > Add a kernel parameter that replaces the USB_RESUME_TIMEOUT > > and other hardcoded delay numbers with the USB spec minimums. > > > > The USB subsystem currently uses some padded values for USB spec timing > > delays. This patch keeps the current values by default, but if the kernel > > is booted with usbcore.timing_minimum=1 they are set to the spec minimums > > with no padding. The result is significant performance improvement in usb > > device resume. > > > > - tdrsmdn: resume signal time (min=20ms, cur=40ms) usb2.0 spec 7.1.7.7 > > - trsmrcy: resume recovery time (min=10ms, cur=10ms) usb2.0 spec 7.1.7.7 > > - trstrcy: reset recovery time (min=0ms, cur=50ms) usb2.0 spec 7.1.7.5 > > - tdrstr: root port reset time (min=50ms, cur=50ms) usb2.0 spec 7.1.7.5 > > > > Example analyze_suspend runs are provided here showing the benefits: > > https://01.org/suspendresume/blogs/tebrandt/2016/usb-resume-optimization-using-spec-minimum-delays > > > > Signed-off-by: Todd Brandt <todd.e.brandt@xxxxxxxxxxxxxxx> > > --- > > v2: > > - moved the core code from hub.c to usb.c > > - param name is now usb_timing_minimum > > - configured isp1362-hcd and ohci-hub to use the new values > > v3: > > - changed param to usbcore.timing_minimum > > v4: > > - moved usb_timing object to usb-common > > v5: > > - added tdrstr and used it in uhci-hub > > You forgot to modify the comments accordingly... > > > --- a/include/linux/usb.h > > +++ b/include/linux/usb.h > > @@ -233,8 +233,32 @@ void usb_put_intf(struct usb_interface *intf); > > * In order to avoid both conditions, we're using a 40 ms resume timeout, which > > * should cope with both LPJ calibration errors and devices not following every > > * detail of the USB Specification. > > + * > > + * struct _usb_timing_config - USB timing value settings > > + * @tdrsmdn: TDRSMDN resume signal time 7.1.7.7 > > + * @trsmrcy; TRSMRCY resume recovery time 7.1.7.7 > > + * @trstrcy; TRSTRCY reset recovery time 7.1.7.5 > > Here. good catch, sorry about that. > > > + * > > + * These timing values are defined in the USB 2.0 spec sec 7.3.2 table 7-13 > > + * Thir default values have been padded for various reasons and this config > > + * allows the system to use different values. > > */ > > -#define USB_RESUME_TIMEOUT 40 /* ms */ > > +#define USB_TIMING_TDRSMDN_MIN 20 > > +#define USB_TIMING_TRSMRCY_MIN 10 > > +#define USB_TIMING_TRSTRCY_MIN 0 > > +#define USB_TIMING_TDRSTR_MIN 50 > > +#define USB_TIMING_TDRSMDN_DEF 40 > > +#define USB_TIMING_TRSMRCY_DEF 10 > > +#define USB_TIMING_TRSTRCY_DEF 50 > > +#define USB_TIMING_TDRSTR_DEF 50 > > Otherwise, the core, uhci, ohci, and ehci parts look good to me. > > Alan Stern > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html