* [PATCH v2] drm/msm/dp: check hpd_state before push idle pattern at dp_bridge_disable()
@ 2022-08-10 17:22 Kuogee Hsieh
2022-08-10 18:06 ` Abhinav Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Kuogee Hsieh @ 2022-08-10 17:22 UTC (permalink / raw)
To: robdclark, sean, swboyd, dianders, vkoul, daniel, airlied,
agross, dmitry.baryshkov, bjorn.andersson
Cc: quic_abhinavk, quic_aravindh, quic_khsieh, quic_sbillaka,
freedreno, dri-devel, linux-arm-msm, linux-kernel
dp_bridge_disable() is the first step toward tearing down main link.
Its major function is to start transmitting idle pattern to replace
video stream. This patch will check hpd_state to make sure main link
is enabled before commit changes of main link's configuration to
push idle pattern out to avoid system crashing due to main link clock
is disabled while access main link registers.
Changes in v2:
-- changes Fixes patch
-- fix eported-by
-- add Closes tag
Fixes: 375a126090b9 ("drm/msm/dp: tear down main link at unplug handle immediately")
Reported-by: leonard@lausen.nl
Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/17
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
drivers/gpu/drm/msm/dp/dp_display.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index b36f8b6..678289a 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -1729,10 +1729,20 @@ void dp_bridge_disable(struct drm_bridge *drm_bridge)
struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
struct msm_dp *dp = dp_bridge->dp_display;
struct dp_display_private *dp_display;
+ u32 state;
dp_display = container_of(dp, struct dp_display_private, dp_display);
+ mutex_lock(&dp_display->event_mutex);
+
+ state = dp_display->hpd_state;
+ if (state != ST_DISCONNECT_PENDING && state != ST_CONNECTED) {
+ mutex_unlock(&dp_display->event_mutex);
+ return;
+ }
+
dp_ctrl_push_idle(dp_display->ctrl);
+ mutex_unlock(&dp_display->event_mutex);
}
void dp_bridge_post_disable(struct drm_bridge *drm_bridge)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] drm/msm/dp: check hpd_state before push idle pattern at dp_bridge_disable()
2022-08-10 17:22 [PATCH v2] drm/msm/dp: check hpd_state before push idle pattern at dp_bridge_disable() Kuogee Hsieh
@ 2022-08-10 18:06 ` Abhinav Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Abhinav Kumar @ 2022-08-10 18:06 UTC (permalink / raw)
To: Kuogee Hsieh, robdclark, sean, swboyd, dianders, vkoul, daniel,
airlied, agross, dmitry.baryshkov, bjorn.andersson
Cc: quic_aravindh, quic_sbillaka, freedreno, dri-devel,
linux-arm-msm, linux-kernel
On 8/10/2022 10:22 AM, Kuogee Hsieh wrote:
> dp_bridge_disable() is the first step toward tearing down main link.
> Its major function is to start transmitting idle pattern to replace
> video stream. This patch will check hpd_state to make sure main link
> is enabled before commit changes of main link's configuration to
> push idle pattern out to avoid system crashing due to main link clock
> is disabled while access main link registers.
Do you also want to give the full stack of unclocked access here?
>
> Changes in v2:
> -- changes Fixes patch
> -- fix eported-by
> -- add Closes tag
>
> Fixes: 375a126090b9 ("drm/msm/dp: tear down main link at unplug handle immediately")
> Reported-by: leonard@lausen.nl
This is still incorrect. Should be:
Reported-by: Leonard Lausen <leonard@lausen.nl>
> Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/17
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
> drivers/gpu/drm/msm/dp/dp_display.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index b36f8b6..678289a 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1729,10 +1729,20 @@ void dp_bridge_disable(struct drm_bridge *drm_bridge)
> struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge);
> struct msm_dp *dp = dp_bridge->dp_display;
> struct dp_display_private *dp_display;
> + u32 state;
>
> dp_display = container_of(dp, struct dp_display_private, dp_display);
>
> + mutex_lock(&dp_display->event_mutex);
> +
> + state = dp_display->hpd_state;
> + if (state != ST_DISCONNECT_PENDING && state != ST_CONNECTED) {
> + mutex_unlock(&dp_display->event_mutex);
> + return;
> + }
> +
> dp_ctrl_push_idle(dp_display->ctrl);
> + mutex_unlock(&dp_display->event_mutex);
> }
>
> void dp_bridge_post_disable(struct drm_bridge *drm_bridge)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-10 18:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 17:22 [PATCH v2] drm/msm/dp: check hpd_state before push idle pattern at dp_bridge_disable() Kuogee Hsieh
2022-08-10 18:06 ` Abhinav Kumar
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®