From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MCC45TR Date: Sun, 30 Aug 2026 18:18:27 +0300 Subject: [PATCH 19/21] usb: qcom: stabilize Nabu host CDC reconnects --- drivers/usb/dwc3/dwc3-qcom.c | 12 ++++++++++-- senemos/configs/nabu-minimal.config | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index f43f73ac36ff..113afe0cb2bc 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -570,9 +570,17 @@ static void dwc3_qcom_set_role_notifier(struct dwc3 *dwc, enum usb_role next_rol return; } - if (qcom->current_role == USB_ROLE_DEVICE) + /* + * Only drive the Qualcomm software VBUS-valid override while entering or + * leaving device mode. Host-to-NONE and NONE-to-host transitions must + * leave it cleared; otherwise a Type-C host reconnect can be mistaken for + * a peripheral session and xHCI never sees the attached device. + */ + if (qcom->current_role == USB_ROLE_DEVICE && + next_role != USB_ROLE_DEVICE) dwc3_qcom_vbus_override_enable(qcom, false); - else if (qcom->current_role != USB_ROLE_DEVICE) + else if (qcom->current_role != USB_ROLE_DEVICE && + next_role == USB_ROLE_DEVICE) dwc3_qcom_vbus_override_enable(qcom, true); pm_runtime_mark_last_busy(qcom->dev); diff --git a/senemos/configs/nabu-minimal.config b/senemos/configs/nabu-minimal.config index fa6f7b217d22..c75eb90eb4be 100644 --- a/senemos/configs/nabu-minimal.config +++ b/senemos/configs/nabu-minimal.config @@ -50,6 +50,7 @@ CONFIG_HID_XIAOMI=y # The optional pogo-keyboard XHCI controller must not block built-in init. CONFIG_USB_XHCI_HCD=m +CONFIG_USB_ACM=y # The primary USB-C path is boot-critical for recovery and wired input. CONFIG_USB_DWC3=y