Linux USB
 help / color / mirror / Atom feed
From: Alexander Wilhelm <alexander.wilhelm@westermo.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Shawn Guo <shawnguo@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
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-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: usb: Error while assigning device slot ID
Date: Mon, 19 Jan 2026 08:16:26 +0100	[thread overview]
Message-ID: <aW3aSrF-ZNk3FKSU@FUE-ALEWI-WINX> (raw)
In-Reply-To: <52ccfa26-4dc7-4832-8f73-ead5d6c3629f@linux.intel.com>

On Mon, Dec 15, 2025 at 01:40:08PM +0200, Mathias Nyman wrote:
> On 12/10/25 10:31, Alexander Wilhelm wrote:
> > > Flash driver appears as a Full-Speed device. Is this correct?
> > 
> > Yes, that's right.
> > 
> > > Does it work if you boot without the drive and then connect it later?
> > 
> > If I do so, nothing happens and I see nothing in logread, too.
> > 
> > [...]
> > > Could you add xhci tracing, and dump the command and event rings after timeout?
> > 
> > Sure, here are the commands and their respective output:
> > 
> >      # tracer: nop
> >      #
> >      # entries-in-buffer/entries-written: 103/103   #P:4
> >      #
> >      #                                _-----=> irqs-off/BH-disabled
> >      #                               / _----=> need-resched
> >      #                              | / _---=> hardirq/softirq
> >      #                              || / _--=> preempt-depth
> >      #                              ||| / _-=> migrate-disable
> >      #                              |||| /     delay
> >      #           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
> >      #              | |         |   |||||     |         |
> >              modprobe-20491   [001] .N...   242.678069: xhci_dbg_init: // Device context base array address = 0x0x00000000813f1000 (DMA), 000000006440d11f (virt)
> >              modprobe-20491   [001] .N...   242.678079: xhci_ring_alloc: CMD 0000000099949093: enq 0x0000000086616000(0x0000000086616000) deq 0x0000000086616000(0x0000000086616000) segs 1 stream 0 bounce 0 cycle 1
> >              modprobe-20491   [001] .N...   242.678085: xhci_dbg_init: Allocated command ring at 0000000099949093
> >              modprobe-20491   [001] .N...   242.678090: xhci_dbg_init: First segment DMA is 0x0x0000000086616000
> >              modprobe-20491   [001] .N...   242.678095: xhci_dbg_init: // Setting command ring address to 0x0000000086616001
> >              modprobe-20491   [001] .N...   242.678101: xhci_dbg_init: // Doorbell array is located at offset 0x480 from cap regs base addr
> >              modprobe-20491   [001] .N...   242.678106: xhci_dbg_init: Allocating primary event ring
> >              modprobe-20491   [001] .N...   242.678111: xhci_ring_alloc: EVENT 0000000069cb484c: enq 0x000000009dd65000(0x000000009dd65000) deq 0x000000009dd65000(0x000000009dd65000) segs 2 stream 0 bounce 0 cycle 1
> >              modprobe-20491   [001] .N...   242.678118: xhci_dbg_init: // Write event ring dequeue pointer, preserving EHB bit
> >              modprobe-20491   [001] .N...   242.678199: xhci_dbg_init: xhci_run
> >              modprobe-20491   [001] .N...   242.678204: xhci_dbg_init: ERST deq = 64'h9dd65000
> >              modprobe-20491   [001] dN...   242.678318: xhci_dbg_init: // Turn on HC, cmd = 0x5.
> >           kworker/1:1-54      [001] d....   242.695620: xhci_get_port_status: port-0: Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> >           kworker/1:3-20526   [001] d....   242.699424: xhci_get_port_status: port-0: Powered Connected Disabled Link:Polling PortSpeed:1 Change: CSC Wake:
> >           kworker/1:2-82      [001] d....   242.699445: xhci_get_port_status: port-0: Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> >           kworker/1:0-21      [001] d....   242.775417: xhci_get_port_status: port-0: Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> >           kworker/1:0-21      [001] d....   242.779413: xhci_get_port_status: port-0: Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> >           kworker/1:0-21      [001] d....   242.783420: xhci_get_port_status: port-0: Powered Not-connected Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> >           kworker/1:0-21      [001] d....   242.803419: xhci_get_port_status: port-0: Powered Connected Disabled Link:Polling PortSpeed:1 Change: Wake:
> >           kworker/1:0-21      [001] d....   242.803448: xhci_queue_trb: CMD: Enable Slot Command: flags C
> >           kworker/1:0-21      [001] d....   242.803449: xhci_inc_enq: CMD 0000000099949093: enq 0x0000000086616010(0x0000000086616000) deq 0x0000000086616000(0x0000000086616000) segs 1 stream 0 bounce 0 cycle 1
> >           kworker/1:0-21      [001] d....   242.803455: xhci_ring_host_doorbell: Ring doorbell for Command Ring 0
> > 
> 
> Command ring is at 0x0000000086616000, crcr register is set correctly, cycle is set to 1
> Event ring is at 0x000000009dd65000
> 
> Driver correctly writes the command to command ring at 0x0000000086616001
> 
> > even-ring/trbs:
> > 
> >      0x000000009dd65000: type 'UNKNOWN' -> raw 00000000 00000000 00000000 00000000
> >      0x000000009dd65010: type 'UNKNOWN' -> raw 00000000 00000000 00000000 00000000
> > 
> > command-ring/trbs:
> > 
> >      0x0000000086616000: Enable Slot Command: flags C
> >      0x0000000086616010: type 'UNKNOWN' -> raw 00000000 00000000 00000000 00000000
> 
> > 
> > It seems like the TRBS output here is not very useful, is it?
> 
> 
> It shows the enable slot command was correctly queued to the command ring at 0x86616000,
> but xHC controller didn't process it at all as event ring is empty.
> 
> It behaves as if xHC isn't really running at all.
> portsc registers can show port status (connect) even if xHC isn't running.
> 
> I guess next step would be to bisect this and find the offending commit

Hi Mathias,

It unfortunately took a while to identify the faulty commit with the
bisect, because many commits on the master branch did not boot on my
platform. I used the `stable` kernel repository and narrowed it down to the
following commit:

    136975c33894e7b48a6007af0f4c25f423bbd1de
    arm64: dts: ls1046a: make dma-coherent global to the SoC

As it turns out, the problem was not directly related to the USB subsystem,
but rather to the DMA changes on the Layerscape platform. When I revert
this commit, USB works perfectly on my system. I have now CC'ed the
`linux-arm-kernel` mailing list as well. Maybe someone has seen a similar
issue and could provide some guidance.


Best regards
Alexander Wilhelm

      reply	other threads:[~2026-01-19  7:28 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
2025-12-10  8:31       ` Alexander Wilhelm
2025-12-15 11:40         ` Mathias Nyman
2026-01-19  7:16           ` Alexander Wilhelm [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=aW3aSrF-ZNk3FKSU@FUE-ALEWI-WINX \
    --to=alexander.wilhelm@westermo.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.com \
    --cc=robh@kernel.org \
    --cc=shawnguo@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