Re: [PATCH] USB: core: hub_port_reset: Remove extra 40 ms reset recovery time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 05, 2024 at 10:19:17AM +0200, Paul Menzel wrote:
> > > > > > > A better approach would be to add a sysfs boolean
> > > > > > > attribute to the hub
> > > > > > > driver to enable the 40-ms reset-recovery delay, and
> > > > > > > make it default to
> > > > > > > True.  Then people who don't need the delay could disable it from
> > > > > > > userspace, say by a udev rule.
> > > > > > 
> > > > > > How would you name it?
> > > > > 
> > > > > You could call it "long_reset_recovery".  Anything like that would be
> > > > > okay.
> > > > 
> > > > Would it be useful to makes it an integer instead of a boolean,
> > > > and allow to configure the delay:
> > > > `extra_reset_recovery_delay_ms`?
> > > 
> > > Sure, why not?  Just so long as the default value matches the current
> > > behavior.
> > 
> > I hope, I am going to find time to take a stab at it.
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 4b93c0bd1d4b..72dd16eaa73a 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -120,9 +120,16 @@ MODULE_PARM_DESC(use_both_schemes,
>                 "try the other device initialization scheme if the "
>                 "first one fails");
> 
> +static int extra_reset_recovery_delay_ms = 40;
> +module_param(extra_reset_recovery_delay_ms, int, S_IRUGO | S_IWUSR);
> +MODULE_PARM_DESC(extra_reset_recovery_delay_ms,
> +               "extra recovery delay for USB devices after reset in
> milliseconds "
> +               "(default 40 ms");

This is a module parameter, not a sysfs attribute.  Module parameters 
should be avoided if possible, because they are much less flexible than 
sysfs attributes.

Alan Stern




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux