Skip to content

Commit c9aed03

Browse files
Christian A. Ehrhardtgregkh
authored andcommitted
usb: ucsi: Add missing ppm_lock
Calling ->sync_write must be done while holding the PPM lock as the mailbox logic does not support concurrent commands. At least since the addition of partner task this means that ucsi_acknowledge_connector_change should be called with the PPM lock held as it calls ->sync_write. Thus protect the only call to ucsi_acknowledge_connector_change with the PPM. All other calls to ->sync_write already happen under the PPM lock. Fixes: b9aa02c ("usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking") Cc: stable@vger.kernel.org Signed-off-by: "Christian A. Ehrhardt" <lk@c--e.de> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240121204123.275441-2-lk@c--e.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3caf2b2 commit c9aed03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/typec/ucsi/ucsi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,9 @@ static void ucsi_handle_connector_change(struct work_struct *work)
938938

939939
clear_bit(EVENT_PENDING, &con->ucsi->flags);
940940

941+
mutex_lock(&ucsi->ppm_lock);
941942
ret = ucsi_acknowledge_connector_change(ucsi);
943+
mutex_unlock(&ucsi->ppm_lock);
942944
if (ret)
943945
dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);
944946

0 commit comments

Comments
 (0)