From: Hans de Goede Date: Fri, 15 Nov 2013 11:14:38 +0000 (+0100) Subject: xhci: Handle MaxPSASize == 0 X-Git-Tag: v3.15-rc1~137^2~26^2~37 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f7920884eb640bc642f3b4e56f5237d30a080eda;p=karo-tx-linux.git xhci: Handle MaxPSASize == 0 Signed-off-by: Hans de Goede Signed-off-by: Sarah Sharp --- diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6cb9c2235a0b..1db3c2794a49 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -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");