Skip to content

Commit 63cff9f

Browse files
Andrei Kuchynskigregkh
authored andcommitted
usb: typec: displayport: Fix potential deadlock
commit 099cf1f upstream. The deadlock can occur due to a recursive lock acquisition of `cros_typec_altmode_data::mutex`. The call chain is as follows: 1. cros_typec_altmode_work() acquires the mutex 2. typec_altmode_vdm() -> dp_altmode_vdm() -> 3. typec_altmode_exit() -> cros_typec_altmode_exit() 4. cros_typec_altmode_exit() attempts to acquire the mutex again To prevent this, defer the `typec_altmode_exit()` call by scheduling it rather than calling it directly from within the mutex-protected context. Cc: stable <stable@kernel.org> Fixes: b4b38ff ("usb: typec: displayport: Receive DP Status Update NAK request exit dp altmode") Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20250624133246.3936737-1-akuchynski@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4b91b77 commit 63cff9f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/usb/typec/altmodes/displayport.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
324324
case CMDT_RSP_NAK:
325325
switch (cmd) {
326326
case DP_CMD_STATUS_UPDATE:
327-
if (typec_altmode_exit(alt))
328-
dev_err(&dp->alt->dev, "Exit Mode Failed!\n");
327+
dp->state = DP_STATE_EXIT;
329328
break;
330329
case DP_CMD_CONFIGURE:
331330
dp->data.conf = 0;

0 commit comments

Comments
 (0)