[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250822155908.625553-1-18255117159@163.com>
Date: Fri, 22 Aug 2025 23:59:01 +0800
From: Hans Zhang <18255117159@....com>
To: bhelgaas@...gle.com,
helgaas@...nel.org,
linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Hans Zhang <18255117159@....com>
Subject: [PATCH v2 0/7] PCI: Replace short msleep() calls with more precise delay functions
This series replaces short msleep() calls (less than 20ms) with more
precise delay functions (fsleep() and usleep_range()) throughout the
PCI subsystem.
The msleep() function with small values can sleep longer than intended
due to timer granularity, which can cause unnecessary delays in PCI
operations such as link status checking, reset handling, and hotplug
operations.
These changes:
- Use fsleep() for delays that require precise timing (1-2ms).
- Use usleep_range() for delays that can benefit from a small range.
- Add #defines for all delay values with references to PCIe specifications.
- Update comments to reference the latest PCIe r7.0 specification.
This improves the responsiveness of PCI operations while maintaining
compliance with PCIe specifications.
---
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 (7):
PCI: Replace msleep(2) with fsleep() for precise delay
PCI: Replace msleep(1) with fsleep() for precise link status checking
PCI: rcar-host: Replace msleep(1) with fsleep() for precise speed
change monitoring
PCI: brcmstb: Replace msleep(5) with usleep_range() for precise link
up checking
PCI: rcar: Replace msleep(5) with usleep_range() for precise PHY ready
checking
PCI: pciehp: Replace msleep(10) with usleep_range() for precise delays
PCI/DPC: Replace msleep(10) with usleep_range() for precise RP busy
checking
drivers/pci/controller/pcie-brcmstb.c | 5 ++++-
drivers/pci/controller/pcie-rcar-host.c | 4 +++-
drivers/pci/controller/pcie-rcar.c | 4 +++-
drivers/pci/hotplug/pciehp_hpc.c | 6 +++++-
drivers/pci/pci.c | 9 +++------
drivers/pci/pci.h | 7 +++++++
drivers/pci/pcie/dpc.c | 5 ++++-
7 files changed, 29 insertions(+), 11 deletions(-)
base-commit: b19a97d57c15643494ac8bfaaa35e3ee472d41da
--
2.25.1
Powered by blists - more mailing lists