All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
@ 2021-05-20  6:44 ` Pi-Hsun Shih
  0 siblings, 0 replies; 8+ messages in thread
From: Pi-Hsun Shih @ 2021-05-20  6:44 UTC (permalink / raw)
  Cc: Pi-Hsun Shih, Tzung-Bi Shih, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	David Airlie, Daniel Vetter, Xin Ji, Hsin-Yi Wang,
	open list:DRM DRIVERS, open list

Originally when using pm_runtime_put, there's a chance that the runtime
suspend hook will be run after the following anx7625_bridge_mode_set
call, resulting in the display_timing_valid field to be cleared, and the
following power on fail.

Change all pm_runtime_put to pm_runtime_put_sync, so all power off
operations are guaranteed to be done after the call returns.

Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 29493cc2d300..7519b7a0f29d 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1255,7 +1255,7 @@ static struct edid *anx7625_get_edid(struct anx7625_data *ctx)
 
 	pm_runtime_get_sync(dev);
 	edid_num = sp_tx_edid_read(ctx, p_edid->edid_raw_data);
-	pm_runtime_put(dev);
+	pm_runtime_put_sync(dev);
 
 	if (edid_num < 1) {
 		DRM_DEV_ERROR(dev, "Fail to read EDID: %d\n", edid_num);
@@ -1573,7 +1573,7 @@ static void anx7625_bridge_disable(struct drm_bridge *bridge)
 
 	anx7625_dp_stop(ctx);
 
-	pm_runtime_put(dev);
+	pm_runtime_put_sync(dev);
 }
 
 static enum drm_connector_status

base-commit: 7a42b92b6d30c3f09629c7d5ada9e3de2aba01af
-- 
2.31.1.751.gd2f1c929bd-goog


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

* [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
@ 2021-05-20  6:44 ` Pi-Hsun Shih
  0 siblings, 0 replies; 8+ messages in thread
From: Pi-Hsun Shih @ 2021-05-20  6:44 UTC (permalink / raw)
  Cc: Jernej Skrabec, Neil Armstrong, David Airlie,
	open list:DRM DRIVERS, Jonas Karlman, open list, Robert Foss,
	Andrzej Hajda, Tzung-Bi Shih, Laurent Pinchart, Pi-Hsun Shih,
	Hsin-Yi Wang, Xin Ji

Originally when using pm_runtime_put, there's a chance that the runtime
suspend hook will be run after the following anx7625_bridge_mode_set
call, resulting in the display_timing_valid field to be cleared, and the
following power on fail.

Change all pm_runtime_put to pm_runtime_put_sync, so all power off
operations are guaranteed to be done after the call returns.

Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
---
 drivers/gpu/drm/bridge/analogix/anx7625.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 29493cc2d300..7519b7a0f29d 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -1255,7 +1255,7 @@ static struct edid *anx7625_get_edid(struct anx7625_data *ctx)
 
 	pm_runtime_get_sync(dev);
 	edid_num = sp_tx_edid_read(ctx, p_edid->edid_raw_data);
-	pm_runtime_put(dev);
+	pm_runtime_put_sync(dev);
 
 	if (edid_num < 1) {
 		DRM_DEV_ERROR(dev, "Fail to read EDID: %d\n", edid_num);
@@ -1573,7 +1573,7 @@ static void anx7625_bridge_disable(struct drm_bridge *bridge)
 
 	anx7625_dp_stop(ctx);
 
-	pm_runtime_put(dev);
+	pm_runtime_put_sync(dev);
 }
 
 static enum drm_connector_status

base-commit: 7a42b92b6d30c3f09629c7d5ada9e3de2aba01af
-- 
2.31.1.751.gd2f1c929bd-goog


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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
  2021-05-20  6:44 ` Pi-Hsun Shih
@ 2021-05-20 10:12   ` Tzung-Bi Shih
  -1 siblings, 0 replies; 8+ messages in thread
From: Tzung-Bi Shih @ 2021-05-20 10:12 UTC (permalink / raw)
  To: Pi-Hsun Shih
  Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, Hsin-Yi Wang, open list:DRM DRIVERS, open list

On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>

