]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: typec: ucsi: Rework ppm_lock handling
authorHans de Goede <hdegoede@redhat.com>
Sun, 9 Aug 2020 14:19:03 +0000 (16:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2020 10:08:44 +0000 (12:08 +0200)
commit25794e3079d2a98547b6bf5764ef0240aa89b798
treed7d7c6cc676b94d473875c98d03e237b85abd88d
parent7e90057f125c8c852940b848e06e7a72f050fc6f
usb: typec: ucsi: Rework ppm_lock handling

The ppm_lock really only needs to be hold during 2 functions:
ucsi_reset_ppm() and ucsi_run_command().

Push the taking of the lock down into these 2 functions, renaming
ucsi_run_command() to ucsi_send_command() which was an existing
wrapper already taking the lock for its callers.

This simplifies things for the callers and removes the difference
between ucsi_send_command() and ucsi_run_command() which has led
to various locking bugs in the past.

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200809141904.4317-4-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/ucsi.c