[PATCH 11/11] drm/amd/display: fix events handling for hdcp
Bhawanpreet Lakha
Bhawanpreet.Lakha at amd.com
Thu Oct 3 14:54:41 UTC 2019
[Why]
When we execute a event, pending events should be canceled. This leads
to cases where we execute the same event twice,if the new event is
scheduled to run before the old event.
Also watchdog event was being canceled inside callback event. This is
incorrect.
[How]
Cancel pending events before executing the current and fix watchdog
event being canceled by callback event
Change-Id: I3c595901d63f3393c83d898cdb2d7dfc1a769142
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index 603909416398..715f650715b3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -169,7 +169,7 @@ static void event_callback(struct work_struct *work)
mutex_lock(&hdcp_work->mutex);
- cancel_delayed_work(&hdcp_work->watchdog_timer_dwork);
+ cancel_delayed_work(&hdcp_work->callback_dwork);
mod_hdcp_process_event(&hdcp_work->hdcp, MOD_HDCP_EVENT_CALLBACK,
&hdcp_work->output);
@@ -247,6 +247,8 @@ static void event_watchdog_timer(struct work_struct *work)
mutex_lock(&hdcp_work->mutex);
+ cancel_delayed_work(&hdcp_work->watchdog_timer_dwork);
+
mod_hdcp_process_event(&hdcp_work->hdcp,
MOD_HDCP_EVENT_WATCHDOG_TIMEOUT,
&hdcp_work->output);
--
2.17.1
More information about the amd-gfx
mailing list