]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: chipidea: otg: not wait vbus drop if use role_switch
authorXu Yang <xu.yang_2@nxp.com>
Thu, 2 Apr 2026 07:14:57 +0000 (15:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Apr 2026 11:46:54 +0000 (13:46 +0200)
The usb role switch will update ID and VBUS states at the same time, and
vbus will not drop when execute data role swap in Type-C usecase. So lets
not wait vbus drop in usb role switch case too.

Fixes: e1b5d2bed67c ("usb: chipidea: core: handle usb role switch in a common way")
Cc: stable@vger.kernel.org
Acked-by: Peter Chen <peter.chen@kernel.org>
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://patch.msgid.link/20260402071457.2516021-3-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/otg.c

index def933b73a905baffbe531f33e05a3deff4e8adb..fecc7d7e2f0d7ef8b8a25deb7a116d5dcaea08db 100644 (file)
@@ -190,8 +190,8 @@ void ci_handle_id_switch(struct ci_hdrc *ci)
 
                ci_role_stop(ci);
 
-               if (role == CI_ROLE_GADGET &&
-                               IS_ERR(ci->platdata->vbus_extcon.edev))
+               if (role == CI_ROLE_GADGET && !ci->role_switch &&
+                   IS_ERR(ci->platdata->vbus_extcon.edev))
                        /*
                         * Wait vbus lower than OTGSC_BSV before connecting
                         * to host. If connecting status is from an external