[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220811184001.2512121-1-willmcvicker@google.com>
Date: Thu, 11 Aug 2022 18:40:01 +0000
From: Will McVicker <willmcvicker@...gle.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: kernel-team@...roid.com, Sajid Dalvi <sdalvi@...gle.com>,
Will McVicker <willmcvicker@...gle.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v1] PCI/PM: Switch D3Hot delay to use usleep_range
From: Sajid Dalvi <sdalvi@...gle.com>
Since the PCI spec requires a 10ms D3Hot delay (defined by
PCI_PM_D3HOT_WAIT) and a few of the PCI quirks update the D3Hot delay up
to 20ms, let's switch from msleep to usleep_range to improve the delay
accuracy.
This patch came from Sajid Dalvi <sdalvi@...gle.com> in the Pixel 6
kernel tree [1]. Testing on a Pixel 6, found that the 10ms delay for
the Exynos PCIe device was on average delaying for 19ms when the spec
requires 10ms. Switching from msleep to uslseep_delay therefore
decreases the resume time on a Pixel 6 on average by 9ms.
[1] https://android.googlesource.com/kernel/gs/+/18a8cad68d8e6d50f339a716a18295e6d987cee3
Signed-off-by: Sajid Dalvi <sdalvi@...gle.com>
Signed-off-by: Will McVicker <willmcvicker@...gle.com>
---
drivers/pci/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 95bc329e74c0..5ae5b3c4dc9b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -72,7 +72,8 @@ static void pci_dev_d3_sleep(struct pci_dev *dev)
delay = pci_pm_d3hot_delay;
if (delay)
- msleep(delay);
+ usleep_range(delay * USEC_PER_MSEC,
+ (delay + 2) * USEC_PER_MSEC);
}
bool pci_reset_supported(struct pci_dev *dev)
base-commit: 2ae08b36c06ea8df73a79f6b80ff7964e006e9e3
--
2.37.1.559.g78731f0fdb-goog
Powered by blists - more mailing lists