Skip to content

Commit 594c823

Browse files
Avenger-285714gregkh
authored andcommitted
usb: host: xhci-plat: Assign shared_hcd->rsrc_start
When inserting a USB device, examining hcd->rsrc_start can be helpful in identifying which hcd is mounted, as the physical address represented here is typically unique. The following code snippet demonstrates this: struct usb_hcd *hcd = bus_to_hcd(udev->bus); unsigned long long usb_hcd_addr = (unsigned long long)hcd->rsrc_start; However, this approach has limitations now. For USB hosts with an MMIO interface, the effectiveness of this method is restricted to USB 2.0. Because commit 3429e91 ("usb: host: xhci: add platform driver support") assigned res->start to hcd->rsrc_start. But shared_hcd->rsrc_start remains unassigned, which is also necessary in certain scenarios. Fixes: 3429e91 ("usb: host: xhci: add platform driver support") Co-developed-by: Xu Rao <[email protected]> Signed-off-by: Xu Rao <[email protected]> Signed-off-by: WangYuli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7d39348 commit 594c823

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
329329
usb3_hcd->can_do_streams = 1;
330330

331331
if (xhci->shared_hcd) {
332+
xhci->shared_hcd->rsrc_start = hcd->rsrc_start;
333+
xhci->shared_hcd->rsrc_len = hcd->rsrc_len;
332334
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
333335
if (ret)
334336
goto put_usb3_hcd;

0 commit comments

Comments
 (0)