Re: [PATCH v1 2/2] drm/panthor: treat sram as mandatory except mt8196
From: Onur Özkan
Date: Mon Feb 16 2026 - 09:42:37 EST
On Mon, 16 Feb 2026 10:37:43 +0100
Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> wrote:
> On Sun, 15 Feb 2026 13:02:51 +0300
> Onur Özkan <work@xxxxxxxxxxxxx> wrote:
>
> > 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@xxxxxxxxxxxxx>
> > ---
> > 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")) {
>
> Rather than checking for specific compats here, let's go for
> a dont_need_sram_supply bool in panthor_soc_data.
>
Makes sense.
> > + ret = devm_regulator_get_enable_optional(dev,
> > "sram");
>
> If we assume SRAM supply is mandatory, should this be
> devm_regulator_get_enable() instead?
>
That was the first thing I did but when I tested it, it didn't work as
expected because devm_regulator_get_enable() fell back to the dummy
regulator without returning an error.
Regards,
Onur
> > + 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);
>