]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: ucsi: displayport: Fix deadlock
authorAndrei Kuchynski <akuchynski@chromium.org>
Thu, 24 Apr 2025 08:44:28 +0000 (08:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:08:26 +0000 (14:08 +0200)
commitf4bd982563c2fd41ec9ca6c517c392d759db801c
tree68454b1d12b5996fe32bc3d8809e69011b345c8a
parentcec4f45bf51e08470024d9dc7549b1ddbdcf8d43
usb: typec: ucsi: displayport: Fix deadlock

commit 364618c89d4c57c85e5fc51a2446cd939bf57802 upstream.

This patch introduces the ucsi_con_mutex_lock / ucsi_con_mutex_unlock
functions to the UCSI driver. ucsi_con_mutex_lock ensures the connector
mutex is only locked if a connection is established and the partner pointer
is valid. This resolves a deadlock scenario where
ucsi_displayport_remove_partner holds con->mutex waiting for
dp_altmode_work to complete while dp_altmode_work attempts to acquire it.

Cc: stable <stable@kernel.org>
Fixes: af8622f6a585 ("usb: typec: ucsi: Support for DisplayPort alt mode")
Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250424084429.3220757-2-akuchynski@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/displayport.c
drivers/usb/typec/ucsi/ucsi.c
drivers/usb/typec/ucsi/ucsi.h