mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails
@ 2026-11-29 13:43 Jiawen Liu
  2026-11-30 22:19 ` Doug Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jiawen Liu @ 2026-11-29 13:43 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Douglas Anderson, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Luca Ceresoli, dri-devel, linux-kernel

ti_sn_pwm_probe() ignored a failure from devm_pm_runtime_enable(). The
helper rolls runtime PM back when action registration fails, but the
probe could then successfully register the PWM chip. A later PWM apply
operation would be unable to resume the auxiliary device.

Propagate the runtime PM setup error before registering the PWM chip.

Fixes: eb3f7cbee294 ("drm/bridge: ti-sn65dsi86: Associate PWM device to auxiliary device")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 48b83df9aed61..bbf9491059375 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -1721,6 +1721,7 @@ static int ti_sn_pwm_probe(struct auxiliary_device *adev,
 {
 	struct pwm_chip *chip;
 	struct ti_sn65dsi86 *pdata = dev_get_drvdata(adev->dev.parent);
+	int ret;
 
 	pdata->pchip = chip = devm_pwmchip_alloc(&adev->dev, 1, 0);
 	if (IS_ERR(chip))
@@ -1731,7 +1732,9 @@ static int ti_sn_pwm_probe(struct auxiliary_device *adev,
 	chip->ops = &ti_sn_pwm_ops;
 	chip->of_xlate = of_pwm_single_xlate;
 
-	devm_pm_runtime_enable(&adev->dev);
+	ret = devm_pm_runtime_enable(&adev->dev);
+	if (ret)
+		return ret;
 
 	return pwmchip_add(chip);
 }
-- 
2.34.1


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

* Re: [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails
  2026-11-29 13:43 [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails Jiawen Liu
@ 2026-11-30 22:19 ` Doug Anderson
  2026-12-01  8:44 ` Luca Ceresoli
  2026-12-01 12:24 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Doug Anderson @ 2026-11-30 22:19 UTC (permalink / raw)
  To: Jiawen Liu
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
	dri-devel, linux-kernel

Hi,

On Sun, Nov 29, 2026 at 5:44 AM Jiawen Liu <1298662399@qq.com> wrote:
>
> ti_sn_pwm_probe() ignored a failure from devm_pm_runtime_enable(). The
> helper rolls runtime PM back when action registration fails, but the
> probe could then successfully register the PWM chip. A later PWM apply
> operation would be unable to resume the auxiliary device.
>
> Propagate the runtime PM setup error before registering the PWM chip.
>
> Fixes: eb3f7cbee294 ("drm/bridge: ti-sn65dsi86: Associate PWM device to auxiliary device")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>
> ---
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

Unless something else comes up (or someone else feels like landing it
sooner), I'll plan to apply this to drm-misc-next next week. This
doesn't feel important enough to land in drm-misc-fixes.

-Doug

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

* Re: [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails
  2026-11-29 13:43 [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails Jiawen Liu
  2026-11-30 22:19 ` Doug Anderson
@ 2026-12-01  8:44 ` Luca Ceresoli
  2026-12-01 12:24 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2026-12-01  8:44 UTC (permalink / raw)
  To: Jiawen Liu, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: Douglas Anderson, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Luca Ceresoli, dri-devel, linux-kernel

On Sun Nov 29, 2026 at 2:43 PM CET, Jiawen Liu wrote:
> ti_sn_pwm_probe() ignored a failure from devm_pm_runtime_enable(). The
> helper rolls runtime PM back when action registration fails, but the
> probe could then successfully register the PWM chip. A later PWM apply
> operation would be unable to resume the auxiliary device.
>
> Propagate the runtime PM setup error before registering the PWM chip.
>
> Fixes: eb3f7cbee294 ("drm/bridge: ti-sn65dsi86: Associate PWM device to auxiliary device")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails
  2026-11-29 13:43 [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails Jiawen Liu
  2026-11-30 22:19 ` Doug Anderson
  2026-12-01  8:44 ` Luca Ceresoli
@ 2026-12-01 12:24 ` Markus Elfring
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2026-12-01 12:24 UTC (permalink / raw)
  To: Jiawen Liu, dri-devel, Andrzej Hajda, David Airlie,
	Maarten Lankhorst, Maxime Ripard, Neil Armstrong, Robert Foss,
	Simona Vetter, Thomas Zimmermann
  Cc: LKML, Douglas Anderson, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Luca Ceresoli

…
> Propagate the runtime PM setup error before registering the PWM chip.

Would you become interested in further source code analysis approaches?

Example:
[RFC] Detecting unchecked return values (with SmPL)?
https://lore.kernel.org/kernel-janitors/31f114eb-f7bc-4160-bf05-3229980c951f@web.de/

Regards,
Markus

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

end of thread, other threads:[~2026-12-01 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 13:43 [PATCH] drm/bridge: ti-sn65dsi86: fail PWM probe if runtime PM setup fails Jiawen Liu
2026-11-30 22:19 ` Doug Anderson
2026-12-01  8:44 ` Luca Ceresoli
2026-12-01 12:24 ` Markus Elfring

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®