linux/drivers/usb/typec
Prashant Malani 658027afea usb: typec: intel_pmc_mux: Avoid connect request on disconnect
When pmc_usb_mux_set() is invoked when a device is disconnected, a valid
scenario is for state->alt == NULL and state->mode == TYPEC_STATE_USB.

In such cases, if a pmc_usb_disconnect() has already been issued (from
either pmc_usb_set_orientation() when orientation ==
TYPEC_ORIENTATION_NONE, or pmc_usb_set_role() when role ==
USB_ROLE_NONE), a pmc_usb_connect() will be issued despite no peripheral
being present.

This confuses the PMC and leads to all subsequent PMC IPC requests
returning errors due to timeout.

To prevent this, return early if the port orientation or role is already
set to none.

Cc: Benson Leung <bleung@chromium.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Rajmohan Mani <rajmohan.mani@intel.com>
Fixes: f3c1c41ebc ("usb: typec: intel_pmc_mux: Add support for USB4")
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Link: https://lore.kernel.org/r/20200709002441.1309189-1-pmalani@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-21 13:38:21 +02:00
..
altmodes usb: typec: altmodes: displayport: Supply missing displayport.h include file 2020-07-09 16:46:59 +02:00
mux usb: typec: intel_pmc_mux: Avoid connect request on disconnect 2020-07-21 13:38:21 +02:00
tcpm usb: typec: tcpm: fusb302: Use 'gnu_printf' format notation 2020-07-09 16:47:00 +02:00
ucsi usb: typec: Replace HTTP links with HTTPS ones 2020-07-15 16:33:50 +02:00
bus.c usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer 2020-04-22 19:23:19 +02:00
bus.h usb: typec: altmode: Remove the notification chain 2020-02-12 10:51:21 -08:00
class.c usb: typec: Add typec_find_orientation() 2020-05-13 14:20:49 +02:00
hd3ss3220.c usb: typec: hd3ss3220: Give the connector fwnode to the port device 2019-11-04 16:03:36 +01:00
Kconfig usb: typec: Ensure USB_ROLE_SWITCH is set as a dependency for tps6598x 2020-05-21 09:36:42 +02:00
Makefile usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller 2019-10-04 14:18:48 +02:00
mux.c usb: typec: mux: Allow the mux handles to be requested with fwnode 2020-03-04 11:12:49 +01:00
tps6598x.c usb: typec: Replace HTTP links with HTTPS ones 2020-07-15 16:33:50 +02:00