]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: ucsi: Add missing ppm_lock
authorChristian A. Ehrhardt <lk@c--e.de>
Sun, 21 Jan 2024 20:41:21 +0000 (21:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:31 +0000 (09:51 +0100)
commit330e7d773b81ccf11f575bcf1a6cc798e11e2c2d
tree956d585fb721b8ce567d51d89caff6a85dd7e25a
parentcc5c9c6f77e96d3abd090148c71a63caa9bff9f3
usb: ucsi: Add missing ppm_lock

commit c9aed03a0a683fd1600ea92f2ad32232d4736272 upstream.

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: b9aa02ca39a4 ("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>
drivers/usb/typec/ucsi/ucsi.c