All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Alexander Wilhelm <alexander.wilhelm@westermo.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: usb: Error while assigning device slot ID
Date: Tue, 9 Dec 2025 16:53:31 +0200	[thread overview]
Message-ID: <b8947ce6-8e34-45fa-aaa9-262ac1232bcf@linux.intel.com> (raw)
In-Reply-To: <aTKWWjfWihg0a9WP@FUE-ALEWI-WINX>

Hi

Flash driver appears as a Full-Speed device. Is this correct?

Does it work if you boot without the drive and then connect it later?

On 12/5/25 10:22, Alexander Wilhelm wrote:

> Hi Mathias,
> 
> Sure, here are the commands input and dmesg output:
> 
>      user@host:~# mount -t debugfs none /sys/kernel/debug
>      user@host:~# echo 'module xhci_hcd =p' >/sys/kernel/debug/dynamic_debug/control
>      user@host:~# echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control
>      user@host:~# modprobe xhci_plat_hcd
> 
>      xhci-hcd xhci-hcd.3.auto: // Turn on HC, cmd = 0x5.
>      hub 5-0:1.0: USB hub found
>      hub 5-0:1.0: 1 port detected
>      xhci-hcd xhci-hcd.3.auto: set port power 5-1 ON, portsc: 0x206e1

Device is detected early during hub init on xhci-hcd.3.auto USB5 bus port 1.

>      xhci-hcd xhci-hcd.3.auto: Get port status 5-1 read: 0x206e1, return 0x10101
>      usb usb5-port1: status 0101 change 0001>      xhci-hcd xhci-hcd.3.auto: Get port status 5-1 read: 0x6e1, return 0x101
>      usb usb5-port1: status 0101, change 0000, 12 Mb/s

hub driver reacts to the FS device

>      xhci-hcd xhci-hcd.3.auto: // Ding dong!

hub driver queued xhci enable slot command during usb_alloc_dev(), and rings doorbell.
At least xhci driver assumes command ring and xHC are in proper running states.

>      xhci-hcd xhci-hcd.3.auto: Command timeout, USBSTS: 0x00000000

Command times out, xHC is running, no pending interrupts

>      xhci-hcd xhci-hcd.3.auto: Command timeout
>      xhci-hcd xhci-hcd.3.auto: Abort command ring
>      xhci-hcd xhci-hcd.3.auto: No stop event for abort, ring start fail?

No event for aborting the ring ether.
Maybe interrupts from this xHC aren't coming through.
Or then something in xHC isn't set up properly when command is queued.

Could you add xhci tracing, and dump the command and event rings after timeout?

Debug and tracing:

mount -t debugfs none /sys/kernel/debug
echo 'module xhci_hcd =p' >/sys/kernel/debug/dynamic_debug/control
echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control
echo 81920 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/xhci-hcd/enable
echo 1 > /sys/kernel/debug/tracing/tracing_on
< Reproduce issue >
Send output of dmesg
Send content of /sys/kernel/debug/tracing/trace

Dumping command and event rings after command timeout:

cat /sys/kernel/debug/usb/xhci/<hci-hcd.3.auto address> /event-ring/trbs
cat /sys/kernel/debug/usb/xhci/<hci-hcd.3.auto address>/command-ring/trbs

Thanks
Mathias









  reply	other threads:[~2025-12-09 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 11:09 usb: Error while assigning device slot ID Alexander Wilhelm
2025-12-04 15:35 ` Mathias Nyman
2025-12-05  8:22   ` Alexander Wilhelm
2025-12-09 14:53     ` Mathias Nyman [this message]
2025-12-10  8:31       ` Alexander Wilhelm
2025-12-15 11:40         ` Mathias Nyman
2026-01-19  7:16           ` Alexander Wilhelm

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=b8947ce6-8e34-45fa-aaa9-262ac1232bcf@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=alexander.wilhelm@westermo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.