EHCI/xHCI port switching issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

We run Linux as a VM on top of the Muen Separation Kernel [1] where we
have implemented PCI device passthrough using VT-d.

I have come across an issue where USB ports of an assigned xHCI
controller are no longer being enabled in recent kernels (tested with
v3.18.3 and v3.19-rc5) while it is working in v3.11. I did a bisect and
identified commit 26b7679 ("Intel xhci: refactor EHCI/xHCI port
switching") as the cause. Upon closer inspection the relevant part of
the change seems to be in drivers/usb/host/pci-quirks.c:

void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
{
...
    /* make sure an intel EHCI controller exists */
    for_each_pci_dev(companion) {
        if (companion->class == PCI_CLASS_SERIAL_USB_EHCI &&
            companion->vendor == PCI_VENDOR_ID_INTEL) {
            ehci_found = true;
            break;
        }
    }

    if (!ehci_found)
        return;
...
}

In our test case we only grant Linux access to the xHCI but *not* the
EHCI controller. Since ehci_found is never true in this case the xHCI
ports will not be enabled. Commenting out the return statement results
in working xHCI ports.

Is there a different way to decide whether xHCI ports should be enabled
instead of looking for a companion EHCI controller or must the xHCI and
EHCI controllers always be accessible at the same time?

I suspect that the issue is also relevant for other hypervisors that
allow PCI passthrough in a similar fashion.

Note: I am not subscribed to the linux-usb mailing list, please keep me
as CC.

Regards,
Adrian

[1] - http://muen.codelabs.ch/
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux