]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xhci: Handle MaxPSASize == 0
authorHans de Goede <hdegoede@redhat.com>
Fri, 15 Nov 2013 11:14:38 +0000 (12:14 +0100)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 4 Mar 2014 23:38:14 +0000 (15:38 -0800)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci.c

index 6cb9c2235a0bfda07190232475548e8090be414b..1db3c2794a49ae37e36bb0e9aa93394be0a68593 100644 (file)
@@ -3138,6 +3138,12 @@ int xhci_alloc_streams(struct usb_hcd *hcd, struct usb_device *udev,
        xhci_dbg(xhci, "Driver wants %u stream IDs (including stream 0).\n",
                        num_streams);
 
+       /* MaxPSASize value 0 (2 streams) means streams are not supported */
+       if (HCC_MAX_PSA(xhci->hcc_params) < 4) {
+               xhci_dbg(xhci, "xHCI controller does not support streams.\n");
+               return -ENOSYS;
+       }
+
        config_cmd = xhci_alloc_command(xhci, true, true, mem_flags);
        if (!config_cmd) {
                xhci_dbg(xhci, "Could not allocate xHCI command structure.\n");