]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0006-drm-i915-Avoid-HPD-poll-detect-triggering-a-new-dete.patch
rebase patches on top of Ubuntu-5.3.0-40.32
[pve-kernel.git] / patches / kernel / 0006-drm-i915-Avoid-HPD-poll-detect-triggering-a-new-dete.patch
CommitLineData
34fce89f
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Imre Deak <imre.deak@intel.com>
3Date: Mon, 28 Oct 2019 20:15:17 +0200
4Subject: [PATCH] drm/i915: Avoid HPD poll detect triggering a new detect cycle
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9For the HPD interrupt functionality the HW depends on power wells in the
10display core domain to be on. Accordingly when enabling these power
11wells the HPD polling logic will force an HPD detection cycle to account
12for hotplug events that may have happened when such a power well was
13off.
14
15Thus a detect cycle started by polling could start a new detect cycle if
16a power well in the display core domain gets enabled during detect and
17stays enabled after detect completes. That in turn can lead to a
18detection cycle runaway.
19
20To prevent re-triggering a poll-detect cycle make sure we drop all power
21references we acquired during detect synchronously by the end of detect.
22This will let the poll-detect logic continue with polling (matching the
23off state of the corresponding power wells) instead of scheduling a new
24detection cycle.
25
26Fixes: 6cfe7ec02e85 ("drm/i915: Remove the unneeded AUX power ref from intel_dp_detect()")
27Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112125
28Reported-and-tested-by: Val Kulkov <val.kulkov@gmail.com>
29Reported-and-tested-by: wangqr <wqr.prg@gmail.com>
30Cc: Val Kulkov <val.kulkov@gmail.com>
31Cc: wangqr <wqr.prg@gmail.com>
32Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
33Signed-off-by: Imre Deak <imre.deak@intel.com>
34Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
35Link: https://patchwork.freedesktop.org/patch/msgid/20191028181517.22602-1-imre.deak@intel.com
36(cherry picked from commit a8ddac7c9f06a12227a4f5febd1cbe0575a33179)
37Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
38---
39 drivers/gpu/drm/i915/display/intel_crt.c | 7 +++++++
40 drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++
41 drivers/gpu/drm/i915/display/intel_hdmi.c | 6 ++++++
42 3 files changed, 19 insertions(+)
43
44diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
45index 3fcf2f84bcce..da1d6be46a0c 100644
46--- a/drivers/gpu/drm/i915/display/intel_crt.c
47+++ b/drivers/gpu/drm/i915/display/intel_crt.c
48@@ -867,6 +867,13 @@ intel_crt_detect(struct drm_connector *connector,
49
50 out:
51 intel_display_power_put(dev_priv, intel_encoder->power_domain, wakeref);
52+
53+ /*
54+ * Make sure the refs for power wells enabled during detect are
55+ * dropped to avoid a new detect cycle triggered by HPD polling.
56+ */
57+ intel_display_power_flush_work(dev_priv);
58+
59 return status;
60 }
61
62diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
6ad15537 63index 305abddc274a..dbdd46ba9bfe 100644
34fce89f
TL
64--- a/drivers/gpu/drm/i915/display/intel_dp.c
65+++ b/drivers/gpu/drm/i915/display/intel_dp.c
66@@ -5649,6 +5649,12 @@ intel_dp_detect(struct drm_connector *connector,
67 if (status != connector_status_connected && !intel_dp->is_mst)
68 intel_dp_unset_edid(intel_dp);
69
70+ /*
71+ * Make sure the refs for power wells enabled during detect are
72+ * dropped to avoid a new detect cycle triggered by HPD polling.
73+ */
74+ intel_display_power_flush_work(dev_priv);
75+
76 return status;
77 }
78
79diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
80index 7ffdfaae7188..5d5453461a6f 100644
81--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
82+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
83@@ -2571,6 +2571,12 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
84 if (status != connector_status_connected)
85 cec_notifier_phys_addr_invalidate(intel_hdmi->cec_notifier);
86
87+ /*
88+ * Make sure the refs for power wells enabled during detect are
89+ * dropped to avoid a new detect cycle triggered by HPD polling.
90+ */
91+ intel_display_power_flush_work(dev_priv);
92+
93 return status;
94 }
95