[PATCH v2 1/2] PCI/DOE: Don't busy-poll the mailbox when HZ < 128
From: Michal Clapinski
Date: Tue Nov 03 2026 - 11:35:25 EST
PCI_DOE_POLL_INTERVAL is defined as PCI_DOE_TIMEOUT / 128, which is 0
when HZ is below 128, e.g. with CONFIG_HZ_100. pci_doe_wait() then calls
wait_event_timeout() with a timeout of 0, which returns immediately
without sleeping. As a result, doe_statemachine_work() and
pci_doe_abort() read the DOE Status register in a tight loop for up to
PCI_DOE_TIMEOUT (1 second) instead of sleeping between reads.
Make the poll interval at least one jiffy.
Fixes: 9d24322e887b ("PCI/DOE: Add DOE mailbox support functions")
Signed-off-by: Michal Clapinski <mclapinski@xxxxxxxxxx>
---
drivers/pci/doe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c
index 6b5d9ba8e969..6d258f751318 100644
--- a/drivers/pci/doe.c
+++ b/drivers/pci/doe.c
@@ -26,7 +26,7 @@
/* Timeout of 1 second from 6.30.2 Operation, PCI Spec r6.0 */
#define PCI_DOE_TIMEOUT HZ
-#define PCI_DOE_POLL_INTERVAL (PCI_DOE_TIMEOUT / 128)
+#define PCI_DOE_POLL_INTERVAL max(PCI_DOE_TIMEOUT / 128, 1)
#define PCI_DOE_FLAG_CANCEL 0
#define PCI_DOE_FLAG_DEAD 1
--
2.56.0.385.gac671c819a-goog