diff --git a/patches.suse/usb-typec-ucsi-Clear-EVENT_PENDING-under-PPM-lock.patch b/patches.suse/usb-typec-ucsi-Clear-EVENT_PENDING-under-PPM-lock.patch new file mode 100644 index 0000000..241eb6c --- /dev/null +++ b/patches.suse/usb-typec-ucsi-Clear-EVENT_PENDING-under-PPM-lock.patch @@ -0,0 +1,50 @@ +From 15b2e71b4653b3e13df34695a29ebeee237c5af2 Mon Sep 17 00:00:00 2001 +From: "Christian A. Ehrhardt" +Date: Wed, 20 Mar 2024 08:39:22 +0100 +Subject: [PATCH] usb: typec: ucsi: Clear EVENT_PENDING under PPM lock +Git-commit: 15b2e71b4653b3e13df34695a29ebeee237c5af2 +Patch-mainline: v6.9-rc2 +References: git-fixes + +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 +Signed-off-by: Christian A. Ehrhardt +Reviewed-by: Heikki Krogerus +Tested-by: Neil Armstrong # on SM8550-QRD +Link: https://lore.kernel.org/r/20240320073927.1641788-2-lk@c--e.de +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/typec/ucsi/ucsi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c +index cf52cb34d285..8a6645ffd938 100644 +--- a/drivers/usb/typec/ucsi/ucsi.c ++++ b/drivers/usb/typec/ucsi/ucsi.c +@@ -1215,11 +1215,11 @@ static void ucsi_handle_connector_change(struct work_struct *work) + 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); + +-- +2.43.0 + diff --git a/series.conf b/series.conf index 97e37af..69d0c88 100644 --- a/series.conf +++ b/series.conf @@ -45911,6 +45911,7 @@ patches.suse/usb-cdc-wdm-close-race-between-read-and-workqueue.patch patches.suse/usb-dwc3-Properly-set-system-wakeup.patch patches.suse/usb-typec-Return-size-of-buffer-if-pd_set-operation-.patch + patches.suse/usb-typec-ucsi-Clear-EVENT_PENDING-under-PPM-lock.patch # jejb/scsi for-next patches.suse/scsi-lpfc-Initialize-status-local-variable-in-lpfc_s.patch