From: Cunyuan Liu <cunyuan.liu@cixtech.com>
To: boris.brezillon@collabora.com, steven.price@arm.com,
liviu.dudau@arm.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, gary.yang@cixtech.com,
fugang.duan@cixtech.com, daniel.almeida@collabora.com,
aliceryhl@google.com, p.zabel@pengutronix.de,
daniel@fooishbar.org
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
cix-kernel-upstream@cixtech.com, robin.wang@cixtech.com,
cunyuan.liu@cixtech.com
Subject: [PATCH v3 2/7] drm/panthor: Allow operation without an OPP table
Date: Thu, 19 Nov 2026 20:38:45 +0800 [thread overview]
Message-ID: <20261119123850.2994625-3-cunyuan.liu@cixtech.com> (raw)
In-Reply-To: <20261119123850.2994625-1-cunyuan.liu@cixtech.com>
Some platforms provide GPU clocks through firmware without an OPP
table that the driver can use. Failing probe when the DT has no OPP
table prevents these platforms from using the clock settings already
provided by firmware.
Continue without devfreq when devm_pm_opp_of_add_table() returns
-ENODEV, as Panfrost does. Keep the current core clock rate for
profiling and report the clock provider's rate when devfreq is not
registered.
Only allow the fallback when neither mali-supply nor sram-supply is
present. GPU supply properties require an OPP table to configure and
enable the supplies. Without these properties, the platform must provide
a usable clock and power configuration.
Signed-off-by: Cunyuan Liu <cunyuan.liu@cixtech.com>
---
drivers/gpu/drm/panthor/panthor_devfreq.c | 13 ++++++++++++-
drivers/gpu/drm/panthor/panthor_device.h | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_devfreq.c b/drivers/gpu/drm/panthor/panthor_devfreq.c
index 2249b41ca4af..778c20f0921a 100644
--- a/drivers/gpu/drm/panthor/panthor_devfreq.c
+++ b/drivers/gpu/drm/panthor/panthor_devfreq.c
@@ -6,6 +6,7 @@
#include <linux/devfreq_cooling.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
+#include <linux/property.h>
#include <drm/drm_managed.h>
#include <drm/drm_print.h>
@@ -172,6 +173,16 @@ int panthor_devfreq_init(struct panthor_device *ptdev)
}
ret = devm_pm_opp_of_add_table(dev);
+ if (ret == -ENODEV) {
+ if (device_property_present(dev, "mali-supply") ||
+ device_property_present(dev, "sram-supply"))
+ return dev_err_probe(dev, -ENODEV,
+ "GPU supplies require an OPP table\n");
+
+ /* Keep the clock provider's rate when no OPP table is present. */
+ ptdev->fast_rate = clk_get_rate(ptdev->clks.core);
+ return 0;
+ }
if (ret)
return ret;
} else {
@@ -324,7 +335,7 @@ unsigned long panthor_devfreq_get_freq(struct panthor_device *ptdev)
int ret;
if (!pdevfreq->devfreq)
- return 0;
+ return clk_get_rate(ptdev->clks.core);
ret = pdevfreq->devfreq->profile->get_cur_freq(ptdev->base.dev, &freq);
if (ret)
diff --git a/drivers/gpu/drm/panthor/panthor_device.h b/drivers/gpu/drm/panthor/panthor_device.h
index adbc2e2f03be..f5353372c1ae 100644
--- a/drivers/gpu/drm/panthor/panthor_device.h
+++ b/drivers/gpu/drm/panthor/panthor_device.h
@@ -328,7 +328,7 @@ struct panthor_device {
/** @profile_mask: User-set profiling flags for job accounting. */
u32 profile_mask;
- /** @fast_rate: Maximum device clock frequency. Set by DVFS */
+ /** @fast_rate: Maximum OPP frequency, or the clock rate without OPPs. */
unsigned long fast_rate;
#ifdef CONFIG_DEBUG_FS
--
2.53.0
next prev parent reply other threads:[~2026-11-19 12:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 12:38 [PATCH v3 0/7] Add initial GPU support for CIX Sky1 Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 1/7] drm/panthor: Add optional external reset support Cunyuan Liu
2026-11-19 12:38 ` Cunyuan Liu [this message]
2026-11-19 12:38 ` [PATCH v3 3/7] dt-bindings: gpu: arm,mali-valhall-csf: Add system-cache policies Cunyuan Liu
2026-11-22 16:58 ` Krzysztof Kozlowski
2026-11-19 12:38 ` [PATCH v3 4/7] drm/panthor: Add system-cache allocation policy support Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 5/7] dt-bindings: gpu: Add CIX Sky1 Mali support Cunyuan Liu
2026-11-22 17:01 ` Krzysztof Kozlowski
2026-11-19 12:38 ` [PATCH v3 6/7] drm/panthor: Add CIX Sky1 compatible Cunyuan Liu
2026-11-19 12:38 ` [PATCH v3 7/7] arm64: dts: cix: Add GPU support for Sky1 Orion O6 Cunyuan Liu
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=20261119123850.2994625-3-cunyuan.liu@cixtech.com \
--to=cunyuan.liu@cixtech.com \
--cc=aliceryhl@google.com \
--cc=boris.brezillon@collabora.com \
--cc=cix-kernel-upstream@cixtech.com \
--cc=conor+dt@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=daniel@fooishbar.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fugang.duan@cixtech.com \
--cc=gary.yang@cixtech.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=robin.wang@cixtech.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=steven.price@arm.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®