[PATCH v3 0/8] PCI: Replace short msleep() calls with more precise delay functions

Hans Zhang posted 8 patches 1 month, 1 week ago
drivers/pci/controller/pcie-brcmstb.c   |  4 +++-
drivers/pci/controller/pcie-rcar-host.c |  4 +++-
drivers/pci/controller/pcie-rcar.c      |  4 +++-
drivers/pci/hotplug/pciehp_hpc.c        |  7 +++++--
drivers/pci/pci.c                       | 11 +++++------
drivers/pci/pci.h                       |  3 +++
drivers/pci/pcie/dpc.c                  |  4 +++-
7 files changed, 25 insertions(+), 12 deletions(-)
[PATCH v3 0/8] PCI: Replace short msleep() calls with more precise delay functions
Posted by Hans Zhang 1 month, 1 week ago
This series improves code readability and maintainability in the PCI
subsystem by replacing hard-coded delay values with descriptive macros.

The changes include:
- Adding macros for various delay values used in PCI operations
- Replacing msleep(2) with fsleep(2000) for precise secondary bus reset
- Keeping the same delay values but using macros for better documentation

These changes make the code easier to understand and maintain, while
ensuring that the timing requirements specified in the PCIe r7.0
specification are met.

---
Changes for v3:
https://patchwork.kernel.org/project/linux-pci/cover/20250822155908.625553-1-18255117159@163.com/

- According to Bjorn's suggestion, split the first patch of v2 and add
  macro definitions to the remaining patches.

Changes for v2:
https://patchwork.kernel.org/project/linux-pci/patch/20250820160944.489061-1-18255117159@163.com/

- According to the Maintainer's suggestion, it was modified to fsleep,
  usleep_range, and macro definitions were used instead of hard code. (Bjorn)
---
Hans Zhang (8):
  PCI: Add macro for secondary bus reset delay
  PCI: Replace msleep with fsleep for precise secondary bus reset
  PCI: Add macro for link status check delay
  PCI: rcar-host: Add macro for speed change monitoring delay
  PCI: brcmstb: Add macro for link up check delay
  PCI: rcar: Add macro for PHY ready check delay
  PCI: pciehp: Add macros for hotplug operation delays
  PCI/DPC: Add macro for RP busy check delay

 drivers/pci/controller/pcie-brcmstb.c   |  4 +++-
 drivers/pci/controller/pcie-rcar-host.c |  4 +++-
 drivers/pci/controller/pcie-rcar.c      |  4 +++-
 drivers/pci/hotplug/pciehp_hpc.c        |  7 +++++--
 drivers/pci/pci.c                       | 11 +++++------
 drivers/pci/pci.h                       |  3 +++
 drivers/pci/pcie/dpc.c                  |  4 +++-
 7 files changed, 25 insertions(+), 12 deletions(-)


base-commit: fab1beda7597fac1cecc01707d55eadb6bbe773c
-- 
2.25.1
Re: [PATCH v3 0/8] PCI: Replace short msleep() calls with more precise delay functions
Posted by Manivannan Sadhasivam 3 weeks, 4 days ago
On Wed, Aug 27, 2025 at 01:03:07AM GMT, Hans Zhang wrote:
> This series improves code readability and maintainability in the PCI
> subsystem by replacing hard-coded delay values with descriptive macros.
> 

For the controller drivers, the added macros do no good and provide no value.
So if you ever respin this series, you can drop them.

- Mani

> The changes include:
> - Adding macros for various delay values used in PCI operations
> - Replacing msleep(2) with fsleep(2000) for precise secondary bus reset
> - Keeping the same delay values but using macros for better documentation
> 
> These changes make the code easier to understand and maintain, while
> ensuring that the timing requirements specified in the PCIe r7.0
> specification are met.
> 
> ---
> Changes for v3:
> https://patchwork.kernel.org/project/linux-pci/cover/20250822155908.625553-1-18255117159@163.com/
> 
> - According to Bjorn's suggestion, split the first patch of v2 and add
>   macro definitions to the remaining patches.
> 
> Changes for v2:
> https://patchwork.kernel.org/project/linux-pci/patch/20250820160944.489061-1-18255117159@163.com/
> 
> - According to the Maintainer's suggestion, it was modified to fsleep,
>   usleep_range, and macro definitions were used instead of hard code. (Bjorn)
> ---
> Hans Zhang (8):
>   PCI: Add macro for secondary bus reset delay
>   PCI: Replace msleep with fsleep for precise secondary bus reset
>   PCI: Add macro for link status check delay
>   PCI: rcar-host: Add macro for speed change monitoring delay
>   PCI: brcmstb: Add macro for link up check delay
>   PCI: rcar: Add macro for PHY ready check delay
>   PCI: pciehp: Add macros for hotplug operation delays
>   PCI/DPC: Add macro for RP busy check delay
> 
>  drivers/pci/controller/pcie-brcmstb.c   |  4 +++-
>  drivers/pci/controller/pcie-rcar-host.c |  4 +++-
>  drivers/pci/controller/pcie-rcar.c      |  4 +++-
>  drivers/pci/hotplug/pciehp_hpc.c        |  7 +++++--
>  drivers/pci/pci.c                       | 11 +++++------
>  drivers/pci/pci.h                       |  3 +++
>  drivers/pci/pcie/dpc.c                  |  4 +++-
>  7 files changed, 25 insertions(+), 12 deletions(-)
> 
> 
> base-commit: fab1beda7597fac1cecc01707d55eadb6bbe773c
> -- 
> 2.25.1
> 
> 

-- 
மணிவண்ணன் சதாசிவம்