On 27/10/2024 22:44, Ping-Ke Shih wrote: > Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx> wrote: >> >> This procedure for reading efuse bytes relies in a loop that performs an >> I/O read up to *10k* times in case of failures. We measured the time of >> the loop inside read_efuse_byte() alone, and in this reproducer (which >> involves the dummy_hcd emulation layer), it takes 15 seconds each. > > The I/O read of 10k times is to polling if efuse is ready, and then following > statement is to actually read efuse content back. For USB devices, I/O is > slow, so it might be fine to reduce retry times. But For PCIE devices, > I think this will be risky without testing with real hardware. > > Possible way is to use "rtlhal->interface == INTF_PCI" to keep original times > for PCIE devices, and only reduce retry times for USB devices. But USB can > operate on USB-2/-3 modes, so maybe still need experiments with real hardware > to get reasonable retry times. > Thanks a bunch for the review and extra details Ping-Ke Shih! The idea of guarding with "rtlhal->interface == INTF_PCI" is very good and I can implement in a V2. But can you help me on finding a USB adapter that runs this path? If you know a commodity model that uses this specific driver, could you point me so I can buy one for testing? Meanwhile I'll try to find a model based on some kernel reports online, hope I can! Cheers, Guilherme