linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight
@ 2021-07-14 16:33 Douglas Anderson
  2021-07-14 18:48 ` Lyude Paul
  2021-07-15 15:05 ` Doug Anderson
  0 siblings, 2 replies; 3+ messages in thread
From: Douglas Anderson @ 2021-07-14 16:33 UTC (permalink / raw)
  To: Rajeev Nandan, Lyude Paul, Robert Foss
  Cc: Douglas Anderson, Daniel Vetter, David Airlie, Sam Ravnborg,
	Thierry Reding, dri-devel, linux-kernel

When I tried booting up a device that needed the DP AUX backlight, I
found an error in the logs:
  panel-simple-dp-aux: probe of aux-ti_sn65dsi86.aux.0 failed with error -110

The aux transfers were failing because the panel wasn't powered. Just
like when reading the EDID we need to power the panel when trying to
talk to it. Add the needed pm_runtime calls.

After I do this I can successfully probe the panel and adjust the
backlight on my board.

Fixes: bfd451403d70 ("drm/panel-simple: Support DP AUX backlight")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/gpu/drm/panel/panel-simple.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index e0a05f366ce6..9b286bd4444f 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -827,7 +827,10 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc,
 		goto disable_pm_runtime;
 
 	if (!panel->base.backlight && panel->aux) {
+		pm_runtime_get_sync(dev);
 		err = drm_panel_dp_aux_backlight(&panel->base, panel->aux);
+		pm_runtime_mark_last_busy(dev);
+		pm_runtime_put_autosuspend(dev);
 		if (err)
 			goto disable_pm_runtime;
 	}
-- 
2.32.0.93.g670b81a890-goog


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

* Re: [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight
  2021-07-14 16:33 [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight Douglas Anderson
@ 2021-07-14 18:48 ` Lyude Paul
  2021-07-15 15:05 ` Doug Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Lyude Paul @ 2021-07-14 18:48 UTC (permalink / raw)
  To: Douglas Anderson, Rajeev Nandan, Robert Foss
  Cc: Daniel Vetter, David Airlie, Sam Ravnborg, Thierry Reding,
	dri-devel, linux-kernel

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Wed, 2021-07-14 at 09:33 -0700, Douglas Anderson wrote:
> When I tried booting up a device that needed the DP AUX backlight, I
> found an error in the logs:
>   panel-simple-dp-aux: probe of aux-ti_sn65dsi86.aux.0 failed with error -
> 110
> 
> The aux transfers were failing because the panel wasn't powered. Just
> like when reading the EDID we need to power the panel when trying to
> talk to it. Add the needed pm_runtime calls.
> 
> After I do this I can successfully probe the panel and adjust the
> backlight on my board.
> 
> Fixes: bfd451403d70 ("drm/panel-simple: Support DP AUX backlight")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  drivers/gpu/drm/panel/panel-simple.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c
> b/drivers/gpu/drm/panel/panel-simple.c
> index e0a05f366ce6..9b286bd4444f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -827,7 +827,10 @@ static int panel_simple_probe(struct device *dev, const
> struct panel_desc *desc,
>                 goto disable_pm_runtime;
>  
>         if (!panel->base.backlight && panel->aux) {
> +               pm_runtime_get_sync(dev);
>                 err = drm_panel_dp_aux_backlight(&panel->base, panel->aux);
> +               pm_runtime_mark_last_busy(dev);
> +               pm_runtime_put_autosuspend(dev);
>                 if (err)
>                         goto disable_pm_runtime;
>         }

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight
  2021-07-14 16:33 [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight Douglas Anderson
  2021-07-14 18:48 ` Lyude Paul
@ 2021-07-15 15:05 ` Doug Anderson
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2021-07-15 15:05 UTC (permalink / raw)
  To: Rajeev Nandan, Lyude Paul, Robert Foss
  Cc: Daniel Vetter, David Airlie, Sam Ravnborg, Thierry Reding,
	dri-devel, LKML

Hi,

On Wed, Jul 14, 2021 at 9:34 AM Douglas Anderson <dianders@chromium.org> wrote:
>
> When I tried booting up a device that needed the DP AUX backlight, I
> found an error in the logs:
>   panel-simple-dp-aux: probe of aux-ti_sn65dsi86.aux.0 failed with error -110
>
> The aux transfers were failing because the panel wasn't powered. Just
> like when reading the EDID we need to power the panel when trying to
> talk to it. Add the needed pm_runtime calls.
>
> After I do this I can successfully probe the panel and adjust the
> backlight on my board.
>
> Fixes: bfd451403d70 ("drm/panel-simple: Support DP AUX backlight")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>
>  drivers/gpu/drm/panel/panel-simple.c | 3 +++
>  1 file changed, 3 insertions(+)

Pushed with Lyude's review to drm-misc-next:

5ead9b5b1575 drm/panel-simple: Power the panel when probing DP AUX backlight

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

end of thread, other threads:[~2021-07-15 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 16:33 [PATCH] drm/panel-simple: Power the panel when probing DP AUX backlight Douglas Anderson
2021-07-14 18:48 ` Lyude Paul
2021-07-15 15:05 ` Doug Anderson

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).