aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2014-02-11 14:36:04 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-04 18:41:09 -0500
commit14aec589327a6fc4035f5327d90ac5548f501c4c (patch)
tree89d5e181be3781fa1b7800b194e28f10c8ff762c
parent21d0e51bfb290349adc02fa8fec716d77f53df51 (diff)
storage: accept some UAS devices if streams are unavailable
On some older XHCIs streams are not supported and the UAS driver will fail at probe time. For those devices storage should try to bind to UAS devices. This patch adds a flag for stream support to HCDs and evaluates it. [Note: Sarah fixed a bug where the USB 2.0 root hub, not USB 3.0 root hub would get marked as being able to support streams.] Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/usb/host/xhci-pci.c3
-rw-r--r--drivers/usb/host/xhci-plat.c3
-rw-r--r--drivers/usb/storage/uas-detect.h4
-rw-r--r--include/linux/usb/hcd.h1
4 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 6c03584ac15f..cbf0c5cffc92 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -222,6 +222,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
222 goto put_usb3_hcd; 222 goto put_usb3_hcd;
223 /* Roothub already marked as USB 3.0 speed */ 223 /* Roothub already marked as USB 3.0 speed */
224 224
225 if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
226 xhci->shared_hcd->can_do_streams = 1;
227
225 return 0; 228 return 0;
226 229
227put_usb3_hcd: 230put_usb3_hcd:
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 8affef910782..151901ce1ba9 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -158,6 +158,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
158 */ 158 */
159 *((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci; 159 *((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci;
160 160
161 if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
162 xhci->shared_hcd->can_do_streams = 1;
163
161 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); 164 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
162 if (ret) 165 if (ret)
163 goto put_usb3_hcd; 166 goto put_usb3_hcd;
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index b8a02e12a8a2..bb05b984d5f6 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -72,6 +72,7 @@ static int uas_use_uas_driver(struct usb_interface *intf,
72{ 72{
73 struct usb_host_endpoint *eps[4] = { }; 73 struct usb_host_endpoint *eps[4] = { };
74 struct usb_device *udev = interface_to_usbdev(intf); 74 struct usb_device *udev = interface_to_usbdev(intf);
75 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
75 unsigned long flags = id->driver_info; 76 unsigned long flags = id->driver_info;
76 int r, alt; 77 int r, alt;
77 78
@@ -80,6 +81,9 @@ static int uas_use_uas_driver(struct usb_interface *intf,
80 if (flags & US_FL_IGNORE_UAS) 81 if (flags & US_FL_IGNORE_UAS)
81 return 0; 82 return 0;
82 83
84 if (udev->speed >= USB_SPEED_SUPER && !hcd->can_do_streams)
85 return 0;
86
83 alt = uas_find_uas_alt_setting(intf); 87 alt = uas_find_uas_alt_setting(intf);
84 if (alt < 0) 88 if (alt < 0)
85 return 0; 89 return 0;
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index efe8d8a7c7ad..485cd5e2100c 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -143,6 +143,7 @@ struct usb_hcd {
143 unsigned authorized_default:1; 143 unsigned authorized_default:1;
144 unsigned has_tt:1; /* Integrated TT in root hub */ 144 unsigned has_tt:1; /* Integrated TT in root hub */
145 unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ 145 unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */
146 unsigned can_do_streams:1; /* HC supports streams */
146 147
147 unsigned int irq; /* irq allocated */ 148 unsigned int irq; /* irq allocated */
148 void __iomem *regs; /* device memory/io */ 149 void __iomem *regs; /* device memory/io */