public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Jakob Trumpower <jakob.trumpower@matrixspace.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"balbi@kernel.org" <balbi@kernel.org>
Subject: Re: [BUG REPORT] usb: dwc3: Failure to enumerate from boot.
Date: Wed, 14 May 2025 00:48:04 +0000	[thread overview]
Message-ID: <20250514004759.v4twvbma5rm3mept@synopsys.com> (raw)
In-Reply-To: <PH0PR06MB70771B5C2F3FA38E0BC9E2F4E88AA@PH0PR06MB7077.namprd06.prod.outlook.com>

On Fri, May 09, 2025, Jakob Trumpower wrote:
> Hi Thinh,
> 
> Sorry about the formatting, I switched outlook to use plain text.
> 
> I removed the reset at init like you mentioned with the patch. As well as put the quirks back in for u2,u3 disable. I also had tried manually toggling the /sys/bus entries in the past, and would usually see the hub messages come back but the downstream device would still not enumerate. I tried it again with no change. Note: usb3 is the 2.0 controller for the same port.
> 
> root@ms-radar-01:~# cat /sys/bus/usb/devices/usb4/4-0:1.0/usb4-port1/disable                                                                                                                                    
> 0                                                                                                                        
> root@ms-radar-01:~# echo 1 >  /sys/bus/usb/devices/usb4/4-0\:1.0/usb4-port1/disable                                                                                                                                          
> root@ms-radar-01:~# echo 0 >  /sys/bus/usb/devices/usb4/4-0\:1.0/usb4-port1/disable                                                                                                                                          
> root@ms-radar-01:~# echo 1 >  /sys/bus/usb/devices/usb3/3-0\:1.0/usb3-port1/disable                                                                                                                                          
> root@ms-radar-01:~# echo 0 >  /sys/bus/usb/devices/usb3/3-0\:1.0/usb3-port1/disable  
> 
> Here I am toggling authorized instead and I do see some messages, but still no device:
>                                                                                                          
> root@ms-radar-01:~#         sudo echo 0 > /sys/bus/usb/devices/usb4/authorized                                                                                                                                  
> root@ms-radar-01:~#         sudo echo 1 > /sys/bus/usb/devices/usb4/authorized                                                                                                                                  
> [ 2208.950615] hub 4-0:1.0: USB hub found                                                                                                                                                                       
> [ 2208.954440] hub 4-0:1.0: 1 port detected                                                                                                                                                                     
> [ 2208.960168] usb usb4: authorized to connect                                                                             
> 
> 
> Then once again, I cycle the usb C connector and it comes up:
> root@ms-radar-01:~# [  323.210398] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd                                                                                                                   
> [  323.511597] usb 4-1: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00                                                                                                                    
> [  323.519776] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3                                                                                                                                
> [  323.526917] usb 4-1: Product: AX88179A                                                                                                                                                                       
> [  323.530672] usb 4-1: Manufacturer: ASIX                                                                                                                                                                      
> [  323.534506] usb 4-1: SerialNumber: 00000000000FF3                                                                                                                                                            
> [  323.913798] cdc_ncm 4-1:2.0: MAC-Address: a0:ce:c8:ba:a9:44                                                                                                                                                  
> [  323.919389] cdc_ncm 4-1:2.0: setting rx_max = 16384                                                                                                                                                          
> [  323.937168] cdc_ncm 4-1:2.0: setting tx_max = 16384                                                                                                                                                          
> [  323.951984] cdc_ncm 4-1:2.0 eth0: register 'cdc_ncm' at usb-xhci-hcd.2.auto-1, CDC NCM (NO ZLP), a0:ce:c8:ba:a9:44                                                                                           
> [  324.103396] cdc_ncm 4-1:2.0 enu1c2: renamed from eth0 
> 
> Very strange the plug cycle seems to fix the controller reliably. Also to note that it happens to every 3.0 device I have tested. I have a change order for our next board revision to toggle the VBUS with a GPIO, but not an ideal solution.
> 
> I know USB and these controllers are extremely complex so I appreciate your time and expertise.
> 
> Let me know if you can think of any other registers/experiments we can try.
> 

Thanks for the experiments. 

Ok, this is odd. It's not what I thought. If the usb3 port detection
fails a few times, then it should fallback to usb2 connection.

Let's check the portsc:
# cat /sys/kernel/debug/usb/xhci/<your_controller>/ports/**/*

Also, can you add this to the kernel cmdline to capture the xhci
tracepoints:

"xhci_hcd.dyndbg=+p trace_event=xhci-hcd trace_buf_size=30M"

# cat /sys/kernel/debug/tracing/trace > tracepoints.log

Thanks,
Thinh

  reply	other threads:[~2025-05-14  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 14:54 [BUG REPORT] usb: dwc3: Failure to enumerate from boot Jakob Trumpower
2025-05-01  0:14 ` Thinh Nguyen
     [not found]   ` <PH0PR06MB7077C939CDCF50DADE0A70F6E889A@PH0PR06MB7077.namprd06.prod.outlook.com>
2025-05-08  0:32     ` Thinh Nguyen
2025-05-09 15:50       ` Jakob Trumpower
2025-05-14  0:48         ` Thinh Nguyen [this message]
2025-06-06 21:23           ` Jakob Trumpower
2025-06-10 21:36             ` Thinh Nguyen
2025-06-17  1:24               ` Thinh Nguyen

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=20250514004759.v4twvbma5rm3mept@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=jakob.trumpower@matrixspace.com \
    --cc=linux-usb@vger.kernel.org \
    /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