<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/gpu/drm/display, branch v6.6.132</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>drm/display/dp_mst: Add protection against 0 vcpi</title>
<updated>2026-03-04T12:20:37+00:00</updated>
<author>
<name>Suraj Kandpal</name>
<email>suraj.kandpal@intel.com</email>
</author>
<published>2025-11-19T09:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=ac9a7c329a5610051fc476644c9b9145a5965ecb'/>
<id>ac9a7c329a5610051fc476644c9b9145a5965ecb</id>
<content type='text'>
[ Upstream commit 342ccffd9f77fc29fe1c05fd145e4d842bd2feaa ]

When releasing a timeslot there is a slight chance we may end up
with the wrong payload mask due to overflow if the delayed_destroy_work
ends up coming into play after a DP 2.1 monitor gets disconnected
which causes vcpi to become 0 then we try to make the payload =
~BIT(vcpi - 1) which is a negative shift. VCPI id should never
really be 0 hence skip changing the payload mask if VCPI is 0.

Otherwise it leads to
&lt;7&gt; [515.287237] xe 0000:03:00.0: [drm:drm_dp_mst_get_port_malloc
[drm_display_helper]] port ffff888126ce9000 (3)
&lt;4&gt; [515.287267] -----------[ cut here ]-----------
&lt;3&gt; [515.287268] UBSAN: shift-out-of-bounds in
../drivers/gpu/drm/display/drm_dp_mst_topology.c:4575:36
&lt;3&gt; [515.287271] shift exponent -1 is negative
&lt;4&gt; [515.287275] CPU: 7 UID: 0 PID: 3108 Comm: kworker/u64:33 Tainted: G
S U 6.17.0-rc6-lgci-xe-xe-3795-3e79699fa1b216e92+ #1 PREEMPT(voluntary)
&lt;4&gt; [515.287279] Tainted: [S]=CPU_OUT_OF_SPEC, [U]=USER
&lt;4&gt; [515.287279] Hardware name: ASUS System Product Name/PRIME Z790-P
WIFI, BIOS 1645 03/15/2024
&lt;4&gt; [515.287281] Workqueue: drm_dp_mst_wq drm_dp_delayed_destroy_work
[drm_display_helper]
&lt;4&gt; [515.287303] Call Trace:
&lt;4&gt; [515.287304] &lt;TASK&gt;
&lt;4&gt; [515.287306] dump_stack_lvl+0xc1/0xf0
&lt;4&gt; [515.287313] dump_stack+0x10/0x20
&lt;4&gt; [515.287316] __ubsan_handle_shift_out_of_bounds+0x133/0x2e0
&lt;4&gt; [515.287324] ? drm_atomic_get_private_obj_state+0x186/0x1d0
&lt;4&gt; [515.287333] drm_dp_atomic_release_time_slots.cold+0x17/0x3d
[drm_display_helper]
&lt;4&gt; [515.287355] mst_connector_atomic_check+0x159/0x180 [xe]
&lt;4&gt; [515.287546] drm_atomic_helper_check_modeset+0x4d9/0xfa0
&lt;4&gt; [515.287550] ? __ww_mutex_lock.constprop.0+0x6f/0x1a60
&lt;4&gt; [515.287562] intel_atomic_check+0x119/0x2b80 [xe]
&lt;4&gt; [515.287740] ? find_held_lock+0x31/0x90
&lt;4&gt; [515.287747] ? lock_release+0xce/0x2a0
&lt;4&gt; [515.287754] drm_atomic_check_only+0x6a2/0xb40
&lt;4&gt; [515.287758] ? drm_atomic_add_affected_connectors+0x12b/0x140
&lt;4&gt; [515.287765] drm_atomic_commit+0x6e/0xf0
&lt;4&gt; [515.287766] ? _pfx__drm_printfn_info+0x10/0x10
&lt;4&gt; [515.287774] drm_client_modeset_commit_atomic+0x25c/0x2b0
&lt;4&gt; [515.287794] drm_client_modeset_commit_locked+0x60/0x1b0
&lt;4&gt; [515.287795] ? mutex_lock_nested+0x1b/0x30
&lt;4&gt; [515.287801] drm_client_modeset_commit+0x26/0x50
&lt;4&gt; [515.287804] __drm_fb_helper_restore_fbdev_mode_unlocked+0xdc/0x110
&lt;4&gt; [515.287810] drm_fb_helper_hotplug_event+0x120/0x140
&lt;4&gt; [515.287814] drm_fbdev_client_hotplug+0x28/0xd0
&lt;4&gt; [515.287819] drm_client_hotplug+0x6c/0xf0
&lt;4&gt; [515.287824] drm_client_dev_hotplug+0x9e/0xd0
&lt;4&gt; [515.287829] drm_kms_helper_hotplug_event+0x1a/0x30
&lt;4&gt; [515.287834] drm_dp_delayed_destroy_work+0x3df/0x410
[drm_display_helper]
&lt;4&gt; [515.287861] process_one_work+0x22b/0x6f0
&lt;4&gt; [515.287874] worker_thread+0x1e8/0x3d0
&lt;4&gt; [515.287879] ? __pfx_worker_thread+0x10/0x10
&lt;4&gt; [515.287882] kthread+0x11c/0x250
&lt;4&gt; [515.287886] ? __pfx_kthread+0x10/0x10
&lt;4&gt; [515.287890] ret_from_fork+0x2d7/0x310
&lt;4&gt; [515.287894] ? __pfx_kthread+0x10/0x10
&lt;4&gt; [515.287897] ret_from_fork_asm+0x1a/0x30

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6303
Signed-off-by: Suraj Kandpal &lt;suraj.kandpal@intel.com&gt;
Reviewed-by: Imre Deak &lt;imre.deak@intel.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20251119094650.799135-1-suraj.kandpal@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 342ccffd9f77fc29fe1c05fd145e4d842bd2feaa ]

