Skip to content

Commit 15b2e71

Browse files
Christian A. Ehrhardtgregkh
authored andcommitted
usb: typec: ucsi: Clear EVENT_PENDING under PPM lock
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: c9aed03 ("usb: ucsi: Add missing ppm_lock") Cc: stable <[email protected]> Signed-off-by: Christian A. Ehrhardt <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 53f5094 commit 15b2e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/ucsi/ucsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,11 +1215,11 @@ static void ucsi_handle_connector_change(struct work_struct *work)
12151215
if (con->status.change & UCSI_CONSTAT_CAM_CHANGE)
12161216
ucsi_partner_task(con, ucsi_check_altmodes, 1, 0);
12171217

1218-
clear_bit(EVENT_PENDING, &con->ucsi->flags);
1219-
12201218
mutex_lock(&ucsi->ppm_lock);
1219+
clear_bit(EVENT_PENDING, &con->ucsi->flags);
12211220
ret = ucsi_acknowledge_connector_change(ucsi);
12221221
mutex_unlock(&ucsi->ppm_lock);
1222+
12231223
if (ret)
12241224
dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);
12251225

0 commit comments

Comments
 (0)