[PATCH v5 2/4] PCI: Use standard wait times for PCIe link monitoring
Lukas Wunner
lukas at wunner.de
Tue May 26 04:10:39 PDT 2026
On Tue, May 26, 2026 at 10:53:11AM +0200, Thierry Reding wrote:
> Instead of defining the wait values for each driver, use common values
> defined in the core pci.h header file. Note that most drivers don't use
> the millisecond waits, but rather usleep_range(), so add these commonly
> used values to the header so that all drivers can use them.
Hm, why not just replace usleep_range() with msleep() and use the existing
macro instead of defining new ones?
> +++ b/drivers/pci/pci.h
> @@ -63,6 +63,8 @@ struct pcie_tlp_log;
> /* Parameters for the waiting for link up routine */
> #define PCIE_LINK_WAIT_MAX_RETRIES 10
> #define PCIE_LINK_WAIT_SLEEP_MS 90
> +#define PCIE_LINK_WAIT_US_MIN 90000
> +#define PCIE_LINK_WAIT_US_MAX 100000
If you absolutely positively want to add a new macro, consider
90 * USEC_PER_MSEC instead of 90000. Moreover, consider using
fsleep() instead of adding an additional MAX macro.
Thanks,
Lukas
More information about the linux-arm-kernel
mailing list