Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32E6EEF5871 for ; Sun, 15 Feb 2026 10:04:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 919B710E010; Sun, 15 Feb 2026 10:04:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=onurozkan.dev header.i=@onurozkan.dev header.b="SP34syZG"; dkim-atps=neutral Received: from forward100a.mail.yandex.net (forward100a.mail.yandex.net [178.154.239.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5C8E10E010 for ; Sun, 15 Feb 2026 10:04:12 +0000 (UTC) Received: from mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:582e:0:640:200:0]) by forward100a.mail.yandex.net (Yandex) with ESMTPS id AAC16C01C8; Sun, 15 Feb 2026 13:04:10 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id j3UBeWUGPiE0-iAOvSvzo; Sun, 15 Feb 2026 13:04:09 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onurozkan.dev; s=mail; t=1771149849; bh=U6+sQXT3njLPQ8KohNJXrXJPRvqzIkn4onxixnNBYnA=; h=Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From; b=SP34syZG9uV727kbJf1JQvSVgQLRscDxQmMfQtPTHeLozEOJQB3pti7TZVN7eO9zF RbQm8ahOD2m4Is1UJw8plbFw493oqiuzGjQSWPRaRNf+QjdAmJv53yGJNqFz7nW5hq aNThQjzcQhrlLaJhUP5AGzWQJxF6tRHJTdF3G6U0= Authentication-Results: mail-nwsmtp-smtp-production-main-55.vla.yp-c.yandex.net; dkim=pass header.i=@onurozkan.dev From: =?UTF-8?q?Onur=20=C3=96zkan?= To: Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: =?UTF-8?q?Onur=20=C3=96zkan?= Subject: [PATCH v1 2/2] drm/panthor: treat sram as mandatory except mt8196 Date: Sun, 15 Feb 2026 13:02:51 +0300 Message-ID: <20260215100302.136719-2-work@onurozkan.dev> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260215100302.136719-1-work@onurozkan.dev> References: <20260215100302.136719-1-work@onurozkan.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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