mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Agustin Santiago Isasmendi <isasmendi.agus@gmail.com>
To: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Arnd Bergmann" <arnd@arndb.de>,
	"Rob Herring" <robh@kernel.org>,
	"Stefan Dösinger" <stefandoesinger@gmail.com>,
	"Navid Ghahremani" <ghahramani.navid@gmail.com>,
	"Krzysztof Kozlowski" <krzk@kernel.org>
Subject: [PATCH v3] ARM: l2c: honour status = "disabled" on the L2 cache node
Date: Thu, 19 Nov 2026 11:09:22 +0100	[thread overview]
Message-ID: <20261119100922.2722103-1-isasmendi.agus@gmail.com> (raw)

l2x0_of_init() looks the L2 cache node up by compatible and enables the
cache whatever its status property says, so a device tree cannot keep
the L2 cache off.

On the ZTE ZX279128S (dual Cortex-A9, L2C-310 r3p3) a PCIe read on one
CPU deadlocks against an L2C-310 line operation by physical address or a
Cache Sync on the other CPU, and the board hangs within seconds of WiFi
traffic.  Running with the L2 cache off avoids the deadlock, so a board
needs a way to say so.

Honour the status property, as the newer cache controller drivers
already do (drivers/cache/ax45mp_cache.c, starfive_starlink_cache.c):
leave a disabled node alone.  The firmware is responsible for leaving
the cache disabled in that case; the kernel does not check.  No in-tree
L2 cache node is disabled, so nothing changes for existing device trees.

Tested on the ZTE ZXHN H3600: with the node disabled the cache stays
off and the system runs normally; with it enabled the cache comes up as
before.

Assisted-by: LLM
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Navid Ghahremani <ghahramani.navid@gmail.com>
Signed-off-by: Agustin Santiago Isasmendi <isasmendi.agus@gmail.com>
---
Changes in v3:
- drop the binding note, a disabled node is not touched anyway (Rob)
- of_node_put() the node on the disabled path
- add Navid's Tested-by
v2: https://lore.kernel.org/r/20261112072953.989664-1-isasmendi.agus@gmail.com

 arch/arm/mm/cache-l2x0.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 470867160076..44eb61481693 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1772,6 +1772,12 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
 	if (!np)
 		return -ENODEV;
 
+	if (!of_device_is_available(np)) {
+		pr_info("L2C: disabled by the device tree\n");
+		of_node_put(np);
+		return -ENODEV;
+	}
+
 	if (of_address_to_resource(np, 0, &res))
 		return -ENODEV;
 

base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
-- 
2.30.2


                 reply	other threads:[~2026-11-19 10:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119100922.2722103-1-isasmendi.agus@gmail.com \
    --to=isasmendi.agus@gmail.com \
    --cc=arnd@arndb.de \
    --cc=ghahramani.navid@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=robh@kernel.org \
    --cc=stefandoesinger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®