This is a note to let you know that I've just added the patch titled usb: typec: ucsi: Clear EVENT_PENDING under PPM lock to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-typec-ucsi-clear-event_pending-under-ppm-lock.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 15b2e71b4653b3e13df34695a29ebeee237c5af2 Mon Sep 17 00:00:00 2001 From: "Christian A. Ehrhardt" <lk@xxxxxxx> Date: Wed, 20 Mar 2024 08:39:22 +0100 Subject: usb: typec: ucsi: Clear EVENT_PENDING under PPM lock From: Christian A. Ehrhardt <lk@xxxxxxx> commit 15b2e71b4653b3e13df34695a29ebeee237c5af2 upstream. Suppose we sleep on the PPM lock after clearing the EVENT_PENDING bit because the thread for another connector is executing a command. In this case the command completion of the other command will still report the connector change for our connector. Clear the EVENT_PENDING bit under the PPM lock to avoid another useless call to ucsi_handle_connector_change() in this case. Fixes: c9aed03a0a68 ("usb: ucsi: Add missing ppm_lock") Cc: stable <stable@xxxxxxxxxx> Signed-off-by: Christian A. Ehrhardt <lk@xxxxxxx> Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx> Tested-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx> # on SM8550-QRD Link: https://lore.kernel.org/r/20240320073927.1641788-2-lk@xxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/typec/ucsi/ucsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -936,11 +936,11 @@ static void ucsi_handle_connector_change if (con->status.change & UCSI_CONSTAT_CAM_CHANGE) ucsi_partner_task(con, ucsi_check_altmodes, 1, 0); - clear_bit(EVENT_PENDING, &con->ucsi->flags); - mutex_lock(&ucsi->ppm_lock); + clear_bit(EVENT_PENDING, &con->ucsi->flags); ret = ucsi_acknowledge_connector_change(ucsi); mutex_unlock(&ucsi->ppm_lock); + if (ret) dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret); Patches currently in stable-queue which might be from lk@xxxxxxx are queue-6.8/usb-typec-ucsi-check-for-notifications-after-init.patch queue-6.8/usb-typec-ucsi_acpi-refactor-and-fix-dell-quirk.patch queue-6.8/usb-typec-ucsi-clear-event_pending-under-ppm-lock.patch queue-6.8/usb-typec-ucsi-ack-unsupported-commands.patch queue-6.8/usb-typec-ucsi-clear-ucsi_cci_reset_complete-before-reset.patch