From 7e6d2aaf3bcc1c1876a678e462851689c7e16fe0 Mon Sep 17 00:00:00 2001 From: Ayushee Shah Date: Fri, 19 Feb 2021 12:37:01 -0800 Subject: Virtual mux: Set disconnect latch flag only in s3/s0ix When the AP comes up after G3 and since the disconnect flag is set, EC sends disconnect info to the AP probe functions. But the DUT is still in low power mode thus the AP doesn't receive the current mux state hence enumeration of USB4/TBT device fails when hotplugged at G3. This CL ensures that disconnect flag is only set in chipset suspend states i.e. s3 and s0ix BUG=b:180377259 BRANCH=None TEST=Connected USB4 device connect in G3 and checked enumeration Signed-off-by: Ayushee Shah Change-Id: I6992c528c7c39bf604d4e305b362ef04bc3c100e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2705561 Reviewed-by: Tanu Malhotra Reviewed-by: Madhusudanarao Amara Reviewed-by: Keith Short Commit-Queue: Keith Short --- driver/usb_mux/usb_mux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'driver/usb_mux') diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c index 6f2739de4a..c50189bb40 100644 --- a/driver/usb_mux/usb_mux.c +++ b/driver/usb_mux/usb_mux.c @@ -8,6 +8,7 @@ #include "atomic.h" #include "common.h" #include "console.h" +#include "chipset.h" #include "hooks.h" #include "host_command.h" #include "task.h" @@ -65,8 +66,9 @@ static int configure_mux(int port, *mux_state = USB_PD_MUX_NONE; } - if ((config == USB_MUX_SET_MODE && *mux_state == USB_PD_MUX_NONE) || - config == USB_MUX_INIT) { + if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND) && + ((config == USB_MUX_SET_MODE && *mux_state == USB_PD_MUX_NONE) || + config == USB_MUX_INIT)) { usb_mux_set_disconnect_latch_flag(port, true); } -- cgit v1.2.1