]> git.baikalelectronics.ru Git - 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)
commitc66f23c0bc97d573f4ce190f3952644e21cf91a8
treed7d7c6cc676b94d473875c98d03e237b85abd88d
parentd464c9eacddcfcfd958f7af3d4e56c3c4a9ca1c0
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