Tested-by: Tzung-Bi Shih <tzungbi@google.com>

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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
@ 2021-05-20 10:12   ` Tzung-Bi Shih
  0 siblings, 0 replies; 8+ messages in thread
From: Tzung-Bi Shih @ 2021-05-20 10:12 UTC (permalink / raw)
  To: Pi-Hsun Shih
  Cc: Jonas Karlman, David Airlie, Robert Foss, open list:DRM DRIVERS,
	Neil Armstrong, open list, Jernej Skrabec, Andrzej Hajda,
	Laurent Pinchart, Hsin-Yi Wang, Xin Ji

On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>

Tested-by: Tzung-Bi Shih <tzungbi@google.com>

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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
  2021-05-20 10:12   ` Tzung-Bi Shih
@ 2021-05-20 10:25     ` Robert Foss
  -1 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2021-05-20 10:25 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Pi-Hsun Shih, Andrzej Hajda, Neil Armstrong, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, Hsin-Yi Wang, open list:DRM DRIVERS, open list

On Thu, 20 May 2021 at 12:12, Tzung-Bi Shih <tzungbi@google.com> wrote:
>
> On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> > Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> > Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
>
> Tested-by: Tzung-Bi Shih <tzungbi@google.com>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
@ 2021-05-20 10:25     ` Robert Foss
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2021-05-20 10:25 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Jonas Karlman, David Airlie, open list:DRM DRIVERS,
	Neil Armstrong, open list, Jernej Skrabec, Andrzej Hajda,
	Laurent Pinchart, Pi-Hsun Shih, Hsin-Yi Wang, Xin Ji

On Thu, 20 May 2021 at 12:12, Tzung-Bi Shih <tzungbi@google.com> wrote:
>
> On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> > Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> > Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
>
> Tested-by: Tzung-Bi Shih <tzungbi@google.com>

Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
  2021-05-20 10:25     ` Robert Foss
@ 2021-05-20 10:28       ` Robert Foss
  -1 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2021-05-20 10:28 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Pi-Hsun Shih, Andrzej Hajda, Neil Armstrong, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, David Airlie, Daniel Vetter,
	Xin Ji, Hsin-Yi Wang, open list:DRM DRIVERS, open list

Applied to drm-misc-next

On Thu, 20 May 2021 at 12:25, Robert Foss <robert.foss@linaro.org> wrote:
>
> On Thu, 20 May 2021 at 12:12, Tzung-Bi Shih <tzungbi@google.com> wrote:
> >
> > On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> > > Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> > > Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
> >
> > Tested-by: Tzung-Bi Shih <tzungbi@google.com>
>
> Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

* Re: [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend.
@ 2021-05-20 10:28       ` Robert Foss
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Foss @ 2021-05-20 10:28 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Jonas Karlman, David Airlie, open list:DRM DRIVERS,
	Neil Armstrong, open list, Jernej Skrabec, Andrzej Hajda,
	Laurent Pinchart, Pi-Hsun Shih, Hsin-Yi Wang, Xin Ji

Applied to drm-misc-next

On Thu, 20 May 2021 at 12:25, Robert Foss <robert.foss@linaro.org> wrote:
>
> On Thu, 20 May 2021 at 12:12, Tzung-Bi Shih <tzungbi@google.com> wrote:
> >
> > On Thu, May 20, 2021 at 2:45 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
> > > Fixes: 60487584a79a ("drm/bridge: anx7625: refactor power control to use runtime PM framework")
> > > Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
> >
> > Tested-by: Tzung-Bi Shih <tzungbi@google.com>
>
> Reviewed-by: Robert Foss <robert.foss@linaro.org>

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

end of thread, other threads:[~2021-05-20 12:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  6:44 [PATCH] drm/bridge: anx7625: Synchronously run runtime suspend Pi-Hsun Shih
2021-05-20  6:44 ` Pi-Hsun Shih
2021-05-20 10:12 ` Tzung-Bi Shih
2021-05-20 10:12   ` Tzung-Bi Shih
2021-05-20 10:25   ` Robert Foss
2021-05-20 10:25     ` Robert Foss
2021-05-20 10:28     ` Robert Foss
2021-05-20 10:28       ` Robert Foss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.