]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: ucsi: Hold con->lock for the entire duration of ucsi_register_port()
authorHans de Goede <hdegoede@redhat.com>
Sun, 9 Aug 2020 14:19:04 +0000 (16:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Aug 2020 10:08:51 +0000 (12:08 +0200)
commit3bfe4c0b359b0d167d07601c0d517b7991373c1b
tree3ab934c8f31b53d842f95b20679bc1865e7d93a3
parentc66f23c0bc97d573f4ce190f3952644e21cf91a8
usb: typec: ucsi: Hold con->lock for the entire duration of ucsi_register_port()

Commit 49ade86afbe4 ("usb: typec: ucsi: displayport: Fix a potential race
during registration") made the ucsi code hold con->lock in
ucsi_register_displayport(). But we really don't want any interactions
with the connector to run before the port-registration process is fully
complete.

This commit moves the taking of con->lock from ucsi_register_displayport()
into ucsi_register_port() to achieve this.

Cc: stable@vger.kernel.org
Fixes: 49ade86afbe4 ("usb: typec: ucsi: displayport: Fix a potential race during registration")
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-5-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/ucsi/displayport.c
drivers/usb/typec/ucsi/ucsi.c