Commit 43ad944c authored by Kyle Tso's avatar Kyle Tso Committed by Greg Kroah-Hartman

usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events

When receiving FRS and Sourcing_Vbus events from low-level drivers, keep
other events which come a bit earlier so that they will not be ignored
in the event handler.

Fixes: 8dc4bd07 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarBadhri Jagan Sridharan <badhri@google.com>
Signed-off-by: default avatarKyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210803091314.3051302-1-kyletso@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb10f68a
...@@ -5369,7 +5369,7 @@ EXPORT_SYMBOL_GPL(tcpm_pd_hard_reset); ...@@ -5369,7 +5369,7 @@ EXPORT_SYMBOL_GPL(tcpm_pd_hard_reset);
void tcpm_sink_frs(struct tcpm_port *port) void tcpm_sink_frs(struct tcpm_port *port)
{ {
spin_lock(&port->pd_event_lock); spin_lock(&port->pd_event_lock);
port->pd_events = TCPM_FRS_EVENT; port->pd_events |= TCPM_FRS_EVENT;
spin_unlock(&port->pd_event_lock); spin_unlock(&port->pd_event_lock);
kthread_queue_work(port->wq, &port->event_work); kthread_queue_work(port->wq, &port->event_work);
} }
...@@ -5378,7 +5378,7 @@ EXPORT_SYMBOL_GPL(tcpm_sink_frs); ...@@ -5378,7 +5378,7 @@ EXPORT_SYMBOL_GPL(tcpm_sink_frs);
void tcpm_sourcing_vbus(struct tcpm_port *port) void tcpm_sourcing_vbus(struct tcpm_port *port)
{ {
spin_lock(&port->pd_event_lock); spin_lock(&port->pd_event_lock);
port->pd_events = TCPM_SOURCING_VBUS; port->pd_events |= TCPM_SOURCING_VBUS;
spin_unlock(&port->pd_event_lock); spin_unlock(&port->pd_event_lock);
kthread_queue_work(port->wq, &port->event_work); kthread_queue_work(port->wq, &port->event_work);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment