On Fri, 2 Dec 2016, Todd Brandt wrote: > Add a module parameter that replaces the USB_RESUME_TIMEOUT > and other hardcoded delay numbers with the USB spec minimums. > By default the patch retains the current values. > > The USB subsystem currently uses heavily padded values for TDRSMDN > and TRSTRCY. This patch keeps the current values by default, but if > the kernel is booted with usbcore.padding=0 they are set to the > spec minimums with no padding. The result is significant performance > improvement in usb device resume. > > Signed-off-by: Todd Brandt <todd.e.brandt@xxxxxxxxxxxxxxx> > --- a/Documentation/kernel-parameters.txt > +++ b/Documentation/kernel-parameters.txt > @@ -4237,6 +4237,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. > usbcore.blinkenlights= > [USB] Set to cycle leds on hubs (default 0 = off). > > + usbcore.padding= > + [USB] Pad the USB 2.0 spec timing values (default 1 = on). > + Whether or not you take Greg's suggestion and change this to a debugfs entry, please don't call it "padding". The word is horribly imprecise and will usually be interpreted differently from what you want. You missed a spot on line 385 in uhci-hub.c; it should be tdrsmdn. What happened to ohci-hub.c? > --- a/include/linux/usb.h > +++ b/include/linux/usb.h > @@ -233,8 +233,30 @@ 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 > + * @name: timing config name @name? What's 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_TDRSMDN_DEF 40 > +#define USB_TIMING_TRSMRCY_DEF 10 > +#define USB_TIMING_TRSTRCY_DEF 50 > + > +struct _usb_timing_config { > + unsigned int tdrsmdn; /* resume signal time 20ms - infinity */ > + unsigned int trsmrcy; /* resume recovery time 0ms - 10ms */ > + unsigned int trstrcy; /* reset recovery time 0ms - infinity*/ > +}; > +extern struct _usb_timing_config usb_timing; > > /** > * struct usb_interface_cache - long-term representation of a device interface 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