When releasing a timeslot there is a slight chance we may end up
with the wrong payload mask due to overflow if the delayed_destroy_work
ends up coming into play after a DP 2.1 monitor gets disconnected
which causes vcpi to become 0 then we try to make the payload =
~BIT(vcpi - 1) which is a negative shift. VCPI id should never
really be 0 hence skip changing the payload mask if VCPI is 0.

Otherwise it leads to
&lt;7&gt; [515.287237] xe 0000:03:00.0: [drm:drm_dp_mst_get_port_malloc
[drm_display_helper]] port ffff888126ce9000 (3)
&lt;4&gt; [515.287267] -----------[ cut here ]-----------
&lt;3&gt; [515.287268] UBSAN: shift-out-of-bounds in
../drivers/gpu/drm/display/drm_dp_mst_topology.c:4575:36
&lt;3&gt; [515.287271] shift exponent -1 is negative
&lt;4&gt; [515.287275] CPU: 7 UID: 0 PID: 3108 Comm: kworker/u64:33 Tainted: G
S U 6.17.0-rc6-lgci-xe-xe-3795-3e79699fa1b216e92+ #1 PREEMPT(voluntary)
&lt;4&gt; [515.287279] Tainted: [S]=CPU_OUT_OF_SPEC, [U]=USER
&lt;4&gt; [515.287279] Hardware name: ASUS System Product Name/PRIME Z790-P
WIFI, BIOS 1645 03/15/2024
&lt;4&gt; [515.287281] Workqueue: drm_dp_mst_wq drm_dp_delayed_destroy_work
[drm_display_helper]
&lt;4&gt; [515.287303] Call Trace:
&lt;4&gt; [515.287304] &lt;TASK&gt;
&lt;4&gt; [515.287306] dump_stack_lvl+0xc1/0xf0
&lt;4&gt; [515.287313] dump_stack+0x10/0x20
&lt;4&gt; [515.287316] __ubsan_handle_shift_out_of_bounds+0x133/0x2e0
&lt;4&gt; [515.287324] ? drm_atomic_get_private_obj_state+0x186/0x1d0
&lt;4&gt; [515.287333] drm_dp_atomic_release_time_slots.cold+0x17/0x3d
[drm_display_helper]
&lt;4&gt; [515.287355] mst_connector_atomic_check+0x159/0x180 [xe]
&lt;4&gt; [515.287546] drm_atomic_helper_check_modeset+0x4d9/0xfa0
&lt;4&gt; [515.287550] ? __ww_mutex_lock.constprop.0+0x6f/0x1a60
&lt;4&gt; [515.287562] intel_atomic_check+0x119/0x2b80 [xe]
&lt;4&gt; [515.287740] ? find_held_lock+0x31/0x90
&lt;4&gt; [515.287747] ? lock_release+0xce/0x2a0
&lt;4&gt; [515.287754] drm_atomic_check_only+0x6a2/0xb40
&lt;4&gt; [515.287758] ? drm_atomic_add_affected_connectors+0x12b/0x140
&lt;4&gt; [515.287765] drm_atomic_commit+0x6e/0xf0
&lt;4&gt; [515.287766] ? _pfx__drm_printfn_info+0x10/0x10
&lt;4&gt; [515.287774] drm_client_modeset_commit_atomic+0x25c/0x2b0
&lt;4&gt; [515.287794] drm_client_modeset_commit_locked+0x60/0x1b0
&lt;4&gt; [515.287795] ? mutex_lock_nested+0x1b/0x30
&lt;4&gt; [515.287801] drm_client_modeset_commit+0x26/0x50
&lt;4&gt; [515.287804] __drm_fb_helper_restore_fbdev_mode_unlocked+0xdc/0x110
&lt;4&gt; [515.287810] drm_fb_helper_hotplug_event+0x120/0x140
&lt;4&gt; [515.287814] drm_fbdev_client_hotplug+0x28/0xd0
&lt;4&gt; [515.287819] drm_client_hotplug+0x6c/0xf0
&lt;4&gt; [515.287824] drm_client_dev_hotplug+0x9e/0xd0
&lt;4&gt; [515.287829] drm_kms_helper_hotplug_event+0x1a/0x30
&lt;4&gt; [515.287834] drm_dp_delayed_destroy_work+0x3df/0x410
[drm_display_helper]
&lt;4&gt; [515.287861] process_one_work+0x22b/0x6f0
&lt;4&gt; [515.287874] worker_thread+0x1e8/0x3d0
&lt;4&gt; [515.287879] ? __pfx_worker_thread+0x10/0x10
&lt;4&gt; [515.287882] kthread+0x11c/0x250
&lt;4&gt; [515.287886] ? __pfx_kthread+0x10/0x10
&lt;4&gt; [515.287890] ret_from_fork+0x2d7/0x310
&lt;4&gt; [515.287894] ? __pfx_kthread+0x10/0x10
&lt;4&gt; [515.287897] ret_from_fork_asm+0x1a/0x30

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6303
Signed-off-by: Suraj Kandpal &lt;suraj.kandpal@intel.com&gt;
Reviewed-by: Imre Deak &lt;imre.deak@intel.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20251119094650.799135-1-suraj.kandpal@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "drm/dp: Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS"</title>
<updated>2025-09-04T13:30:29+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2025-08-28T17:49:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=0699faf7041357dc4eb132d097295ce06cee77ac'/>
<id>0699faf7041357dc4eb132d097295ce06cee77ac</id>
<content type='text'>
This reverts commit 65e46aeaf84aa88539bcff6b8077e05fbd0700da which is
commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f upstream.

