]> 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:10:08 +0000 (14:10 +0200)
commitf32451ca4cb7dc53f2a0e2e66b84d34162747eb7
tree946f102eb1633c05331fa64035d0f6aa0b8036f0
parentd8ef6140fe9e6c4062203ae1a2ec95cf1f861775
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