[PATCH v2 0/4] DWC3 link tunneling state reporting

Konrad Dybcio posted 4 patches 1 week, 3 days ago
drivers/usb/dwc3/core.c          | 16 ++++++++++++++++
drivers/usb/dwc3/core.h          | 18 ++++++++++++++++++
drivers/usb/dwc3/host.c          | 12 ++++++++++++
drivers/usb/host/xhci-debugfs.c  |  9 +++++++++
drivers/usb/host/xhci-debugfs.h  |  2 ++
drivers/usb/host/xhci-ext-caps.h |  4 ++++
drivers/usb/host/xhci-hub.c      | 32 +++++++++++++++++++++++++-------
drivers/usb/host/xhci-plat.c     |  2 ++
drivers/usb/host/xhci-plat.h     |  1 +
drivers/usb/host/xhci-port.h     |  3 ++-
drivers/usb/host/xhci.c          |  3 ++-
drivers/usb/host/xhci.h          |  5 ++++-
12 files changed, 97 insertions(+), 10 deletions(-)
[PATCH v2 0/4] DWC3 link tunneling state reporting
Posted by Konrad Dybcio 1 week, 3 days ago
Currently, retrieving the tunneled/native state of a running port is
only possible on Intel XHCI hosts. This series extends that to CIO-
capable DWC31 controllers (see [1]).

Note that this patchset only results in the correct udev->tunnel_mode
value being assigned. Creating the device links (which requires this
information) between the USB4 router and the USB3 controller does not
currently take place on DT-based platforms, but that will be amended
in a follow-up patchset.

Tested on a Qualcomm X1E80100 CRD board, with a (currently) out-of-tree
set of drivers.

[1] I'm not entirely sure about the DWC version range (particularly
    wrt DWC32 and newer), so I limited it to a reasonable subset. I'll
    happily amend that.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Changes in v2:
- Add handling for XHCI v1.2's USB3 tunneling and PORTSC.TM for
  platforms that advertise it (!!! UNTESTED !!!, I have no access to
  HW that exposes this)
- Prefer the aforementioned cap over custom implementations
- Bail out of the DWC3-specific check if `usb4-host-interface` device
  property is absent - hence this now depends on:
  https://github.com/devicetree-org/dt-schema/pull/196

- Link to v1: https://patch.msgid.link/20260505-topic-dwc3_tunneling_state-v1-0-4aaa6c3c14cb@oss.qualcomm.com

To: Mathias Nyman <mathias.nyman@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
Konrad Dybcio (4):
      usb: xhci: debugfs: Expose the USB3 tunneling ext_cap register value
      usb: xhci: Honor PORTSC.TM if valid
      usb: xhci: Allow custom op for usb_link_tunnel_mode reporting
      usb: dwc3: Notify XHCI core of tunneled status

 drivers/usb/dwc3/core.c          | 16 ++++++++++++++++
 drivers/usb/dwc3/core.h          | 18 ++++++++++++++++++
 drivers/usb/dwc3/host.c          | 12 ++++++++++++
 drivers/usb/host/xhci-debugfs.c  |  9 +++++++++
 drivers/usb/host/xhci-debugfs.h  |  2 ++
 drivers/usb/host/xhci-ext-caps.h |  4 ++++
 drivers/usb/host/xhci-hub.c      | 32 +++++++++++++++++++++++++-------
 drivers/usb/host/xhci-plat.c     |  2 ++
 drivers/usb/host/xhci-plat.h     |  1 +
 drivers/usb/host/xhci-port.h     |  3 ++-
 drivers/usb/host/xhci.c          |  3 ++-
 drivers/usb/host/xhci.h          |  5 ++++-
 12 files changed, 97 insertions(+), 10 deletions(-)
---
base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
change-id: 20260504-topic-dwc3_tunneling_state-50588c0e1ae3

