From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95E7331B823 for ; Sat, 21 Mar 2026 12:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774096870; cv=none; b=kWrZmseQrBbQ8Bq8hLyDEg7uGBf6BGfndD4OVPPD7mEO+STQMvdhbZj9uPYG9bYcciANaYWE2SIGvsSE8BVbDGJxUZJdcXR3tK2NtD13MdE/XbKg3OaHpXBB2/yTP4Z5z0jpRAfBhyNkVZK4NVXB2j4JC3loEq0eNH2bGD8kfYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774096870; c=relaxed/simple; bh=x4OJRCluuyUS6eySOrZTCxqkR+tSwFaY3ATrG2yLEoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AiWel2NmYfeZIPKiHOSCuqO1J8J23E2Bob8ppKYZg+Ayt8E3XJF9Z0KmlHxN0sPdj8x3ozN8ayzi7A0JMh+bEXzoRP26mvUmKznXXgxCf0bz0WDsQ3aiwqZleP0HrREs9L2qQ9In/kUd/NSNtkdrVwnebCqkfoR2LTE0C98fkxU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sd/xKlrK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sd/xKlrK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D02A7C19421; Sat, 21 Mar 2026 12:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774096870; bh=x4OJRCluuyUS6eySOrZTCxqkR+tSwFaY3ATrG2yLEoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sd/xKlrKfsfJRhxiTLrXq9H2YPqMv3VrOxLFLeJb1E6X4y6u5OVv/ljwjlDUhMUpm gTgq+Fbu8OrkvvlIS6r5T6POPdCSiM/OrI0Oj7dIoi25VyMy1a8p++YNa/qdZQtdyO +5L5t/8+l/dtfvypjrk+LBMBY5iA2caz40BCUeH8iCCrK36mqJ9Kra7EkxGDJQozBm 0AlRk9TsODrfaqjt9pGcvoVc7O9nf5Zf0OTw+NyIcEYKw3S3Wv+e/qoiT/QoEjSNzl IiJUDL6L1cATUOkWAgjO64kmwn4bpY4UrxFXD/V9kaV5WlYDkvvW5eOP9HMuCNIMuI L9u133sN5BCEw== From: Sasha Levin To: stable@vger.kernel.org Cc: =?UTF-8?q?Ma=C3=ADra=20Canal?= , Stefan Wahren , Ulf Hansson , Sasha Levin Subject: [PATCH 5.15.y] pmdomain: bcm: bcm2835-power: Increase ASB control timeout Date: Sat, 21 Mar 2026 08:41:08 -0400 Message-ID: <20260321124108.268680-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026032026-divisive-wieldable-7957@gregkh> References: <2026032026-divisive-wieldable-7957@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Maíra Canal [ Upstream commit b826d2c0b0ecb844c84431ba6b502e744f5d919a ] The bcm2835_asb_control() function uses a tight polling loop to wait for the ASB bridge to acknowledge a request. During intensive workloads, this handshake intermittently fails for V3D's master ASB on BCM2711, resulting in "Failed to disable ASB master for v3d" errors during runtime PM suspend. As a consequence, the failed power-off leaves V3D in a broken state, leading to bus faults or system hangs on later accesses. As the timeout is insufficient in some scenarios, increase the polling timeout from 1us to 5us, which is still negligible in the context of a power domain transition. Also, replace the open-coded ktime_get_ns()/ cpu_relax() polling loop with readl_poll_timeout_atomic(). Cc: stable@vger.kernel.org Fixes: 670c672608a1 ("soc: bcm: bcm2835-pm: Add support for power domains under a new binding.") Signed-off-by: Maíra Canal Reviewed-by: Stefan Wahren Signed-off-by: Ulf Hansson [ adapted unified bcm2835_asb_control() function changes to separate bcm2835_asb_enable() and bcm2835_asb_disable() functions ] Signed-off-by: Sasha Levin --- drivers/soc/bcm/bcm2835-power.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm2835-power.c index 1e0041ec81323..6a82c66c6674a 100644 --- a/drivers/soc/bcm/bcm2835-power.c +++ b/drivers/soc/bcm/bcm2835-power.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -150,40 +151,34 @@ struct bcm2835_power { static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg) { - u64 start; + u32 val; if (!reg) return 0; - start = ktime_get_ns(); - /* Enable the module's async AXI bridges. */ ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP); - while (ASB_READ(reg) & ASB_ACK) { - cpu_relax(); - if (ktime_get_ns() - start >= 1000) - return -ETIMEDOUT; - } + + if (readl_poll_timeout_atomic(power->asb + reg, val, + !(val & ASB_ACK), 0, 5)) + return -ETIMEDOUT; return 0; } static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg) { - u64 start; + u32 val; if (!reg) return 0; - start = ktime_get_ns(); - /* Enable the module's async AXI bridges. */ ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP); - while (!(ASB_READ(reg) & ASB_ACK)) { - cpu_relax(); - if (ktime_get_ns() - start >= 1000) - return -ETIMEDOUT; - } + + if (readl_poll_timeout_atomic(power->asb + reg, val, + !!(val & ASB_ACK), 0, 5)) + return -ETIMEDOUT; return 0; } -- 2.51.0