The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Sven Peter <sven@kernel.org>,
	Jack Pham <jack.pham@oss.qualcomm.com>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"usb4-upstream@oss.qualcomm.com" <usb4-upstream@oss.qualcomm.com>,
	Raghavendra Thoorpu <rthoorpu@qti.qualcomm.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 2/2] usb: dwc3: Notify XHCI core of tunneled status
Date: Thu, 14 May 2026 01:21:33 +0000	[thread overview]
Message-ID: <agUghtwMsx0G-OFS@vbox> (raw)
In-Reply-To: <agKBR1hsbPw_24Ov@vbox>

On Tue, May 12, 2026, Thinh Nguyen wrote:
> On Mon, May 11, 2026, Konrad Dybcio wrote:
> > On 5/9/26 1:31 AM, Thinh Nguyen wrote:
> > > 
> > > For the DWC3_CIOCTRL_CIO_EN to be set, it needs to be done by the type-c
> > > driver after detecting alternate mode right? How is it being done now?
> > > Can the udev->tunnel_mode be updated directly by your type-c driver
> > > when it sets DWC3_CIOCTRL_CIO_EN?
> > 
> > For us, it seems to be hardwired (not sure if actually, but definitely
> > effectively) to a separate register which is used to select the right
> > clock mux for the USB3 protocol adapter to work (which is to be set if
> > USB3 tunneling is going to be used)
> > 
> > Moreover, the register definition for our SoCs calls all fields of
> > CIOCTRL read-only, whereas the DWC programming guide says they're R/W -
> > possibly supporting my theory above
> > 
> > FWIW, our Type-C infra is as such:
> > 
> > 1. thick firmware layer running on a MCU that performs mode&PD handshakes
> > 2. drivers/soc/qcom/pmic_glink_altmode.c receives notifications of what
> >    the FW had negotiated with regards to mode
> > 3. a relatively small subset of UCSI provides PD data (and some altmode
> >    data)
> > 4. drivers/phy/qualcomm/phy-qcom-qmp-combo.c reprograms the PHY based
> >    on typec_mux events in native cases, or to USB4/TBT mode if the router
> >    driver requests it [that last part is not yet upstream]
> > 5. [optionally] retimer drivers in between (most often Parade PS883x
> >    series via drivers/usb/typec/mux/ps883x.c), which act as an
> >    additional typec_mux/switch in the chain
> > 6. [not upstream yet] USB4 router driver consumes some typec_mux
> >    parameters (orientation, cable and partner capabilities) and sends a
> >    command to another MCU to high-speed link establishment. It also sets
> >    the aforementioned magic register.
> > 
> > At a glance, 2. seems like a reasonably fitting place to set it, however:
> > * it does not have any sort of a handle to the typec_connector (it
> > only acts like a mux that sets another mux), and
> > * it may be going away in the future
> > 
> > so I'd much prefer to keep this logic somewhere near where this iteration
> > of the patch does - I think it'll be useful for more implementations, as
> > I'd imagine it'd be fairly commonplace to hardwire CIOCTRL_CIO_EN and
> > another part of the pipeline that must logically be online for USB4 to
> > be useful
> > 
> 
> Thanks for the details. Let me get back after discussing with our team
> internally.
> 

Hi,

There's no cleaner way I see to do this. We can use the
"usb4-host-interface" that you proposed. We also need to consider newer
DWC_usb3x IP versions support xHCI tunneling capability bit and
PORTSC.TM. The xHCI should check for the xHCI registers before deciding
to fallback to check the xhci_plat->tunnel_mode().


Thanks,
Thinh

      reply	other threads:[~2026-05-14  1:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  8:55 [PATCH 0/2] DWC3 link tunneling state reporting Konrad Dybcio
2026-05-05  8:55 ` [PATCH 1/2] usb: host: xhci: Allow non-Intel usb_link_tunnel_mode reporting Konrad Dybcio
2026-05-05 12:14   ` Mika Westerberg
2026-05-07 10:40     ` Konrad Dybcio
2026-05-07 12:48       ` Mathias Nyman
2026-05-07 12:53         ` Konrad Dybcio
2026-05-07 13:11           ` Mika Westerberg
2026-05-05  8:55 ` [PATCH 2/2] usb: dwc3: Notify XHCI core of tunneled status Konrad Dybcio
2026-05-06 23:40   ` Thinh Nguyen
2026-05-07 10:34     ` Konrad Dybcio
2026-05-07 17:46       ` Jack Pham
2026-05-07 22:46         ` Thinh Nguyen
2026-05-08 12:04           ` Konrad Dybcio
2026-05-08 23:31             ` Thinh Nguyen
2026-05-11  9:06               ` Konrad Dybcio
2026-05-11 18:44                 ` Sven Peter
2026-05-12 11:56                   ` Konrad Dybcio
2026-05-12  1:27                 ` Thinh Nguyen
2026-05-14  1:21                   ` Thinh Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agUghtwMsx0G-OFS@vbox \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack.pham@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rthoorpu@qti.qualcomm.com \
    --cc=sven@kernel.org \
    --cc=usb4-upstream@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox