All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Onur Özkan" <work@onurozkan.dev>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Steven Price <steven.price@arm.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Cc: "Onur Özkan" <work@onurozkan.dev>
Subject: [PATCH v1 2/2] drm/panthor: treat sram as mandatory except mt8196
Date: Sun, 15 Feb 2026 13:02:51 +0300	[thread overview]
Message-ID: <20260215100302.136719-2-work@onurozkan.dev> (raw)
In-Reply-To: <20260215100302.136719-1-work@onurozkan.dev>

If sram-supply is missing, Panthor falls back to a
dummy regulator with a warning. This implicit behavior
hides missing DT wiring behind regulator core fallback.

Make SRAM handling explicit: require sram-supply for all
Panthor compatibles except mt8196-mali where GPU supplies
are intentionally managed outside Panthor and DT does not
model sram-supply for that compatible.

This keeps DT power modeling explicit and avoids relying on
dummy-regulator fallback.

Link: https://lore.kernel.org/all/20260213155937.6af75786@nimda/
Signed-off-by: Onur Özkan <work@onurozkan.dev>
---
 drivers/gpu/drm/panthor/panthor_devfreq.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.c b/drivers/gpu/drm/panthor/panthor_devfreq.c
index 2249b41ca4af..5f6075f18fe3 100644
--- a/drivers/gpu/drm/panthor/panthor_devfreq.c
+++ b/drivers/gpu/drm/panthor/panthor_devfreq.c
@@ -206,12 +206,17 @@ int panthor_devfreq_init(struct panthor_device *ptdev)
 	 * But without knowing if it's beneficial or not (in term of power
 	 * consumption), or how much it slows down the suspend/resume steps,
 	 * let's just keep regulators enabled for the device lifetime.
+	 *
+	 * Treat sram-supply as mandatory except for mt8196-mali. It manages
+	 * SRAM outside Panthor so this driver must not require direct control
+	 * over it.
 	 */
-	ret = devm_regulator_get_enable_optional(dev, "sram");
-	if (ret && ret != -ENODEV) {
-		if (ret != -EPROBE_DEFER)
+	if (!of_device_is_compatible(dev->of_node, "mediatek,mt8196-mali")) {
+		ret = devm_regulator_get_enable_optional(dev, "sram");
+		if (ret) {
 			DRM_DEV_ERROR(dev, "Couldn't retrieve/enable sram supply\n");
-		return ret;
+			return ret;
+		}
 	}
 
 	opp = devfreq_recommended_opp(dev, &cur_freq, 0);
-- 
2.51.2



  reply	other threads:[~2026-02-15 10:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-15 10:02 [PATCH v1 1/2] arm64: dts: add missing sram-supply to mali gpu nodes Onur Özkan
2026-02-15 10:02 ` Onur Özkan
2026-02-15 10:02 ` Onur Özkan [this message]
2026-02-15 22:21   ` [PATCH v1 2/2] drm/panthor: treat sram as mandatory except mt8196 Adam Ford
2026-02-16  9:44     ` Boris Brezillon
2026-02-16 11:44       ` AngeloGioacchino Del Regno
2026-02-16 12:43         ` Nicolas Frattaroli
2026-02-16 13:59           ` Liviu Dudau
2026-02-16 14:20             ` Boris Brezillon
2026-02-16 14:06           ` Boris Brezillon
2026-02-16  9:37   ` Boris Brezillon
2026-02-16 14:41     ` Onur Özkan
2026-02-16 15:20       ` Steven Price
2026-02-15 10:27 ` [PATCH v1 1/2] arm64: dts: add missing sram-supply to mali gpu nodes Krzysztof Kozlowski
2026-02-15 10:27   ` Krzysztof Kozlowski
2026-02-16 11:33 ` AngeloGioacchino Del Regno
2026-02-16 11:33   ` AngeloGioacchino Del Regno
2026-02-24 11:19 ` Chen-Yu Tsai
2026-02-24 11:19   ` Chen-Yu Tsai

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=20260215100302.136719-2-work@onurozkan.dev \
    --to=work@onurozkan.dev \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.