Best regards,
--  
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Re: [PATCH v2 0/4] DWC3 link tunneling state reporting
Posted by Konrad Dybcio 1 week, 3 days ago
On 7/15/26 2:29 PM, 'Konrad Dybcio' via USB4 - Upstream wrote:
> Currently, retrieving the tunneled/native state of a running port is
> only possible on Intel XHCI hosts. This series extends that to CIO-
> capable DWC31 controllers (see [1]).
> 
> Note that this patchset only results in the correct udev->tunnel_mode
> value being assigned. Creating the device links (which requires this
> information) between the USB4 router and the USB3 controller does not
> currently take place on DT-based platforms, but that will be amended
> in a follow-up patchset.
> 
> Tested on a Qualcomm X1E80100 CRD board, with a (currently) out-of-tree
> set of drivers.
> 
> [1] I'm not entirely sure about the DWC version range (particularly
>     wrt DWC32 and newer), so I limited it to a reasonable subset. I'll
>     happily amend that.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> Changes in v2:
> - Add handling for XHCI v1.2's USB3 tunneling and PORTSC.TM for
>   platforms that advertise it (!!! UNTESTED !!!, I have no access to
>   HW that exposes this)
> - Prefer the aforementioned cap over custom implementations
> - Bail out of the DWC3-specific check if `usb4-host-interface` device
>   property is absent - hence this now depends on:
>   https://github.com/devicetree-org/dt-schema/pull/196
> 
> - Link to v1: https://patch.msgid.link/20260505-topic-dwc3_tunneling_state-v1-0-4aaa6c3c14cb@oss.qualcomm.com

+Cc Sven sorry, I forgot to include you..

Konrad
Re: [PATCH v2 0/4] DWC3 link tunneling state reporting
Posted by Thinh Nguyen 2 days, 17 hours ago
On Wed, Jul 15, 2026, Konrad Dybcio wrote:
> On 7/15/26 2:29 PM, 'Konrad Dybcio' via USB4 - Upstream wrote:
> > Currently, retrieving the tunneled/native state of a running port is
> > only possible on Intel XHCI hosts. This series extends that to CIO-
> > capable DWC31 controllers (see [1]).
> > 
> > Note that this patchset only results in the correct udev->tunnel_mode
> > value being assigned. Creating the device links (which requires this
> > information) between the USB4 router and the USB3 controller does not
> > currently take place on DT-based platforms, but that will be amended
> > in a follow-up patchset.
> > 
> > Tested on a Qualcomm X1E80100 CRD board, with a (currently) out-of-tree
> > set of drivers.
> > 
> > [1] I'm not entirely sure about the DWC version range (particularly
> >     wrt DWC32 and newer), so I limited it to a reasonable subset. I'll
> >     happily amend that.
> > 
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> > ---
> > Changes in v2:
> > - Add handling for XHCI v1.2's USB3 tunneling and PORTSC.TM for
> >   platforms that advertise it (!!! UNTESTED !!!, I have no access to
> >   HW that exposes this)
> > - Prefer the aforementioned cap over custom implementations
> > - Bail out of the DWC3-specific check if `usb4-host-interface` device
> >   property is absent - hence this now depends on:
> >   https://urldefense.com/v3/__https://github.com/devicetree-org/dt-schema/pull/196__;!!A4F2R9G_pg!Yp4eQxr_V48OU-fhHIAT1pJrvhKI2VbT19cN4M-3EHIA5K9G57Npd31Hs5MLCPneAJ3pxM3JzzaQ7Mc_8sTGV7KEa_bieEilDA$ 
> > 
> > - Link to v1: https://urldefense.com/v3/__https://patch.msgid.link/20260505-topic-dwc3_tunneling_state-v1-0-4aaa6c3c14cb@oss.qualcomm.com__;!!A4F2R9G_pg!Yp4eQxr_V48OU-fhHIAT1pJrvhKI2VbT19cN4M-3EHIA5K9G57Npd31Hs5MLCPneAJ3pxM3JzzaQ7Mc_8sTGV7KEa_bYNq9e3w$ 
> 
> +Cc Sven sorry, I forgot to include you..
> 
> Konrad

Thank you for the patch series!

Don't worry about the DWC32 version range. Newer controllers should
follow the xhci v1.2 spec. We can always apply fixes later as needed.

Thanks,
Thinh

ps. I'll be out of office tomorrow until 7/31. My response may be
delayed.