diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-14 19:15:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-14 19:15:45 -0500 |
commit | ca033390a537dacdc2127c66d62e7862ad15ffdb (patch) | |
tree | 7ab07050e68da0594c8dbd0df697627fd30d1839 | |
parent | 40a215fba1901c2ee95dbb7ce801fae580ecd80e (diff) | |
parent | 3635c7e2d59f7861afa6fa5e87e2a58860ff514d (diff) |
Merge tag 'usb-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here is a bunch of USB fixes for 3.14-rc3. Most of these are xhci
reverts, fixing a bunch of reported issues with USB 3 host controller
issues that loads of people have been hitting (with the exception of
kernel developers, all of our machines seem to be working fine, which
is why these took so long to get resolved...)
There are some other minor fixes and new device ids, as ususal. All
have been in linux-next successfully"
* tag 'usb-3.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (22 commits)
usb: option: blacklist ZTE MF667 net interface
Revert "usb: xhci: Link TRB must not occur within a USB payload burst"
Revert "xhci: Avoid infinite loop when sg urb requires too many trbs"
Revert "xhci: Set scatter-gather limit to avoid failed block writes."
xhci 1.0: Limit arbitrarily-aligned scatter gather.
Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
usb: core: Fix potential memory leak adding dyn USBdevice IDs
USB: ftdi_sio: add Tagsys RFID Reader IDs
usb: qcserial: add Netgear Aircard 340U
usb-storage: enable multi-LUN scanning when needed
USB: simple: add Dynastream ANT USB-m Stick device support
usb-storage: add unusual-devs entry for BlackBerry 9000
usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
usb: phy: move some error messages to debug
usb: ftdi_sio: add Mindstorms EV3 console adapter
usb: dwc2: fix memory corruption in dwc2 driver
usb: dwc2: fix role switch breakage
usb: dwc2: bail out early when booting with "nousb"
Revert "xhci: replace xhci_read_64() with readq()"
Revert "xhci: replace xhci_write_64() with writeq()"
...
-rw-r--r-- | drivers/usb/core/driver.c | 24 | ||||
-rw-r--r-- | drivers/usb/core/hcd.c | 1 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 7 | ||||
-rw-r--r-- | drivers/usb/core/usb.h | 1 | ||||
-rw-r--r-- | drivers/usb/dwc2/core.c | 2 | ||||
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 11 | ||||
-rw-r--r-- | drivers/usb/dwc2/platform.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/xhci-dbg.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 14 | ||||
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 68 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 38 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 41 | ||||
-rw-r--r-- | drivers/usb/phy/phy.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio_ids.h | 7 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/qcserial.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial-simple.c | 3 | ||||
-rw-r--r-- | drivers/usb/storage/Kconfig | 4 | ||||
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 6 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_cypress.h | 2 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_devs.h | 7 | ||||
-rw-r--r-- | include/linux/usb.h | 2 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 4 |
25 files changed, 138 insertions, 135 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 5d01558cef66..ab90a0156828 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -63,8 +63,10 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, | |||
63 | dynid->id.idProduct = idProduct; | 63 | dynid->id.idProduct = idProduct; |
64 | dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE; | 64 | dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE; |
65 | if (fields > 2 && bInterfaceClass) { | 65 | if (fields > 2 && bInterfaceClass) { |
66 | if (bInterfaceClass > 255) | 66 | if (bInterfaceClass > 255) { |
67 | return -EINVAL; | 67 | retval = -EINVAL; |
68 | goto fail; | ||
69 | } | ||
68 | 70 | ||
69 | dynid->id.bInterfaceClass = (u8)bInterfaceClass; | 71 | dynid->id.bInterfaceClass = (u8)bInterfaceClass; |
70 | dynid->id.match_flags |= USB_DEVICE_ID_MATCH_INT_CLASS; | 72 | dynid->id.match_flags |= USB_DEVICE_ID_MATCH_INT_CLASS; |
@@ -73,17 +75,21 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, | |||
73 | if (fields > 4) { | 75 | if (fields > 4) { |
74 | const struct usb_device_id *id = id_table; | 76 | const struct usb_device_id *id = id_table; |
75 | 77 | ||
76 | if (!id) | 78 | if (!id) { |
77 | return -ENODEV; | 79 | retval = -ENODEV; |
80 | goto fail; | ||
81 | } | ||
78 | 82 | ||
79 | for (; id->match_flags; id++) | 83 | for (; id->match_flags; id++) |
80 | if (id->idVendor == refVendor && id->idProduct == refProduct) | 84 | if (id->idVendor == refVendor && id->idProduct == refProduct) |
81 | break; | 85 | break; |
82 | 86 | ||
83 | if (id->match_flags) | 87 | if (id->match_flags) { |
84 | dynid->id.driver_info = id->driver_info; | 88 | dynid->id.driver_info = id->driver_info; |
85 | else | 89 | } else { |
86 | return -ENODEV; | 90 | retval = -ENODEV; |
91 | goto fail; | ||
92 | } | ||
87 | } | 93 | } |
88 | 94 | ||
89 | spin_lock(&dynids->lock); | 95 | spin_lock(&dynids->lock); |
@@ -95,6 +101,10 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids, | |||
95 | if (retval) | 101 | if (retval) |
96 | return retval; | 102 | return retval; |
97 | return count; | 103 | return count; |
104 | |||
105 | fail: | ||
106 | kfree(dynid); | ||
107 | return retval; | ||
98 | } | 108 | } |
99 | EXPORT_SYMBOL_GPL(usb_store_new_id); | 109 | EXPORT_SYMBOL_GPL(usb_store_new_id); |
100 | 110 | ||
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 199aaea6bfe0..2518c3250750 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1032,7 +1032,6 @@ static int register_root_hub(struct usb_hcd *hcd) | |||
1032 | dev_name(&usb_dev->dev), retval); | 1032 | dev_name(&usb_dev->dev), retval); |
1033 | return retval; | 1033 | return retval; |
1034 | } | 1034 | } |
1035 | usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev); | ||
1036 | } | 1035 | } |
1037 | 1036 | ||
1038 | retval = usb_new_device (usb_dev); | 1037 | retval = usb_new_device (usb_dev); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index babba885978d..64ea21971be2 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -128,7 +128,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev) | |||
128 | return usb_get_intfdata(hdev->actconfig->interface[0]); | 128 | return usb_get_intfdata(hdev->actconfig->interface[0]); |
129 | } | 129 | } |
130 | 130 | ||
131 | int usb_device_supports_lpm(struct usb_device *udev) | 131 | static int usb_device_supports_lpm(struct usb_device *udev) |
132 | { | 132 | { |
133 | /* USB 2.1 (and greater) devices indicate LPM support through | 133 | /* USB 2.1 (and greater) devices indicate LPM support through |
134 | * their USB 2.0 Extended Capabilities BOS descriptor. | 134 | * their USB 2.0 Extended Capabilities BOS descriptor. |
@@ -149,11 +149,6 @@ int usb_device_supports_lpm(struct usb_device *udev) | |||
149 | "Power management will be impacted.\n"); | 149 | "Power management will be impacted.\n"); |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | |||
153 | /* udev is root hub */ | ||
154 | if (!udev->parent) | ||
155 | return 1; | ||
156 | |||
157 | if (udev->parent->lpm_capable) | 152 | if (udev->parent->lpm_capable) |
158 | return 1; | 153 | return 1; |
159 | 154 | ||
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index c49383669cd8..823857767a16 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -35,7 +35,6 @@ extern int usb_get_device_descriptor(struct usb_device *dev, | |||
35 | unsigned int size); | 35 | unsigned int size); |
36 | extern int usb_get_bos_descriptor(struct usb_device *dev); | 36 | extern int usb_get_bos_descriptor(struct usb_device *dev); |
37 | extern void usb_release_bos_descriptor(struct usb_device *dev); | 37 | extern void usb_release_bos_descriptor(struct usb_device *dev); |
38 | extern int usb_device_supports_lpm(struct usb_device *udev); | ||
39 | extern char *usb_cache_string(struct usb_device *udev, int index); | 38 | extern char *usb_cache_string(struct usb_device *udev, int index); |
40 | extern int usb_set_configuration(struct usb_device *dev, int configuration); | 39 | extern int usb_set_configuration(struct usb_device *dev, int configuration); |
41 | extern int usb_choose_configuration(struct usb_device *udev); | 40 | extern int usb_choose_configuration(struct usb_device *udev); |
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 8565d87f94b4..1d129884cc39 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c | |||
@@ -216,7 +216,7 @@ static int dwc2_hs_phy_init(struct dwc2_hsotg *hsotg, bool select_phy) | |||
216 | int retval = 0; | 216 | int retval = 0; |
217 | 217 | ||
218 | if (!select_phy) | 218 | if (!select_phy) |
219 | return -ENODEV; | 219 | return 0; |
220 | 220 | ||
221 | usbcfg = readl(hsotg->regs + GUSBCFG); | 221 | usbcfg = readl(hsotg->regs + GUSBCFG); |
222 | 222 | ||
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index f59484d43b35..4d918ed8d343 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
@@ -2565,25 +2565,14 @@ static void _dwc2_hcd_endpoint_reset(struct usb_hcd *hcd, | |||
2565 | struct usb_host_endpoint *ep) | 2565 | struct usb_host_endpoint *ep) |
2566 | { | 2566 | { |
2567 | struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); | 2567 | struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); |
2568 | int is_control = usb_endpoint_xfer_control(&ep->desc); | ||
2569 | int is_out = usb_endpoint_dir_out(&ep->desc); | ||
2570 | int epnum = usb_endpoint_num(&ep->desc); | ||
2571 | struct usb_device *udev; | ||
2572 | unsigned long flags; | 2568 | unsigned long flags; |
2573 | 2569 | ||
2574 | dev_dbg(hsotg->dev, | 2570 | dev_dbg(hsotg->dev, |
2575 | "DWC OTG HCD EP RESET: bEndpointAddress=0x%02x\n", | 2571 | "DWC OTG HCD EP RESET: bEndpointAddress=0x%02x\n", |
2576 | ep->desc.bEndpointAddress); | 2572 | ep->desc.bEndpointAddress); |
2577 | 2573 | ||
2578 | udev = to_usb_device(hsotg->dev); | ||
2579 | |||
2580 | spin_lock_irqsave(&hsotg->lock, flags); | 2574 | spin_lock_irqsave(&hsotg->lock, flags); |
2581 | |||
2582 | usb_settoggle(udev, epnum, is_out, 0); | ||
2583 | if (is_control) | ||
2584 | usb_settoggle(udev, epnum, !is_out, 0); | ||
2585 | dwc2_hcd_endpoint_reset(hsotg, ep); | 2575 | dwc2_hcd_endpoint_reset(hsotg, ep); |
2586 | |||
2587 | spin_unlock_irqrestore(&hsotg->lock, flags); | 2576 | spin_unlock_irqrestore(&hsotg->lock, flags); |
2588 | } | 2577 | } |
2589 | 2578 | ||
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index d01d0d3f2cf0..eaba547ce26b 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -124,6 +124,9 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
124 | int retval; | 124 | int retval; |
125 | int irq; | 125 | int irq; |
126 | 126 | ||
127 | if (usb_disabled()) | ||
128 | return -ENODEV; | ||
129 | |||
127 | match = of_match_device(dwc2_of_match_table, &dev->dev); | 130 | match = of_match_device(dwc2_of_match_table, &dev->dev); |
128 | if (match && match->data) { | 131 | if (match && match->data) { |
129 | params = match->data; | 132 | params = match->data; |
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index b016d38199f2..eb009a457fb5 100644 --- a/drivers/usb/host/xhci-dbg.c +++ b/drivers/usb/host/xhci-dbg.c | |||
@@ -203,12 +203,12 @@ void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) | |||
203 | addr, (unsigned int)temp); | 203 | addr, (unsigned int)temp); |
204 | 204 | ||
205 | addr = &ir_set->erst_base; | 205 | addr = &ir_set->erst_base; |
206 | temp_64 = readq(addr); | 206 | temp_64 = xhci_read_64(xhci, addr); |
207 | xhci_dbg(xhci, " %p: ir_set.erst_base = @%08llx\n", | 207 | xhci_dbg(xhci, " %p: ir_set.erst_base = @%08llx\n", |
208 | addr, temp_64); | 208 | addr, temp_64); |
209 | 209 | ||
210 | addr = &ir_set->erst_dequeue; | 210 | addr = &ir_set->erst_dequeue; |
211 | temp_64 = readq(addr); | 211 | temp_64 = xhci_read_64(xhci, addr); |
212 | xhci_dbg(xhci, " %p: ir_set.erst_dequeue = @%08llx\n", | 212 | xhci_dbg(xhci, " %p: ir_set.erst_dequeue = @%08llx\n", |
213 | addr, temp_64); | 213 | addr, temp_64); |
214 | } | 214 | } |
@@ -412,7 +412,7 @@ void xhci_dbg_cmd_ptrs(struct xhci_hcd *xhci) | |||
412 | { | 412 | { |
413 | u64 val; | 413 | u64 val; |
414 | 414 | ||
415 | val = readq(&xhci->op_regs->cmd_ring); | 415 | val = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); |
416 | xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n", | 416 | xhci_dbg(xhci, "// xHC command ring deq ptr low bits + flags = @%08x\n", |
417 | lower_32_bits(val)); | 417 | lower_32_bits(val)); |
418 | xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n", | 418 | xhci_dbg(xhci, "// xHC command ring deq ptr high bits = @%08x\n", |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 873c272b3ef5..bce4391a0e7d 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1958,7 +1958,7 @@ static void xhci_set_hc_event_deq(struct xhci_hcd *xhci) | |||
1958 | xhci_warn(xhci, "WARN something wrong with SW event ring " | 1958 | xhci_warn(xhci, "WARN something wrong with SW event ring " |
1959 | "dequeue ptr.\n"); | 1959 | "dequeue ptr.\n"); |
1960 | /* Update HC event ring dequeue pointer */ | 1960 | /* Update HC event ring dequeue pointer */ |
1961 | temp = readq(&xhci->ir_set->erst_dequeue); | 1961 | temp = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); |
1962 | temp &= ERST_PTR_MASK; | 1962 | temp &= ERST_PTR_MASK; |
1963 | /* Don't clear the EHB bit (which is RW1C) because | 1963 | /* Don't clear the EHB bit (which is RW1C) because |
1964 | * there might be more events to service. | 1964 | * there might be more events to service. |
@@ -1967,7 +1967,7 @@ static void xhci_set_hc_event_deq(struct xhci_hcd *xhci) | |||
1967 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 1967 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
1968 | "// Write event ring dequeue pointer, " | 1968 | "// Write event ring dequeue pointer, " |
1969 | "preserving EHB bit"); | 1969 | "preserving EHB bit"); |
1970 | writeq(((u64) deq & (u64) ~ERST_PTR_MASK) | temp, | 1970 | xhci_write_64(xhci, ((u64) deq & (u64) ~ERST_PTR_MASK) | temp, |
1971 | &xhci->ir_set->erst_dequeue); | 1971 | &xhci->ir_set->erst_dequeue); |
1972 | } | 1972 | } |
1973 | 1973 | ||
@@ -2269,7 +2269,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2269 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 2269 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
2270 | "// Device context base array address = 0x%llx (DMA), %p (virt)", | 2270 | "// Device context base array address = 0x%llx (DMA), %p (virt)", |
2271 | (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa); | 2271 | (unsigned long long)xhci->dcbaa->dma, xhci->dcbaa); |
2272 | writeq(dma, &xhci->op_regs->dcbaa_ptr); | 2272 | xhci_write_64(xhci, dma, &xhci->op_regs->dcbaa_ptr); |
2273 | 2273 | ||
2274 | /* | 2274 | /* |
2275 | * Initialize the ring segment pool. The ring must be a contiguous | 2275 | * Initialize the ring segment pool. The ring must be a contiguous |
@@ -2312,13 +2312,13 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2312 | (unsigned long long)xhci->cmd_ring->first_seg->dma); | 2312 | (unsigned long long)xhci->cmd_ring->first_seg->dma); |
2313 | 2313 | ||
2314 | /* Set the address in the Command Ring Control register */ | 2314 | /* Set the address in the Command Ring Control register */ |
2315 | val_64 = readq(&xhci->op_regs->cmd_ring); | 2315 | val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); |
2316 | val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) | | 2316 | val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) | |
2317 | (xhci->cmd_ring->first_seg->dma & (u64) ~CMD_RING_RSVD_BITS) | | 2317 | (xhci->cmd_ring->first_seg->dma & (u64) ~CMD_RING_RSVD_BITS) | |
2318 | xhci->cmd_ring->cycle_state; | 2318 | xhci->cmd_ring->cycle_state; |
2319 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 2319 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
2320 | "// Setting command ring address to 0x%x", val); | 2320 | "// Setting command ring address to 0x%x", val); |
2321 | writeq(val_64, &xhci->op_regs->cmd_ring); | 2321 | xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); |
2322 | xhci_dbg_cmd_ptrs(xhci); | 2322 | xhci_dbg_cmd_ptrs(xhci); |
2323 | 2323 | ||
2324 | xhci->lpm_command = xhci_alloc_command(xhci, true, true, flags); | 2324 | xhci->lpm_command = xhci_alloc_command(xhci, true, true, flags); |
@@ -2396,10 +2396,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2396 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 2396 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
2397 | "// Set ERST base address for ir_set 0 = 0x%llx", | 2397 | "// Set ERST base address for ir_set 0 = 0x%llx", |
2398 | (unsigned long long)xhci->erst.erst_dma_addr); | 2398 | (unsigned long long)xhci->erst.erst_dma_addr); |
2399 | val_64 = readq(&xhci->ir_set->erst_base); | 2399 | val_64 = xhci_read_64(xhci, &xhci->ir_set->erst_base); |
2400 | val_64 &= ERST_PTR_MASK; | 2400 | val_64 &= ERST_PTR_MASK; |
2401 | val_64 |= (xhci->erst.erst_dma_addr & (u64) ~ERST_PTR_MASK); | 2401 | val_64 |= (xhci->erst.erst_dma_addr & (u64) ~ERST_PTR_MASK); |
2402 | writeq(val_64, &xhci->ir_set->erst_base); | 2402 | xhci_write_64(xhci, val_64, &xhci->ir_set->erst_base); |
2403 | 2403 | ||
2404 | /* Set the event ring dequeue address */ | 2404 | /* Set the event ring dequeue address */ |
2405 | xhci_set_hc_event_deq(xhci); | 2405 | xhci_set_hc_event_deq(xhci); |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 3c898c12a06b..04f986d9234f 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -142,6 +142,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) | |||
142 | "QUIRK: Resetting on resume"); | 142 | "QUIRK: Resetting on resume"); |
143 | xhci->quirks |= XHCI_TRUST_TX_LENGTH; | 143 | xhci->quirks |= XHCI_TRUST_TX_LENGTH; |
144 | } | 144 | } |
145 | if (pdev->vendor == PCI_VENDOR_ID_RENESAS && | ||
146 | pdev->device == 0x0015 && | ||
147 | pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG && | ||
148 | pdev->subsystem_device == 0xc0cd) | ||
149 | xhci->quirks |= XHCI_RESET_ON_RESUME; | ||
145 | if (pdev->vendor == PCI_VENDOR_ID_VIA) | 150 | if (pdev->vendor == PCI_VENDOR_ID_VIA) |
146 | xhci->quirks |= XHCI_RESET_ON_RESUME; | 151 | xhci->quirks |= XHCI_RESET_ON_RESUME; |
147 | } | 152 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index a0b248c34526..0ed64eb68e48 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -307,13 +307,14 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) | |||
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | 309 | ||
310 | temp_64 = readq(&xhci->op_regs->cmd_ring); | 310 | temp_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); |
311 | if (!(temp_64 & CMD_RING_RUNNING)) { | 311 | if (!(temp_64 & CMD_RING_RUNNING)) { |
312 | xhci_dbg(xhci, "Command ring had been stopped\n"); | 312 | xhci_dbg(xhci, "Command ring had been stopped\n"); |
313 | return 0; | 313 | return 0; |
314 | } | 314 | } |
315 | xhci->cmd_ring_state = CMD_RING_STATE_ABORTED; | 315 | xhci->cmd_ring_state = CMD_RING_STATE_ABORTED; |
316 | writeq(temp_64 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring); | 316 | xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, |
317 | &xhci->op_regs->cmd_ring); | ||
317 | 318 | ||
318 | /* Section 4.6.1.2 of xHCI 1.0 spec says software should | 319 | /* Section 4.6.1.2 of xHCI 1.0 spec says software should |
319 | * time the completion od all xHCI commands, including | 320 | * time the completion od all xHCI commands, including |
@@ -2864,8 +2865,9 @@ hw_died: | |||
2864 | /* Clear the event handler busy flag (RW1C); | 2865 | /* Clear the event handler busy flag (RW1C); |
2865 | * the event ring should be empty. | 2866 | * the event ring should be empty. |
2866 | */ | 2867 | */ |
2867 | temp_64 = readq(&xhci->ir_set->erst_dequeue); | 2868 | temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); |
2868 | writeq(temp_64 | ERST_EHB, &xhci->ir_set->erst_dequeue); | 2869 | xhci_write_64(xhci, temp_64 | ERST_EHB, |
2870 | &xhci->ir_set->erst_dequeue); | ||
2869 | spin_unlock(&xhci->lock); | 2871 | spin_unlock(&xhci->lock); |
2870 | 2872 | ||
2871 | return IRQ_HANDLED; | 2873 | return IRQ_HANDLED; |
@@ -2877,7 +2879,7 @@ hw_died: | |||
2877 | */ | 2879 | */ |
2878 | while (xhci_handle_event(xhci) > 0) {} | 2880 | while (xhci_handle_event(xhci) > 0) {} |
2879 | 2881 | ||
2880 | temp_64 = readq(&xhci->ir_set->erst_dequeue); | 2882 | temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); |
2881 | /* If necessary, update the HW's version of the event ring deq ptr. */ | 2883 | /* If necessary, update the HW's version of the event ring deq ptr. */ |
2882 | if (event_ring_deq != xhci->event_ring->dequeue) { | 2884 | if (event_ring_deq != xhci->event_ring->dequeue) { |
2883 | deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, | 2885 | deq = xhci_trb_virt_to_dma(xhci->event_ring->deq_seg, |
@@ -2892,7 +2894,7 @@ hw_died: | |||
2892 | 2894 | ||
2893 | /* Clear the event handler busy flag (RW1C); event ring is empty. */ | 2895 | /* Clear the event handler busy flag (RW1C); event ring is empty. */ |
2894 | temp_64 |= ERST_EHB; | 2896 | temp_64 |= ERST_EHB; |
2895 | writeq(temp_64, &xhci->ir_set->erst_dequeue); | 2897 | xhci_write_64(xhci, temp_64, &xhci->ir_set->erst_dequeue); |
2896 | 2898 | ||
2897 | spin_unlock(&xhci->lock); | 2899 | spin_unlock(&xhci->lock); |
2898 | 2900 | ||
@@ -2965,58 +2967,8 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, | |||
2965 | } | 2967 | } |
2966 | 2968 | ||
2967 | while (1) { | 2969 | while (1) { |
2968 | if (room_on_ring(xhci, ep_ring, num_trbs)) { | 2970 | if (room_on_ring(xhci, ep_ring, num_trbs)) |
2969 | union xhci_trb *trb = ep_ring->enqueue; | 2971 | break; |
2970 | unsigned int usable = ep_ring->enq_seg->trbs + | ||
2971 | TRBS_PER_SEGMENT - 1 - trb; | ||
2972 | u32 nop_cmd; | ||
2973 | |||
2974 | /* | ||
2975 | * Section 4.11.7.1 TD Fragments states that a link | ||
2976 | * TRB must only occur at the boundary between | ||
2977 | * data bursts (eg 512 bytes for 480M). | ||
2978 | * While it is possible to split a large fragment | ||
2979 | * we don't know the size yet. | ||
2980 | * Simplest solution is to fill the trb before the | ||
2981 | * LINK with nop commands. | ||
2982 | */ | ||
2983 | if (num_trbs == 1 || num_trbs <= usable || usable == 0) | ||
2984 | break; | ||
2985 | |||
2986 | if (ep_ring->type != TYPE_BULK) | ||
2987 | /* | ||
2988 | * While isoc transfers might have a buffer that | ||
2989 | * crosses a 64k boundary it is unlikely. | ||
2990 | * Since we can't add NOPs without generating | ||
2991 | * gaps in the traffic just hope it never | ||
2992 | * happens at the end of the ring. | ||
2993 | * This could be fixed by writing a LINK TRB | ||
2994 | * instead of the first NOP - however the | ||
2995 | * TRB_TYPE_LINK_LE32() calls would all need | ||
2996 | * changing to check the ring length. | ||
2997 | */ | ||
2998 | break; | ||
2999 | |||
3000 | if (num_trbs >= TRBS_PER_SEGMENT) { | ||
3001 | xhci_err(xhci, "Too many fragments %d, max %d\n", | ||
3002 | num_trbs, TRBS_PER_SEGMENT - 1); | ||
3003 | return -EINVAL; | ||
3004 | } | ||
3005 | |||
3006 | nop_cmd = cpu_to_le32(TRB_TYPE(TRB_TR_NOOP) | | ||
3007 | ep_ring->cycle_state); | ||
3008 | ep_ring->num_trbs_free -= usable; | ||
3009 | do { | ||
3010 | trb->generic.field[0] = 0; | ||
3011 | trb->generic.field[1] = 0; | ||
3012 | trb->generic.field[2] = 0; | ||
3013 | trb->generic.field[3] = nop_cmd; | ||
3014 | trb++; | ||
3015 | } while (--usable); | ||
3016 | ep_ring->enqueue = trb; | ||
3017 | if (room_on_ring(xhci, ep_ring, num_trbs)) | ||
3018 | break; | ||
3019 | } | ||
3020 | 2972 | ||
3021 | if (ep_ring == xhci->cmd_ring) { | 2973 | if (ep_ring == xhci->cmd_ring) { |
3022 | xhci_err(xhci, "Do not support expand command ring\n"); | 2974 | xhci_err(xhci, "Do not support expand command ring\n"); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ad364394885a..6fe577d46fa2 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -611,7 +611,7 @@ int xhci_run(struct usb_hcd *hcd) | |||
611 | xhci_dbg(xhci, "Event ring:\n"); | 611 | xhci_dbg(xhci, "Event ring:\n"); |
612 | xhci_debug_ring(xhci, xhci->event_ring); | 612 | xhci_debug_ring(xhci, xhci->event_ring); |
613 | xhci_dbg_ring_ptrs(xhci, xhci->event_ring); | 613 | xhci_dbg_ring_ptrs(xhci, xhci->event_ring); |
614 | temp_64 = readq(&xhci->ir_set->erst_dequeue); | 614 | temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); |
615 | temp_64 &= ~ERST_PTR_MASK; | 615 | temp_64 &= ~ERST_PTR_MASK; |
616 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 616 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
617 | "ERST deq = 64'h%0lx", (long unsigned int) temp_64); | 617 | "ERST deq = 64'h%0lx", (long unsigned int) temp_64); |
@@ -756,11 +756,11 @@ static void xhci_save_registers(struct xhci_hcd *xhci) | |||
756 | { | 756 | { |
757 | xhci->s3.command = readl(&xhci->op_regs->command); | 757 | xhci->s3.command = readl(&xhci->op_regs->command); |
758 | xhci->s3.dev_nt = readl(&xhci->op_regs->dev_notification); | 758 | xhci->s3.dev_nt = readl(&xhci->op_regs->dev_notification); |
759 | xhci->s3.dcbaa_ptr = readq(&xhci->op_regs->dcbaa_ptr); | 759 | xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); |
760 | xhci->s3.config_reg = readl(&xhci->op_regs->config_reg); | 760 | xhci->s3.config_reg = readl(&xhci->op_regs->config_reg); |
761 | xhci->s3.erst_size = readl(&xhci->ir_set->erst_size); | 761 | xhci->s3.erst_size = readl(&xhci->ir_set->erst_size); |
762 | xhci->s3.erst_base = readq(&xhci->ir_set->erst_base); | 762 | xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base); |
763 | xhci->s3.erst_dequeue = readq(&xhci->ir_set->erst_dequeue); | 763 | xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue); |
764 | xhci->s3.irq_pending = readl(&xhci->ir_set->irq_pending); | 764 | xhci->s3.irq_pending = readl(&xhci->ir_set->irq_pending); |
765 | xhci->s3.irq_control = readl(&xhci->ir_set->irq_control); | 765 | xhci->s3.irq_control = readl(&xhci->ir_set->irq_control); |
766 | } | 766 | } |
@@ -769,11 +769,11 @@ static void xhci_restore_registers(struct xhci_hcd *xhci) | |||
769 | { | 769 | { |
770 | writel(xhci->s3.command, &xhci->op_regs->command); | 770 | writel(xhci->s3.command, &xhci->op_regs->command); |
771 | writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification); | 771 | writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification); |
772 | writeq(xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); | 772 | xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr); |
773 | writel(xhci->s3.config_reg, &xhci->op_regs->config_reg); | 773 | writel(xhci->s3.config_reg, &xhci->op_regs->config_reg); |
774 | writel(xhci->s3.erst_size, &xhci->ir_set->erst_size); | 774 | writel(xhci->s3.erst_size, &xhci->ir_set->erst_size); |
775 | writeq(xhci->s3.erst_base, &xhci->ir_set->erst_base); | 775 | xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base); |
776 | writeq(xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue); | 776 | xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue); |
777 | writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending); | 777 | writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending); |
778 | writel(xhci->s3.irq_control, &xhci->ir_set->irq_control); | 778 | writel(xhci->s3.irq_control, &xhci->ir_set->irq_control); |
779 | } | 779 | } |
@@ -783,7 +783,7 @@ static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci) | |||
783 | u64 val_64; | 783 | u64 val_64; |
784 | 784 | ||
785 | /* step 2: initialize command ring buffer */ | 785 | /* step 2: initialize command ring buffer */ |
786 | val_64 = readq(&xhci->op_regs->cmd_ring); | 786 | val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); |
787 | val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) | | 787 | val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) | |
788 | (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, | 788 | (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, |
789 | xhci->cmd_ring->dequeue) & | 789 | xhci->cmd_ring->dequeue) & |
@@ -792,7 +792,7 @@ static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci) | |||
792 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, | 792 | xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
793 | "// Setting command ring address to 0x%llx", | 793 | "// Setting command ring address to 0x%llx", |
794 | (long unsigned long) val_64); | 794 | (long unsigned long) val_64); |
795 | writeq(val_64, &xhci->op_regs->cmd_ring); | 795 | xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring); |
796 | } | 796 | } |
797 | 797 | ||
798 | /* | 798 | /* |
@@ -3842,7 +3842,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
3842 | if (ret) { | 3842 | if (ret) { |
3843 | return ret; | 3843 | return ret; |
3844 | } | 3844 | } |
3845 | temp_64 = readq(&xhci->op_regs->dcbaa_ptr); | 3845 | temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr); |
3846 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, | 3846 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, |
3847 | "Op regs DCBAA ptr = %#016llx", temp_64); | 3847 | "Op regs DCBAA ptr = %#016llx", temp_64); |
3848 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, | 3848 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, |
@@ -4730,11 +4730,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
4730 | struct device *dev = hcd->self.controller; | 4730 | struct device *dev = hcd->self.controller; |
4731 | int retval; | 4731 | int retval; |
4732 | 4732 | ||
4733 | /* Limit the block layer scatter-gather lists to half a segment. */ | 4733 | /* Accept arbitrarily long scatter-gather lists */ |
4734 | hcd->self.sg_tablesize = TRBS_PER_SEGMENT / 2; | 4734 | hcd->self.sg_tablesize = ~0; |
4735 | |||
4736 | /* support to build packet from discontinuous buffers */ | ||
4737 | hcd->self.no_sg_constraint = 1; | ||
4738 | 4735 | ||
4739 | /* XHCI controllers don't stop the ep queue on short packets :| */ | 4736 | /* XHCI controllers don't stop the ep queue on short packets :| */ |
4740 | hcd->self.no_stop_on_short = 1; | 4737 | hcd->self.no_stop_on_short = 1; |
@@ -4760,6 +4757,14 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
4760 | /* xHCI private pointer was set in xhci_pci_probe for the second | 4757 | /* xHCI private pointer was set in xhci_pci_probe for the second |
4761 | * registered roothub. | 4758 | * registered roothub. |
4762 | */ | 4759 | */ |
4760 | xhci = hcd_to_xhci(hcd); | ||
4761 | /* | ||
4762 | * Support arbitrarily aligned sg-list entries on hosts without | ||
4763 | * TD fragment rules (which are currently unsupported). | ||
4764 | */ | ||
4765 | if (xhci->hci_version < 0x100) | ||
4766 | hcd->self.no_sg_constraint = 1; | ||
4767 | |||
4763 | return 0; | 4768 | return 0; |
4764 | } | 4769 | } |
4765 | 4770 | ||
@@ -4788,6 +4793,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) | |||
4788 | if (xhci->hci_version > 0x96) | 4793 | if (xhci->hci_version > 0x96) |
4789 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; | 4794 | xhci->quirks |= XHCI_SPURIOUS_SUCCESS; |
4790 | 4795 | ||
4796 | if (xhci->hci_version < 0x100) | ||
4797 | hcd->self.no_sg_constraint = 1; | ||
4798 | |||
4791 | /* Make sure the HC is halted. */ | 4799 | /* Make sure the HC is halted. */ |
4792 | retval = xhci_halt(xhci); | 4800 | retval = xhci_halt(xhci); |
4793 | if (retval) | 4801 | if (retval) |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index f8416639bf31..58ed9d088e63 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -28,17 +28,6 @@ | |||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/usb/hcd.h> | 29 | #include <linux/usb/hcd.h> |
30 | 30 | ||
31 | /* | ||
32 | * Registers should always be accessed with double word or quad word accesses. | ||
33 | * | ||
34 | * Some xHCI implementations may support 64-bit address pointers. Registers | ||
35 | * with 64-bit address pointers should be written to with dword accesses by | ||
36 | * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second. | ||
37 | * xHCI implementations that do not support 64-bit address pointers will ignore | ||
38 | * the high dword, and write order is irrelevant. | ||
39 | */ | ||
40 | #include <asm-generic/io-64-nonatomic-lo-hi.h> | ||
41 | |||
42 | /* Code sharing between pci-quirks and xhci hcd */ | 31 | /* Code sharing between pci-quirks and xhci hcd */ |
43 | #include "xhci-ext-caps.h" | 32 | #include "xhci-ext-caps.h" |
44 | #include "pci-quirks.h" | 33 | #include "pci-quirks.h" |
@@ -1279,7 +1268,7 @@ union xhci_trb { | |||
1279 | * since the command ring is 64-byte aligned. | 1268 | * since the command ring is 64-byte aligned. |
1280 | * It must also be greater than 16. | 1269 | * It must also be greater than 16. |
1281 | */ | 1270 | */ |
1282 | #define TRBS_PER_SEGMENT 256 | 1271 | #define TRBS_PER_SEGMENT 64 |
1283 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ | 1272 | /* Allow two commands + a link TRB, along with any reserved command TRBs */ |
1284 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) | 1273 | #define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) |
1285 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) | 1274 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) |
@@ -1614,6 +1603,34 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) | |||
1614 | #define xhci_warn_ratelimited(xhci, fmt, args...) \ | 1603 | #define xhci_warn_ratelimited(xhci, fmt, args...) \ |
1615 | dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args) | 1604 | dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args) |
1616 | 1605 | ||
1606 | /* | ||
1607 | * Registers should always be accessed with double word or quad word accesses. | ||
1608 | * | ||
1609 | * Some xHCI implementations may support 64-bit address pointers. Registers | ||
1610 | * with 64-bit address pointers should be written to with dword accesses by | ||
1611 | * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second. | ||
1612 | * xHCI implementations that do not support 64-bit address pointers will ignore | ||
1613 | * the high dword, and write order is irrelevant. | ||
1614 | */ | ||
1615 | static inline u64 xhci_read_64(const struct xhci_hcd *xhci, | ||
1616 | __le64 __iomem *regs) | ||
1617 | { | ||
1618 | __u32 __iomem *ptr = (__u32 __iomem *) regs; | ||
1619 | u64 val_lo = readl(ptr); | ||
1620 | u64 val_hi = readl(ptr + 1); | ||
1621 | return val_lo + (val_hi << 32); | ||
1622 | } | ||
1623 | static inline void xhci_write_64(struct xhci_hcd *xhci, | ||
1624 | const u64 val, __le64 __iomem *regs) | ||
1625 | { | ||
1626 | __u32 __iomem *ptr = (__u32 __iomem *) regs; | ||
1627 | u32 val_lo = lower_32_bits(val); | ||
1628 | u32 val_hi = upper_32_bits(val); | ||
1629 | |||
1630 | writel(val_lo, ptr); | ||
1631 | writel(val_hi, ptr + 1); | ||
1632 | } | ||
1633 | |||
1617 | static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) | 1634 | static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) |
1618 | { | 1635 | { |
1619 | return xhci->quirks & XHCI_LINK_TRB_QUIRK; | 1636 | return xhci->quirks & XHCI_LINK_TRB_QUIRK; |
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index e6f61e4361df..8afa813d690b 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c | |||
@@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type) | |||
130 | 130 | ||
131 | phy = __usb_find_phy(&phy_list, type); | 131 | phy = __usb_find_phy(&phy_list, type); |
132 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { | 132 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { |
133 | pr_err("unable to find transceiver of type %s\n", | 133 | pr_debug("PHY: unable to find transceiver of type %s\n", |
134 | usb_phy_type_string(type)); | 134 | usb_phy_type_string(type)); |
135 | goto err0; | 135 | goto err0; |
136 | } | 136 | } |
@@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) | |||
228 | 228 | ||
229 | phy = __usb_find_phy_dev(dev, &phy_bind_list, index); | 229 | phy = __usb_find_phy_dev(dev, &phy_bind_list, index); |
230 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { | 230 | if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { |
231 | pr_err("unable to find transceiver\n"); | 231 | dev_dbg(dev, "unable to find transceiver\n"); |
232 | goto err0; | 232 | goto err0; |
233 | } | 233 | } |
234 | 234 | ||
@@ -424,10 +424,8 @@ int usb_bind_phy(const char *dev_name, u8 index, | |||
424 | unsigned long flags; | 424 | unsigned long flags; |
425 | 425 | ||
426 | phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL); | 426 | phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL); |
427 | if (!phy_bind) { | 427 | if (!phy_bind) |
428 | pr_err("phy_bind(): No memory for phy_bind"); | ||
429 | return -ENOMEM; | 428 | return -ENOMEM; |
430 | } | ||
431 | 429 | ||
432 | phy_bind->dev_name = dev_name; | 430 | phy_bind->dev_name = dev_name; |
433 | phy_bind->phy_dev_name = phy_dev_name; | 431 | phy_bind->phy_dev_name = phy_dev_name; |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ce0d7b0db012..ee1f00f03c43 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -152,6 +152,7 @@ static const struct usb_device_id id_table_combined[] = { | |||
152 | { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, | 152 | { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, |
153 | { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, | 153 | { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, |
154 | { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, | 154 | { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, |
155 | { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, | ||
155 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, | 156 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, |
156 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, | 157 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, |
157 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, | 158 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, |
@@ -191,6 +192,8 @@ static const struct usb_device_id id_table_combined[] = { | |||
191 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, | 192 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, |
192 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, | 193 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, |
193 | { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, | 194 | { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, |
195 | { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, | ||
196 | { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, | ||
194 | { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, | 197 | { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, |
195 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, | 198 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, |
196 | { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, | 199 | { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index a7019d1e3058..1e2d369df86e 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define TI_XDS100V2_PID 0xa6d0 | 50 | #define TI_XDS100V2_PID 0xa6d0 |
51 | 51 | ||
52 | #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */ | 52 | #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */ |
53 | #define FTDI_EV3CON_PID 0xABB9 /* Mindstorms EV3 Console Adapter */ | ||
53 | 54 | ||
54 | /* US Interface Navigator (http://www.usinterface.com/) */ | 55 | /* US Interface Navigator (http://www.usinterface.com/) */ |
55 | #define FTDI_USINT_CAT_PID 0xb810 /* Navigator CAT and 2nd PTT lines */ | 56 | #define FTDI_USINT_CAT_PID 0xb810 /* Navigator CAT and 2nd PTT lines */ |
@@ -363,6 +364,12 @@ | |||
363 | /* Sprog II (Andrew Crosland's SprogII DCC interface) */ | 364 | /* Sprog II (Andrew Crosland's SprogII DCC interface) */ |
364 | #define FTDI_SPROG_II 0xF0C8 | 365 | #define FTDI_SPROG_II 0xF0C8 |
365 | 366 | ||
367 | /* | ||
368 | * Two of the Tagsys RFID Readers | ||
369 | */ | ||
370 | #define FTDI_TAGSYS_LP101_PID 0xF0E9 /* Tagsys L-P101 RFID*/ | ||
371 | #define FTDI_TAGSYS_P200X_PID 0xF0EE /* Tagsys Medio P200x RFID*/ | ||
372 | |||
366 | /* an infrared receiver for user access control with IR tags */ | 373 | /* an infrared receiver for user access control with IR tags */ |
367 | #define FTDI_PIEGROUP_PID 0xF208 /* Product Id */ | 374 | #define FTDI_PIEGROUP_PID 0xF208 /* Product Id */ |
368 | 375 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5c86f57e4afa..216d20affba8 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -1362,7 +1362,8 @@ static const struct usb_device_id option_ids[] = { | |||
1362 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, | 1362 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, |
1363 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, | 1363 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, |
1364 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, | 1364 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, |
1365 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) }, | 1365 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff), |
1366 | .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, | ||
1366 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, | 1367 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, |
1367 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, | 1368 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, |
1368 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) }, | 1369 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) }, |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index c65437cfd4a2..968a40201e5f 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -139,6 +139,9 @@ static const struct usb_device_id id_table[] = { | |||
139 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */ | 139 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */ |
140 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */ | 140 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */ |
141 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */ | 141 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */ |
142 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)}, /* Netgear AirCard 340U Device Management */ | ||
143 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)}, /* Netgear AirCard 340U NMEA */ | ||
144 | {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)}, /* Netgear AirCard 340U Modem */ | ||
142 | 145 | ||
143 | { } /* Terminating entry */ | 146 | { } /* Terminating entry */ |
144 | }; | 147 | }; |
diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c index f112b079ddfc..fb79775447b0 100644 --- a/drivers/usb/serial/usb-serial-simple.c +++ b/drivers/usb/serial/usb-serial-simple.c | |||
@@ -71,7 +71,8 @@ DEVICE(hp4x, HP4X_IDS); | |||
71 | 71 | ||
72 | /* Suunto ANT+ USB Driver */ | 72 | /* Suunto ANT+ USB Driver */ |
73 | #define SUUNTO_IDS() \ | 73 | #define SUUNTO_IDS() \ |
74 | { USB_DEVICE(0x0fcf, 0x1008) } | 74 | { USB_DEVICE(0x0fcf, 0x1008) }, \ |
75 | { USB_DEVICE(0x0fcf, 0x1009) } /* Dynastream ANT USB-m Stick */ | ||
75 | DEVICE(suunto, SUUNTO_IDS); | 76 | DEVICE(suunto, SUUNTO_IDS); |
76 | 77 | ||
77 | /* Siemens USB/MPI adapter */ | 78 | /* Siemens USB/MPI adapter */ |
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig index 8470e1b114f2..1dd0604d1911 100644 --- a/drivers/usb/storage/Kconfig +++ b/drivers/usb/storage/Kconfig | |||
@@ -18,7 +18,9 @@ config USB_STORAGE | |||
18 | 18 | ||
19 | This option depends on 'SCSI' support being enabled, but you | 19 | This option depends on 'SCSI' support being enabled, but you |
20 | probably also need 'SCSI device support: SCSI disk support' | 20 | probably also need 'SCSI device support: SCSI disk support' |
21 | (BLK_DEV_SD) for most USB storage devices. | 21 | (BLK_DEV_SD) for most USB storage devices. Some devices also |
22 | will require 'Probe all LUNs on each SCSI device' | ||
23 | (SCSI_MULTI_LUN). | ||
22 | 24 | ||
23 | To compile this driver as a module, choose M here: the | 25 | To compile this driver as a module, choose M here: the |
24 | module will be called usb-storage. | 26 | module will be called usb-storage. |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 18509e6c21ab..9d38ddc8da49 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -78,6 +78,8 @@ static const char* host_info(struct Scsi_Host *host) | |||
78 | 78 | ||
79 | static int slave_alloc (struct scsi_device *sdev) | 79 | static int slave_alloc (struct scsi_device *sdev) |
80 | { | 80 | { |
81 | struct us_data *us = host_to_us(sdev->host); | ||
82 | |||
81 | /* | 83 | /* |
82 | * Set the INQUIRY transfer length to 36. We don't use any of | 84 | * Set the INQUIRY transfer length to 36. We don't use any of |
83 | * the extra data and many devices choke if asked for more or | 85 | * the extra data and many devices choke if asked for more or |
@@ -102,6 +104,10 @@ static int slave_alloc (struct scsi_device *sdev) | |||
102 | */ | 104 | */ |
103 | blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); | 105 | blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); |
104 | 106 | ||
107 | /* Tell the SCSI layer if we know there is more than one LUN */ | ||
108 | if (us->protocol == USB_PR_BULK && us->max_lun > 0) | ||
109 | sdev->sdev_bflags |= BLIST_FORCELUN; | ||
110 | |||
105 | return 0; | 111 | return 0; |
106 | } | 112 | } |
107 | 113 | ||
diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h index 65a6a75066a8..82e8ed0324e3 100644 --- a/drivers/usb/storage/unusual_cypress.h +++ b/drivers/usb/storage/unusual_cypress.h | |||
@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999, | |||
31 | "Cypress ISD-300LP", | 31 | "Cypress ISD-300LP", |
32 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), | 32 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), |
33 | 33 | ||
34 | UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219, | 34 | UNUSUAL_DEV( 0x14cd, 0x6116, 0x0160, 0x0160, |
35 | "Super Top", | 35 | "Super Top", |
36 | "USB 2.0 SATA BRIDGE", | 36 | "USB 2.0 SATA BRIDGE", |
37 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), | 37 | USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index ad06255c2ade..adbeb255616a 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1455,6 +1455,13 @@ UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0100, | |||
1455 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 1455 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
1456 | US_FL_FIX_CAPACITY ), | 1456 | US_FL_FIX_CAPACITY ), |
1457 | 1457 | ||
1458 | /* Reported by Moritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de> */ | ||
1459 | UNUSUAL_DEV( 0x0fca, 0x8004, 0x0201, 0x0201, | ||
1460 | "Research In Motion", | ||
1461 | "BlackBerry Bold 9000", | ||
1462 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | ||
1463 | US_FL_MAX_SECTORS_64 ), | ||
1464 | |||
1458 | /* Reported by Michael Stattmann <michael@stattmann.com> */ | 1465 | /* Reported by Michael Stattmann <michael@stattmann.com> */ |
1459 | UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, | 1466 | UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, |
1460 | "Sony Ericsson", | 1467 | "Sony Ericsson", |
diff --git a/include/linux/usb.h b/include/linux/usb.h index c716da18c668..7f6eb859873e 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1265,8 +1265,6 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1265 | * @sg: scatter gather buffer list, the buffer size of each element in | 1265 | * @sg: scatter gather buffer list, the buffer size of each element in |
1266 | * the list (except the last) must be divisible by the endpoint's | 1266 | * the list (except the last) must be divisible by the endpoint's |
1267 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1267 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
1268 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
1269 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
1270 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1268 | * @num_mapped_sgs: (internal) number of mapped sg entries |
1271 | * @num_sgs: number of entries in the sg list | 1269 | * @num_sgs: number of entries in the sg list |
1272 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1270 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 23708636b05c..25e5cb0aaef6 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -210,8 +210,8 @@ static void do_usb_entry(void *symval, | |||
210 | range_lo < 0x9 ? "[%X-9" : "[%X", | 210 | range_lo < 0x9 ? "[%X-9" : "[%X", |
211 | range_lo); | 211 | range_lo); |
212 | sprintf(alias + strlen(alias), | 212 | sprintf(alias + strlen(alias), |
213 | range_hi > 0xA ? "a-%X]" : "%X]", | 213 | range_hi > 0xA ? "A-%X]" : "%X]", |
214 | range_lo); | 214 | range_hi); |
215 | } | 215 | } |
216 | } | 216 | } |
217 | if (bcdDevice_initial_digits < (sizeof(bcdDevice_lo) * 2 - 1)) | 217 | if (bcdDevice_initial_digits < (sizeof(bcdDevice_lo) * 2 - 1)) |