From 709595fcfe13c7c309b1e1f55e2a0d36e9fe2de1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ma=C3=ADra=20Canal?= <mcanal@igalia.com>
Date: Mon, 25 May 2026 12:39:17 -0300
Subject: [PATCH] pmdomain: bcm: bcm2835-power: Raise ASB poll timeout to 100us
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit 18605b1b936b ("pmdomain: bcm: bcm2835-power: Increase ASB control
timeout") raised the ASB handshake polling budget from 1us to 5us.
Surveying the pmdomain subsystem, 5us is still the smallest polling budget
by a wide margin - comparable handshakes in other drivers use:

  - 100us : starfive jh71xx-pmu, apple pmgr-pwrstate
  - 1ms   : renesas rcar-sysc, rmobile-sysc (power-on)
  - 10ms  : renesas rcar-gen4-sysc, sunxi sun55i-pck600
  - 1s    : mediatek mtk-pm-domains, mtk-scpsys

Raise the bcm2835 timeout to 100us, matching analogous drivers. 100us is
still negligible relative to a power-domain transition and gives the V3D
master ASB substantially more headroom to drain under heavy workloads,
where 5us has been observed to be insufficient in practice.

Cc: stable@vger.kernel.org
Fixes: b826d2c0b0ec ("pmdomain: bcm: bcm2835-power: Increase ASB control timeout")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 drivers/pmdomain/bcm/bcm2835-power.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/pmdomain/bcm/bcm2835-power.c
+++ b/drivers/pmdomain/bcm/bcm2835-power.c
@@ -175,7 +175,7 @@ static int bcm2835_asb_control(struct bc
 	writel(PM_PASSWORD | val, base + reg);
 
 	if (readl_poll_timeout_atomic(base + reg, val,
-				      !!(val & ASB_ACK) != enable, 0, 5))
+				      !!(val & ASB_ACK) != enable, 0, 100))
 		return -ETIMEDOUT;
 
 	return 0;
