浏览代码

disp: msm: dp: modify hdcp wait loop to not add to cpu load

Currently, hdcp wait loops uses the wait_event() macro which sets the
status of the thread to WAIT_UNINTERRUPTIBLE and contributes to system
load. The macro wait_event_idle() polls for a changing condition in the
same way but instead sets the thread status to WAIT_IDLE which does not
contribute to system load. This prevents hdcp threads from appearing as
hung threads in system load summaries while still properly polling for
status changes.

Change-Id: Ie6991881d912ba6fca6bb0fd9558633b1fb83492
Signed-off-by: Andrew Bartfeld <[email protected]>
Andrew Bartfeld 2 年之前
父节点
当前提交
c7d1996e90
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 2 2
      msm/dp/dp_hdcp2p2.c
  2. 2 1
      msm/sde_hdcp_2x.c

+ 2 - 2
msm/dp/dp_hdcp2p2.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -877,7 +877,7 @@ static int dp_hdcp2p2_main(void *data)
 	enum hdcp_transport_wakeup_cmd cmd;
 
 	while (1) {
-		wait_event(ctrl->wait_q,
+		wait_event_idle(ctrl->wait_q,
 			!kfifo_is_empty(&ctrl->cmd_q) ||
 			kthread_should_stop() ||
 			kthread_should_park());

+ 2 - 1
msm/sde_hdcp_2x.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -970,7 +971,7 @@ static int sde_hdcp_2x_main(void *data)
 	enum sde_hdcp_2x_wakeup_cmd cmd;
 
 	while (1) {
-		wait_event(hdcp->wait_q,
+		wait_event_idle(hdcp->wait_q,
 			!kfifo_is_empty(&hdcp->cmd_q) ||
 			kthread_should_stop() ||
 			kthread_should_park());