]>
Commit | Line | Data |
---|---|---|
34fce89f TL |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Imre Deak <imre.deak@intel.com> | |
3 | Date: Mon, 28 Oct 2019 20:15:17 +0200 | |
4 | Subject: [PATCH] drm/i915: Avoid HPD poll detect triggering a new detect cycle | |
5 | MIME-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | For the HPD interrupt functionality the HW depends on power wells in the | |
10 | display core domain to be on. Accordingly when enabling these power | |
11 | wells the HPD polling logic will force an HPD detection cycle to account | |
12 | for hotplug events that may have happened when such a power well was | |
13 | off. | |
14 | ||
15 | Thus a detect cycle started by polling could start a new detect cycle if | |
16 | a power well in the display core domain gets enabled during detect and | |
17 | stays enabled after detect completes. That in turn can lead to a | |
18 | detection cycle runaway. | |
19 | ||
20 | To prevent re-triggering a poll-detect cycle make sure we drop all power | |
21 | references we acquired during detect synchronously by the end of detect. | |
22 | This will let the poll-detect logic continue with polling (matching the | |
23 | off state of the corresponding power wells) instead of scheduling a new | |
24 | detection cycle. | |
25 | ||
26 | Fixes: 6cfe7ec02e85 ("drm/i915: Remove the unneeded AUX power ref from intel_dp_detect()") | |
27 | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112125 | |
28 | Reported-and-tested-by: Val Kulkov <val.kulkov@gmail.com> | |
29 | Reported-and-tested-by: wangqr <wqr.prg@gmail.com> | |
30 | Cc: Val Kulkov <val.kulkov@gmail.com> | |
31 | Cc: wangqr <wqr.prg@gmail.com> | |
32 | Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> | |
33 | Signed-off-by: Imre Deak <imre.deak@intel.com> | |
34 | Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> | |
35 | Link: https://patchwork.freedesktop.org/patch/msgid/20191028181517.22602-1-imre.deak@intel.com | |
36 | (cherry picked from commit a8ddac7c9f06a12227a4f5febd1cbe0575a33179) | |
37 | Signed-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 | ||
44 | diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c | |
45 | index 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 | ||
62 | diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c | |
6ad15537 | 63 | index 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 | ||
79 | diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c | |
80 | index 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 |