[PATCH v3 3/8] drm/imagination: Use pwrseq for TH1520 GPU power management
Michal Wilczynski
m.wilczynski at samsung.com
Fri Jun 13 08:25:38 UTC 2025
On 6/13/25 08:44, Krzysztof Kozlowski wrote:
> On 11/06/2025 14:01, Michal Wilczynski wrote:
>>
>> However, this leads me back to a fundamental issue with the
>> consumer side implementation in the generic pvr_device.c driver. The
>> current fallback code is:
>>
>> /*
>> * If the error is -EPROBE_DEFER, it's because the
>> * optional sequencer provider is not present
>> * and it's safe to fall back on manual power-up.
>> */
>> if (pwrseq_err == -EPROBE_DEFER)
>> pvr_dev->pwrseq = NULL;
>>
>> As Krzysztof noted, simply ignoring -EPROBE_DEFER is not ideal. But if I
>> change this to a standard deferred probe, the pvr_device.c driver will
>
> Why? You have specific compatible for executing such quirks only for
> given platform.
This is due to how the pwrseq API works; it constructs a bus on which
provider devices may appear at any time. With the current API, there is
no way to express that a provider for a specific target will never
appear. ('gpu-power' is the generic target name, and of course, more
specific binding is handled in the provider's .match callback - based on
the compatible and the node phandle like discussed previously).
For all other supported SoCs, no such provider will ever appear on the
bus, and the current pwrseq API doesn't allow a generic consumer to know
this.
However, your suggestion of handling this with a platform specific
driver is a good path forward. It would still require a minimal addition
to the pwrseq API to work. For example, a new SoC specific driver for
"thead,th1520" could call a new function like
pwrseq_enable_optional_target("gpu-power") during its probe. This would
signal to the pwrseq core that this target is expected on the platform.
Therefore, when the Imagination driver later calls pwrseq_get() on a
TH1520, it would correctly result in either a match or a deferral.
On all other platforms, this optional target would not be enabled. The
pwrseq_get() call would then immediately return -ENODEV instead of
deferring, which solves the problem and allows the other supported SoCs
to probe correctly.
I wonder whether Bartosz would be okay with such an addition.
>
>> break on all other supported SoCs. It would wait indefinitely for a
>> pwrseq-thead-gpu provider that will never appear on those platforms.
>>
>
>
>
> Best regards,
> Krzysztof
>
Best regards,
--
Michal Wilczynski <m.wilczynski at samsung.com>
More information about the dri-devel
mailing list