The upstream commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f ("drm/dp:
Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS") the
reverted commit backported causes a regression, on one eDP panel at
least resulting in display flickering, described in detail at the Link:
below. The issue fixed by the upstream commit will need a different
solution, revert the backport for now.

Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14558
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 65e46aeaf84aa88539bcff6b8077e05fbd0700da which is
commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f upstream.

The upstream commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f ("drm/dp:
Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS") the
reverted commit backported causes a regression, on one eDP panel at
least resulting in display flickering, described in detail at the Link:
below. The issue fixed by the upstream commit will need a different
solution, revert the backport for now.

Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: Sasha Levin &lt;sashal@kernel.org&gt;
Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14558
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp: Change AUX DPCD probe address from DPCD_REV to LANE0_1_STATUS</title>
<updated>2025-08-28T14:28:45+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2025-08-23T13:10:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=65e46aeaf84aa88539bcff6b8077e05fbd0700da'/>
<id>65e46aeaf84aa88539bcff6b8077e05fbd0700da</id>
<content type='text'>
[ Upstream commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f ]

Reading DPCD registers has side-effects in general. In particular
accessing registers outside of the link training register range
(0x102-0x106, 0x202-0x207, 0x200c-0x200f, 0x2216) is explicitly
forbidden by the DP v2.1 Standard, see

3.6.5.1 DPTX AUX Transaction Handling Mandates
3.6.7.4 128b/132b DP Link Layer LTTPR Link Training Mandates

Based on my tests, accessing the DPCD_REV register during the link
training of an UHBR TBT DP tunnel sink leads to link training failures.

Solve the above by using the DP_LANE0_1_STATUS (0x202) register for the
DPCD register access quirk.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Jani Nikula &lt;jani.nikula@linux.intel.com&gt;
Acked-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://lore.kernel.org/r/20250605082850.65136-2-imre.deak@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a40c5d727b8111b5db424a1e43e14a1dcce1e77f ]

Reading DPCD registers has side-effects in general. In particular
accessing registers outside of the link training register range
(0x102-0x106, 0x202-0x207, 0x200c-0x200f, 0x2216) is explicitly
forbidden by the DP v2.1 Standard, see

3.6.5.1 DPTX AUX Transaction Handling Mandates
3.6.7.4 128b/132b DP Link Layer LTTPR Link Training Mandates

Based on my tests, accessing the DPCD_REV register during the link
training of an UHBR TBT DP tunnel sink leads to link training failures.

Solve the above by using the DP_LANE0_1_STATUS (0x202) register for the
DPCD register access quirk.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Jani Nikula &lt;jani.nikula@linux.intel.com&gt;
Acked-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://lore.kernel.org/r/20250605082850.65136-2-imre.deak@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp_mst: Fix drm RAD print</title>
<updated>2025-04-10T12:37:27+00:00</updated>
<author>
<name>Wayne Lin</name>
<email>Wayne.Lin@amd.com</email>
</author>
<published>2025-01-13T09:10:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c3b8e7c6809a5e27437d43c185b0a4e50f68586e'/>
<id>c3b8e7c6809a5e27437d43c185b0a4e50f68586e</id>
<content type='text'>
[ Upstream commit 6bbce873a9c97cb12f5455c497be279ac58e707f ]

[Why]
The RAD of sideband message printed today is incorrect.
For RAD stored within MST branch
- If MST branch LCT is 1, it's RAD array is untouched and remained as 0.
- If MST branch LCT is larger than 1, use nibble to store the up facing
  port number in cascaded sequence as illustrated below:

  u8 RAD[0] = (LCT_2_UFP &lt;&lt; 4) | LCT_3_UFP
     RAD[1] = (LCT_4_UFP &lt;&lt; 4) | LCT_5_UFP
     ...

In drm_dp_mst_rad_to_str(), it wrongly to use BIT_MASK(4) to fetch the port
number of one nibble.

[How]
Adjust the code by:
- RAD array items are valuable only for LCT &gt;= 1.
- Use 0xF as the mask to replace BIT_MASK(4)

V2:
- Document how RAD is constructed (Imre)

V3:
- Adjust the comment for rad[] so kdoc formats it properly (Lyude)

Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests")
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Harry Wentland &lt;hwentlan@amd.com&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250113091100.3314533-2-Wayne.Lin@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 6bbce873a9c97cb12f5455c497be279ac58e707f ]

[Why]
The RAD of sideband message printed today is incorrect.
For RAD stored within MST branch
- If MST branch LCT is 1, it's RAD array is untouched and remained as 0.
- If MST branch LCT is larger than 1, use nibble to store the up facing
  port number in cascaded sequence as illustrated below:

  u8 RAD[0] = (LCT_2_UFP &lt;&lt; 4) | LCT_3_UFP
     RAD[1] = (LCT_4_UFP &lt;&lt; 4) | LCT_5_UFP
     ...

In drm_dp_mst_rad_to_str(), it wrongly to use BIT_MASK(4) to fetch the port
number of one nibble.

[How]
Adjust the code by:
- RAD array items are valuable only for LCT &gt;= 1.
- Use 0xF as the mask to replace BIT_MASK(4)

V2:
- Document how RAD is constructed (Imre)

V3:
- Adjust the comment for rad[] so kdoc formats it properly (Lyude)

Fixes: 2f015ec6eab6 ("drm/dp_mst: Add sideband down request tracing + selftests")
Cc: Imre Deak &lt;imre.deak@intel.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: Harry Wentland &lt;hwentlan@amd.com&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250113091100.3314533-2-Wayne.Lin@amd.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp_mst: Add a helper to queue a topology probe</title>
<updated>2025-04-07T08:06:36+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2024-07-22T16:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=5f57a96e92c60f62da91d58ceb5e5acd40e7d594'/>
<id>5f57a96e92c60f62da91d58ceb5e5acd40e7d594</id>
<content type='text'>
commit dbaeef363ea54f4c18112874b77503c72ba60fec upstream.

A follow up i915 patch will need to reprobe the MST topology after the
initial probing, add a helper for this.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240722165503.2084999-3-imre.deak@intel.com
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit dbaeef363ea54f4c18112874b77503c72ba60fec upstream.

A follow up i915 patch will need to reprobe the MST topology after the
initial probing, add a helper for this.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240722165503.2084999-3-imre.deak@intel.com
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp_mst: Factor out function to queue a topology probe work</title>
<updated>2025-04-07T08:06:36+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2024-07-22T16:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=93ccb0fb360634710dc0127284bec4f5f2ba1da9'/>
<id>93ccb0fb360634710dc0127284bec4f5f2ba1da9</id>
<content type='text'>
commit e9b36c5be2e7fdef2cc933c1dac50bd81881e9b8 upstream.

Factor out a function to queue a work for probing the topology, also
used by the next patch.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240722165503.2084999-2-imre.deak@intel.com
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e9b36c5be2e7fdef2cc933c1dac50bd81881e9b8 upstream.

Factor out a function to queue a work for probing the topology, also
used by the next patch.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240722165503.2084999-2-imre.deak@intel.com
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp_mst: Fix locking when skipping CSN before topology probing</title>
<updated>2025-03-22T19:50:47+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2025-03-07T18:31:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b5c283501581ff490b0f5ace7544678223fbef45'/>
<id>b5c283501581ff490b0f5ace7544678223fbef45</id>
<content type='text'>
commit 12d8f318347b1d4feac48e8ac351d3786af39599 upstream.

The handling of the MST Connection Status Notify message is skipped if
the probing of the topology is still pending. Acquiring the
drm_dp_mst_topology_mgr::probe_lock for this in
drm_dp_mst_handle_up_req() is problematic: the task/work this function
is called from is also responsible for handling MST down-request replies
(in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() -
holding already probe_lock - could be blocked waiting for an MST
down-request reply while drm_dp_mst_handle_up_req() is waiting for
probe_lock while processing a CSN message. This leads to the probe
work's down-request message timing out.

A scenario similar to the above leading to a down-request timeout is
handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the
probe_lock and sending down-request messages while a second CSN message
sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().

Fix the above by moving the logic to skip the CSN handling to
drm_dp_mst_process_up_req(). This function is called from a work
(separate from the task/work handling new up/down messages), already
holding probe_lock. This solves the above timeout issue, since handling
of down-request replies won't be blocked by probe_lock.

Fixes: ddf983488c3e ("drm/dp_mst: Skip CSN if topology probing is not done yet")
Cc: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: stable@vger.kernel.org # v6.6+
Reviewed-by: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250307183152.3822170-1-imre.deak@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 12d8f318347b1d4feac48e8ac351d3786af39599 upstream.

The handling of the MST Connection Status Notify message is skipped if
the probing of the topology is still pending. Acquiring the
drm_dp_mst_topology_mgr::probe_lock for this in
drm_dp_mst_handle_up_req() is problematic: the task/work this function
is called from is also responsible for handling MST down-request replies
(in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() -
holding already probe_lock - could be blocked waiting for an MST
down-request reply while drm_dp_mst_handle_up_req() is waiting for
probe_lock while processing a CSN message. This leads to the probe
work's down-request message timing out.

A scenario similar to the above leading to a down-request timeout is
handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the
probe_lock and sending down-request messages while a second CSN message
sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().

Fix the above by moving the logic to skip the CSN handling to
drm_dp_mst_process_up_req(). This function is called from a work
(separate from the task/work handling new up/down messages), already
holding probe_lock. This solves the above timeout issue, since handling
of down-request replies won't be blocked by probe_lock.

Fixes: ddf983488c3e ("drm/dp_mst: Skip CSN if topology probing is not done yet")
Cc: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Cc: stable@vger.kernel.org # v6.6+
Reviewed-by: Wayne Lin &lt;Wayne.Lin@amd.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20250307183152.3822170-1-imre.deak@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>gpu: drm_dp_cec: fix broken CEC adapter properties check</title>
<updated>2025-02-17T08:40:11+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hverkuil@xs4all.nl</email>
</author>
<published>2025-01-29T09:51:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e31e65661c54ce5017d96917bd6281f4b0bbcc0e'/>
<id>e31e65661c54ce5017d96917bd6281f4b0bbcc0e</id>
<content type='text'>
[ Upstream commit 6daaae5ff7f3b23a2dacc9c387ff3d4f95b67cad ]

If the hotplug detect of a display is low for longer than one second
(configurable through drm_dp_cec_unregister_delay), then the CEC adapter
is unregistered since we assume the display was disconnected. If the
HPD went low for less than one second, then we check if the properties
of the CEC adapter have changed, since that indicates that we actually
switch to new hardware and we have to unregister the old CEC device and
register a new one.

Unfortunately, the test for changed properties was written poorly, and
after a new CEC capability was added to the CEC core code the test always
returned true (i.e. the properties had changed).

As a result the CEC device was unregistered and re-registered for every
HPD toggle. If the CEC remote controller integration was also enabled
(CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was
also unregistered and re-registered. As a result the input device in
/sys would keep incrementing its number, e.g.:

/sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20

Since short HPD toggles are common, the number could over time get into
the thousands.

While not a serious issue (i.e. nothing crashes), it is not intended
to work that way.

This patch changes the test so that it only checks for the single CEC
capability that can actually change, and it ignores any other
capabilities, so this is now safe as well if new caps are added in
the future.

With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be
dropped as well, so that's a nice cleanup.

Signed-off-by: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
Reported-by: Farblos &lt;farblos@vodafonemail.de&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Fixes: 2c6d1fffa1d9 ("drm: add support for DisplayPort CEC-Tunneling-over-AUX")
Tested-by: Farblos &lt;farblos@vodafonemail.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/361bb03d-1691-4e23-84da-0861ead5dbdc@xs4all.nl
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 6daaae5ff7f3b23a2dacc9c387ff3d4f95b67cad ]

If the hotplug detect of a display is low for longer than one second
(configurable through drm_dp_cec_unregister_delay), then the CEC adapter
is unregistered since we assume the display was disconnected. If the
HPD went low for less than one second, then we check if the properties
of the CEC adapter have changed, since that indicates that we actually
switch to new hardware and we have to unregister the old CEC device and
register a new one.

Unfortunately, the test for changed properties was written poorly, and
after a new CEC capability was added to the CEC core code the test always
returned true (i.e. the properties had changed).

As a result the CEC device was unregistered and re-registered for every
HPD toggle. If the CEC remote controller integration was also enabled
(CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was
also unregistered and re-registered. As a result the input device in
/sys would keep incrementing its number, e.g.:

/sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20

Since short HPD toggles are common, the number could over time get into
the thousands.

While not a serious issue (i.e. nothing crashes), it is not intended
to work that way.

This patch changes the test so that it only checks for the single CEC
capability that can actually change, and it ignores any other
capabilities, so this is now safe as well if new caps are added in
the future.

With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be
dropped as well, so that's a nice cleanup.

Signed-off-by: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
Reported-by: Farblos &lt;farblos@vodafonemail.de&gt;
Reviewed-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Fixes: 2c6d1fffa1d9 ("drm: add support for DisplayPort CEC-Tunneling-over-AUX")
Tested-by: Farblos &lt;farblos@vodafonemail.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/361bb03d-1691-4e23-84da-0861ead5dbdc@xs4all.nl
Signed-off-by: Dmitry Baryshkov &lt;dmitry.baryshkov@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/dp_mst: Ensure mst_primary pointer is valid in drm_dp_mst_handle_up_req()</title>
<updated>2025-01-02T09:32:06+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2024-12-04T13:20:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9735d40f5fde9970aa46e828ecc85c32571d58a2'/>
<id>9735d40f5fde9970aa46e828ecc85c32571d58a2</id>
<content type='text'>
[ Upstream commit e54b00086f7473dbda1a7d6fc47720ced157c6a8 ]

While receiving an MST up request message from one thread in
drm_dp_mst_handle_up_req(), the MST topology could be removed from
another thread via drm_dp_mst_topology_mgr_set_mst(false), freeing
mst_primary and setting drm_dp_mst_topology_mgr::mst_primary to NULL.
This could lead to a NULL deref/use-after-free of mst_primary in
drm_dp_mst_handle_up_req().

Avoid the above by holding a reference for mst_primary in
drm_dp_mst_handle_up_req() while it's used.

v2: Fix kfreeing the request if getting an mst_primary reference fails.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt; (v1)
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241204132007.3132494-1-imre.deak@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit e54b00086f7473dbda1a7d6fc47720ced157c6a8 ]

While receiving an MST up request message from one thread in
drm_dp_mst_handle_up_req(), the MST topology could be removed from
another thread via drm_dp_mst_topology_mgr_set_mst(false), freeing
mst_primary and setting drm_dp_mst_topology_mgr::mst_primary to NULL.
This could lead to a NULL deref/use-after-free of mst_primary in
drm_dp_mst_handle_up_req().

Avoid the above by holding a reference for mst_primary in
drm_dp_mst_handle_up_req() while it's used.

v2: Fix kfreeing the request if getting an mst_primary reference fails.

Cc: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt; (v1)
Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241204132007.3132494-1-imre.deak@intel.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/display: Fix building with GCC 15</title>
<updated>2024-12-14T19:00:02+00:00</updated>
<author>
<name>Brahmajit Das</name>
<email>brahmajit.xyz@gmail.com</email>
</author>
<published>2024-10-02T09:23:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=45e43e721e269cc77d0ebb6f43c2ebd5ea8d4c2a'/>
<id>45e43e721e269cc77d0ebb6f43c2ebd5ea8d4c2a</id>
<content type='text'>
[ Upstream commit a500f3751d3c861be7e4463c933cf467240cca5d ]

GCC 15 enables -Werror=unterminated-string-initialization by default.
This results in the following build error

drivers/gpu/drm/display/drm_dp_dual_mode_helper.c: In function ‘is_hdmi_adaptor’:
drivers/gpu/drm/display/drm_dp_dual_mode_helper.c:164:17: error: initializer-string for array of
 ‘char’ is too long [-Werror=unterminated-string-initialization]
  164 |                 "DP-HDMI ADAPTOR\x04";
      |                 ^~~~~~~~~~~~~~~~~~~~~

After discussion with Ville, the fix was to increase the size of
dp_dual_mode_hdmi_id array by one, so that it can accommodate the NULL
line character. This should let us build the kernel with GCC 15.

Signed-off-by: Brahmajit Das &lt;brahmajit.xyz@gmail.com&gt;
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241002092311.942822-1-brahmajit.xyz@gmail.com
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a500f3751d3c861be7e4463c933cf467240cca5d ]

GCC 15 enables -Werror=unterminated-string-initialization by default.
This results in the following build error

drivers/gpu/drm/display/drm_dp_dual_mode_helper.c: In function ‘is_hdmi_adaptor’:
drivers/gpu/drm/display/drm_dp_dual_mode_helper.c:164:17: error: initializer-string for array of
 ‘char’ is too long [-Werror=unterminated-string-initialization]
  164 |                 "DP-HDMI ADAPTOR\x04";
      |                 ^~~~~~~~~~~~~~~~~~~~~

After discussion with Ville, the fix was to increase the size of
dp_dual_mode_hdmi_id array by one, so that it can accommodate the NULL
line character. This should let us build the kernel with GCC 15.

Signed-off-by: Brahmajit Das &lt;brahmajit.xyz@gmail.com&gt;
Reviewed-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241002092311.942822-1-brahmajit.xyz@gmail.com
Signed-off-by: Jani Nikula &lt;jani.nikula@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
