lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 21 Apr 2021 13:46:04 -0700
From:   Kuogee Hsieh <khsieh@...eaurora.org>
To:     robdclark@...il.com, sean@...rly.run, swboyd@...omium.org
Cc:     abhinavk@...eaurora.org, aravindh@...eaurora.org,
        khsieh@...eaurora.org, airlied@...ux.ie, daniel@...ll.ch,
        linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] drm/msm/dp: service only one irq_hpd if there are multiple irq_hpd pending

irq_hpd is an asynchronous event generated by panel to bring up attention
of host. It could only be generated at run time of normal operation and
it is not possible to be generated while main link is down. Therefore no
need to handle irq_hpd if main link is down, such as cable unplug or system
suspended. To handle irq_hpd, host has to read DPCD out of panel to figure
out what action requested and perform that action accordingly. Also only
handle the latest irq_hpd if there are multiple irq_hpd pending at the time
of service since panel contains only the latest irq_hpd request status.

Changes in v2:
-- re wording of commit test

Signed-off-by: Kuogee Hsieh <khsieh@...eaurora.org>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 5a39da6..1107c4e 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -707,6 +707,12 @@ static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data)
 		return 0;
 	}
 
+	/*
+	 * handle only one irq_hpd in case of multiple irq_hpd pending
+	 * since panel contains the lateset request at this time
+	 */
+	dp_del_event(dp, EV_IRQ_HPD_INT);
+
 	ret = dp_display_usbpd_attention_cb(&dp->pdev->dev);
 	if (ret == -ECONNRESET) { /* cable unplugged */
 		dp->core_initialized = false;
@@ -1300,6 +1306,9 @@ static int dp_pm_suspend(struct device *dev)
 	/* host_init will be called at pm_resume */
 	dp->core_initialized = false;
 
+	/* suspending, no need to handle pending irq_hdps */
+	dp_del_event(dp, EV_IRQ_HPD_INT);
+
 	mutex_unlock(&dp->event_mutex);
 
 	return 0;
@@ -1496,6 +1505,9 @@ int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder)
 	/* stop sentinel checking */
 	dp_del_event(dp_display, EV_DISCONNECT_PENDING_TIMEOUT);
 
+	/* link is teared down, no need to handle pending irq_hdps */
+	dp_del_event(dp_display, EV_IRQ_HPD_INT);
+
 	dp_display_disable(dp_display, 0);
 
 	rc = dp_display_unprepare(dp);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