Hi, On Fri, Dec 8, 2023 at 9:30 AM Nikita Travkin <nikita@xxxxxxx> wrote: > > Uwe Kleine-König писал(а) 27.11.2023 15:15: > > It's the ti_sn65dsi86.pwm auxiliary driver that creates the pwmchip, so > > let the auxiliary device be the parent of the pwm device. > > > > Note that getting a reference to the ti-sn65dsi86's pwm using pwm_get() > > isn't affected by this change as ti_sn65dsi86_add_aux_device() sets the > > auxiliary device's of_node to that of the main device. > > > > Also change PM runtime tracking and diagnostic messages to use that one. > > As the PM runtime functions also handle parent devices this should work > > fine, too. > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> > > --- > > Hello, > > > > this patch has an (easy to resolve) conflict with a patch I sent earlier > > "drm/bridge: ti-sn65dsi86: Simplify using pm_runtime_resume_and_get()" > > (https://lore.kernel.org/dri-devel/20231123175425.496956-2-u.kleine-koenig@xxxxxxxxxxxxxx). > > I was unsure if I should base this new patch on that older one. > > > > While I think the patch is fine, I'd have a better feeling about it if > > someone could give feedback that the PWM still works as intended with > > this change. > > > > Hi, with this patch applied, pwm backlight fails to > probe on sc7180-acer-aspire1: > > [ 0.377853] pwm-backlight backlight: failed to apply initial PWM state: -13 > [ 0.378349] pwm-backlight: probe of backlight failed with error -13 > > Seems like the pwmchip device should get runtime_pm enabled? Glad you checked. Thanks! > The following patch seem to fix it. > > Nikita > > > diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > index 254f0039dad2..b6813f9f6a8f 100644 > --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c > +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c > @@ -1593,6 +1593,8 @@ static int ti_sn_pwm_probe(struct auxiliary_device *adev, > pdata->pchip.of_xlate = of_pwm_single_xlate; > pdata->pchip.of_pwm_n_cells = 1; > > + pm_runtime_enable(&adev->dev); > + I think you'd want devm_pm_runtime_enable(), which looks safe in this case. -Doug