imx.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/panthor: attach the driver's multiple power domains
@ 2025-10-13  9:34 Rain Yang
  2025-10-20  7:59 ` Steven Price
  0 siblings, 1 reply; 2+ messages in thread
From: Rain Yang @ 2025-10-13  9:34 UTC (permalink / raw)
  To: imx, dri-devel, linux-kernel
  Cc: boris.brezillon, steven.price, liviu.dudau, maarten.lankhorst,
	mripard, tzimmermann, airlied, simona, xianzhong.li, Rain Yang,
	Prabhu Sundararaj

From: Rain Yang <jiyu.yang@nxp.com>

Some platforms, such as i.MX95, utilize multiple power domains that need
to be attached explicitly. This patch ensures that the driver properly
attaches all available power domains using devm_pm_domain_attach_list().

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
Signed-off-by: Rain Yang <jiyu.yang@nxp.com>
---
 drivers/gpu/drm/panthor/panthor_device.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
index f0b2da5b2b96..fbbc84e9efbe 100644
--- a/drivers/gpu/drm/panthor/panthor_device.c
+++ b/drivers/gpu/drm/panthor/panthor_device.c
@@ -167,6 +167,7 @@ static void panthor_device_free_page(struct drm_device *ddev, void *data)
 int panthor_device_init(struct panthor_device *ptdev)
 {
 	u32 *dummy_page_virt;
+	struct dev_pm_domain_list  *pd_list = NULL;
 	struct resource *res;
 	struct page *p;
 	int ret;
@@ -218,6 +219,12 @@ int panthor_device_init(struct panthor_device *ptdev)
 	if (ret)
 		return ret;
 
+	ret = devm_pm_domain_attach_list(ptdev->base.dev, NULL, &pd_list);
+	if (ret < 0) {
+		drm_err(&ptdev->base, "attach power domains failed, ret=%d", ret);
+		return ret;
+	}
+
 	ret = panthor_devfreq_init(ptdev);
 	if (ret)
 		return ret;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/panthor: attach the driver's multiple power domains
  2025-10-13  9:34 [PATCH v2] drm/panthor: attach the driver's multiple power domains Rain Yang
@ 2025-10-20  7:59 ` Steven Price
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Price @ 2025-10-20  7:59 UTC (permalink / raw)
  To: Rain Yang, imx, dri-devel, linux-kernel
  Cc: boris.brezillon, liviu.dudau, maarten.lankhorst, mripard,
	tzimmermann, airlied, simona, xianzhong.li, Rain Yang,
	Prabhu Sundararaj

On 13/10/2025 10:34, Rain Yang wrote:
> From: Rain Yang <jiyu.yang@nxp.com>
> 
> Some platforms, such as i.MX95, utilize multiple power domains that need
> to be attached explicitly. This patch ensures that the driver properly
> attaches all available power domains using devm_pm_domain_attach_list().
> 
> Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
> Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
> Signed-off-by: Rain Yang <jiyu.yang@nxp.com>
> ---
>  drivers/gpu/drm/panthor/panthor_device.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c
> index f0b2da5b2b96..fbbc84e9efbe 100644
> --- a/drivers/gpu/drm/panthor/panthor_device.c
> +++ b/drivers/gpu/drm/panthor/panthor_device.c
> @@ -167,6 +167,7 @@ static void panthor_device_free_page(struct drm_device *ddev, void *data)
>  int panthor_device_init(struct panthor_device *ptdev)
>  {
>  	u32 *dummy_page_virt;
> +	struct dev_pm_domain_list  *pd_list = NULL;
>  	struct resource *res;
>  	struct page *p;
>  	int ret;
> @@ -218,6 +219,12 @@ int panthor_device_init(struct panthor_device *ptdev)
>  	if (ret)
>  		return ret;
>  
> +	ret = devm_pm_domain_attach_list(ptdev->base.dev, NULL, &pd_list);
> +	if (ret < 0) {
> +		drm_err(&ptdev->base, "attach power domains failed, ret=%d", ret);
> +		return ret;

This fails on the rock-5b. I believe because the PM code automatically 
attaches a single power domain (as on the rock-5b) so this then returns 
-EEXIST:

[   11.433501] panthor fb000000.gpu: [drm] *ERROR* attach power domains failed, ret=-17

I notice that the tegra driver checks dev->pm_domain and only calls 
devm_pm_domain_attach_list if that is NULL.

Thanks,
Steve

> +	}
> +
>  	ret = panthor_devfreq_init(ptdev);
>  	if (ret)
>  		return ret;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-20  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13  9:34 [PATCH v2] drm/panthor: attach the driver's multiple power domains Rain Yang
2025-10-20  7:59 ` Steven Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).