]> git.hungrycats.org Git - linux/commit
usb: typec: ucsi: Clear EVENT_PENDING under PPM lock
authorChristian A. Ehrhardt <lk@c--e.de>
Wed, 20 Mar 2024 07:39:22 +0000 (08:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:56 +0000 (15:11 +0200)
commitd4633044ca4aa1db3aa0d50bd6b820b084b6bf2f
treec2a44cbc39687db90fbbb52a7653fbfc9c0860e1
parent9a103ca280aeb0123508572cc7f6b64a7b6a66da
usb: typec: ucsi: Clear EVENT_PENDING under PPM lock

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@kernel.org>
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Link: https://lore.kernel.org/r/20240320073927.1641788-2-lk@c--e.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c