[PATCH v1 2/2] drm/panthor: treat sram as mandatory except mt8196

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Mon Feb 16 03:44:39 PST 2026


Il 16/02/26 10:44, Boris Brezillon ha scritto:
> Hello Adam,
> 
> On Sun, 15 Feb 2026 16:21:34 -0600
> Adam Ford <aford173 at gmail.com> wrote:
> 
>> On Sun, Feb 15, 2026 at 4:04 AM Onur Özkan <work at onurozkan.dev> 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 at 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")) {
>>
>> I wonder if a more generic device tree flag would be better here.
> 
> No, we don't want it as a separate DT flag. This is all stuff we can
> hide behind the compat, and every bit we add to the DT we don't
> strictly need turns out to be a liability in the long run in general.
> 
>> What happens if others do the same as Mediatek or Mediatek decides to
>> do this with more processors and this list grows?
> 
> That's what panthor_soc_data is for: you can attach per-compat
> properties without polluting the DT with more stuff that can be
> directly inferred from the compatible.
> 
>> It seems like a
>> panthor binding might be useful to prevent future bloat.
> 
> It's actually the opposite, the more we add to the DT, the trickier it
> gets to maintain, because we tend to get those things wrong (is the
> SRAM really not needed on mt8196, or is this just a workaround to hide
> the fact the PM is deferred to some FW?).
> 

MT8196 has three supplies: core, stack, sram.

For example, the Google Rauru Chromebooks use those:

        core-supply = <&mt6373_vbuck7>;
        stack-supply = <&mt6316dp_vbuck0>;
        sram-supply = <&mt6316kp_vbuck1>;

As of now (in our midstream trees), these supplies are declared in the gpufreq
node (the performance domain controller), and required to be on whenever GPUEB
interaction is needed, other than whenever the GPU itself is, well, needed to
be powered.

As of the current model, these supplies are getting powered on and off along
with the MFG power domain.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c#n1005

I'm not sure what happens if we also add those to the GPU node... for this, I'm
adding Nicolas to the Ccs, as he is the one who developed support for EB.

Cheers,
Angelo

> Regards,
> 
> Boris





More information about the linux-arm-kernel mailing list