[PATCH 3/4] configs: Increase USB Hub debounce timeout in Agilex5
Marek Vasut
marek.vasut at mailbox.org
Tue Sep 2 20:18:38 CEST 2025
On 9/2/25 9:52 AM, Ravulapalli, Naresh Kumar wrote:
>
>
> On 30-Aug-25 5:30 AM, Marek Vasut wrote:
>>
>> On 8/29/25 6:19 PM, Ravulapalli, Naresh Kumar wrote:
>>> Hi Marek
>>>
>>> On 29-Aug-25 2:11 PM, Marek Vasut wrote:
>>>>
>>>> On 8/8/25 12:04 PM, Naresh Kumar Ravulapalli wrote:
>>>>> Some USB devices need more time to be initialized. Hence,
>>>>> increasing the default USB Hub debounce timeout value for
>>>>> devices to be discovered, connected to Agilex5 boards.
>>>> Is this really hub debounce timeout or usb_pgood_delay ?
>>>>
>>>> Which devices are those, include that in the commit message.
>>>
>>> Yes, timeout is related to USB connect/disconnect signal bounces not
>>> about bus stability during init.
>>>
>>> Issue was mainly observed with legacy flash drives. Maybe I will change
>>> commit text from "Some USB devices need more time to be initialized..."
>>> to "Some old USB flash drives need more time to be initialized during
>>> connect or disconnect events ..."?
>>>
>>> Note that I am not modifying the default Kconfig value in general;
>>> change is only made for an SoCFPGA devkit we tested.
>> Does this same issue go away if you set usb_pgood_delay to 2000 or
>> higher too ?
>
> No, changing USB HUB debounce timeout is working for us.
Look at this code:
https://source.denx.de/u-boot/u-boot/-/blob/master/common/usb_hub.c?ref_type=heads#L199
"
#if CONFIG_IS_ENABLED(ENV_SUPPORT)
env = env_get("usb_pgood_delay");
if (env)
pgood_delay = max(pgood_delay,
(unsigned)simple_strtol(env, NULL, 0));
#endif
debug("pgood_delay=%dms\n", pgood_delay);
/*
* Do a minimum delay of the larger value of 100ms or pgood_delay
* so that the power can stablize before the devices are queried
*/
hub->query_delay = get_timer(0) + max(100, (int)pgood_delay);
/*
* Record the power-on timeout here. The max. delay (timeout)
* will be done based on this value in the USB port loop in
* usb_hub_configure() later.
*/
hub->connect_timeout = hub->query_delay + HUB_DEBOUNCE_TIMEOUT;
debug("devnum=%d poweron: query_delay=%d connect_timeout=%d\n",
dev->devnum, max(100, (int)pgood_delay),
max(100, (int)pgood_delay) + HUB_DEBOUNCE_TIMEOUT);
"
Changing both usb_pgood_delay or (CONFIG_USB_)HUB_DEBOUNCE_TIMEOUT
should have the same effect. How come it does not ?
More information about the U-Boot
mailing list