public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* XHCI without USB2 ports
@ 2024-02-12 18:39 Jan Henrik Weinstock
  2024-02-13  9:59 ` Mathias Nyman
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Henrik Weinstock @ 2024-02-12 18:39 UTC (permalink / raw)
  To: mathias.nyman, gregkh, linux-usb, linux-kernel; +Cc: Lukas Jünger

Hi all,

I am currently working on an XHCI platform device simulation model. I
noticed that the Linux driver (Linux 6.5.6 xhci-hcd) stops working
when I configure the model without any USB2 ports. During an interrupt
(TRB_PORT_STATUS), I only get "xhci-hcd 12100000.usb: ignore port
event for removed USB3 hcd."

During xhci_irq, in handle_port_status, xhci->shared_hcd is NULL [1],
so the interrupt gets ignored. However, shared_hcd would only ever be
allocated during xhci_plat_probe [2], if the device has both USB2 and
USB3 ports, i.e. xhci_has_one_roothub returns false [3].

Without any USB2 ports, a shared_hcd will never be allocated in the
first place, and handle_port_status will always exit early.

I am new to the USB driver framework, so it's quite likely I am just
overlooking something; but to me it seems that the driver cannot work
unless I have an XHCI device that has at least one USB2 and one USB3
port. But during boot, I only get "USB2 root hub has no ports", which
is not fatal.

Best regards
Jan

[1] https://elixir.bootlin.com/linux/v6.5.6/source/drivers/usb/host/xhci-ring.c#L1895
[2] https://elixir.bootlin.com/linux/v6.5.6/source/drivers/usb/host/xhci-plat.c#L282
[3] https://elixir.bootlin.com/linux/v6.5.6/source/drivers/usb/host/xhci.h#L2001

-- 
Dr.-Ing. Jan Henrik Weinstock
Managing Director

MachineWare GmbH | www.machineware.de
Hühnermarkt 19, 52062 Aachen, Germany
Amtsgericht Aachen HRB25734

Geschäftsführung
Lukas Jünger
Dr.-Ing. Jan Henrik Weinstock

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-13 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-12 18:39 XHCI without USB2 ports Jan Henrik Weinstock
2024-02-13  9:59 ` Mathias Nyman
2024-02-13 14:50   ` Jan Henrik Weinstock
2024-02-13 15:42     ` Mathias Nyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox