History

Merge tag 'usb-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB driver fixes from Greg KH: "Here are a number of small USB fixes for 4.4-rc5. All of them have been in linux-next. The majority are gadget and phy issues, with a few new quirks and device ids added as well" * tag 'usb-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (32 commits) USB: add quirk for devices with broken LPM xhci: fix usb2 resume timing and races. usb: musb: fail with error when no DMA controller set usb: gadget: uvc: fix permissions of configfs attributes usb: musb: core: Fix pm runtime for deferred probe usb: phy: msm: fix a possible NULL dereference USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq usb: Quiet down false peer failure messages usb: xhci: fix config fail of FS hub behind a HS hub with MTT xhci: Fix memory leak in xhci_pme_acpi_rtd3_enable() usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message USB: whci-hcd: add check for dma mapping error usb: core : hub: Fix BOS 'NULL pointer' kernel panic USB: quirks: Apply ALWAYS_POLL to all ELAN devices usb-storage: Fix scsi-sd failure "Invalid field in cdb" for USB adapter JMicron USB: quirks: Fix another ELAN touchscreen usb: dwc3: gadget: don't prestart interrupt endpoints USB: serial: Another Infineon flash loader USB ID USB: cdc_acm: Ignore Infineon Flash Loader utility USB: cp210x: Remove CP2110 ID from compatibility list ...

Linus Torvalds committed 10 years ago

Commit c4740092 parents 097b285 ad87e0330 files · +200 −79Browse files

Unified · Split

30 files
  1. drivers/hid/hid-ids.h +0 −5
  2. drivers/hid/usbhid/hid-quirks.c +3 −6
  3. drivers/usb/class/cdc-acm.c +5 −0
  4. drivers/usb/core/config.c +2 −1
  5. drivers/usb/core/hub.c +14 −8
  6. drivers/usb/core/port.c +2 −2
  7. drivers/usb/core/quirks.c +9 −0
  8. drivers/usb/dwc2/platform.c +53 −28
  9. drivers/usb/dwc3/gadget.c +1 −0
  10. drivers/usb/gadget/function/f_fs.c +3 −3
  11. drivers/usb/gadget/function/f_midi.c +2 −1
  12. drivers/usb/gadget/function/uvc_configfs.c +1 −1
  13. drivers/usb/gadget/udc/pxa27x_udc.c +3 −0
  14. drivers/usb/host/ohci-at91.c +5 −6
  15. drivers/usb/host/whci/qset.c +4 −0
  16. drivers/usb/host/xhci-hub.c +42 −5
  17. drivers/usb/host/xhci-pci.c +6 −2
  18. drivers/usb/host/xhci-ring.c +2 −1
  19. drivers/usb/host/xhci.c +8 −0
  20. drivers/usb/musb/Kconfig +1 −1
  21. drivers/usb/musb/musb_core.c +7 −1
  22. drivers/usb/phy/phy-msm-usb.c +3 −3
  23. drivers/usb/phy/phy-mxs-usb.c +5 −0
  24. drivers/usb/renesas_usbhs/mod_gadget.c +9 −2
  25. drivers/usb/serial/cp210x.c +0 −1
  26. drivers/usb/serial/usb-serial-simple.c +1 −0
  27. drivers/usb/storage/uas.c +4 −0
  28. drivers/usb/storage/unusual_devs.h +1 −1
  29. drivers/usb/storage/unusual_uas.h +1 −1
  30. include/linux/usb/quirks.h +3 −0
drivers/hid/hid-ids.h+0−5
@@ -316,11 +316,6 @@ · 315 unmodified lines
316316 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001
317317
318318 #define USB_VENDOR_ID_ELAN 0x04f3
319−#define USB_DEVICE_ID_ELAN_TOUCHSCREEN 0x0089
320−#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B 0x009b
321−#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103 0x0103
322−#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_010c 0x010c
323−#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F 0x016f
324319
325320 #define USB_VENDOR_ID_ELECOM 0x056e
326321 #define USB_DEVICE_ID_ELECOM_BM084 0x0061
drivers/hid/usbhid/hid-quirks.c+3−6
@@ -72,11 +72,7 @@ static const struct hid_blacklist { · 71 unmodified lines
7272 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL },
7373 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
7474 { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT },
75− { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL },
76− { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B, HID_QUIRK_ALWAYS_POLL },
77− { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103, HID_QUIRK_ALWAYS_POLL },
78− { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_010c, HID_QUIRK_ALWAYS_POLL },
79− { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F, HID_QUIRK_ALWAYS_POLL },
75+ { USB_VENDOR_ID_ELAN, HID_ANY_ID, HID_QUIRK_ALWAYS_POLL },
8076 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
8177 { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
8278 { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
@@ -340,7 +336,8 @@ static const struct hid_blacklist *usbhid_exists_squirk(const u16 idVendor, · 257 unmodified lines
340336
341337 for (; hid_blacklist[n].idVendor; n++)
342338 if (hid_blacklist[n].idVendor == idVendor &&
343− hid_blacklist[n].idProduct == idProduct)
339+ (hid_blacklist[n].idProduct == (__u16) HID_ANY_ID ||
340+ hid_blacklist[n].idProduct == idProduct))
344341 bl_entry = &hid_blacklist[n];
345342
346343 if (bl_entry != NULL)
drivers/usb/class/cdc-acm.c+5−0
@@ -1838,6 +1838,11 @@ static const struct usb_device_id acm_ids[] = { · 1837 unmodified lines
18381838 },
18391839 #endif
18401840
1841+ /* Exclude Infineon Flash Loader utility */
1842+ { USB_DEVICE(0x058b, 0x0041),
1843+ .driver_info = IGNORE_DEVICE,
1844+ },
1845+
18411846 /* control interfaces without any protocol set */
18421847 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
18431848 USB_CDC_PROTO_NONE) },
drivers/usb/core/config.c+2−1
@@ -115,7 +115,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, · 114 unmodified lines
115115 USB_SS_MULT(desc->bmAttributes) > 3) {
116116 dev_warn(ddev, "Isoc endpoint has Mult of %d in "
117117 "config %d interface %d altsetting %d ep %d: "
118− "setting to 3\n", desc->bmAttributes + 1,
118+ "setting to 3\n",
119+ USB_SS_MULT(desc->bmAttributes),
119120 cfgno, inum, asnum, ep->desc.bEndpointAddress);
120121 ep->ss_ep_comp.bmAttributes = 2;
121122 }
drivers/usb/core/hub.c+14−8
@@ -124,6 +124,10 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev) · 123 unmodified lines
124124
125125 int usb_device_supports_lpm(struct usb_device *udev)
126126 {
127+ /* Some devices have trouble with LPM */
128+ if (udev->quirks & USB_QUIRK_NO_LPM)
129+ return 0;
130+
127131 /* USB 2.1 (and greater) devices indicate LPM support through
128132 * their USB 2.0 Extended Capabilities BOS descriptor.
129133 */
@@ -4512,6 +4516,8 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, · 4382 unmodified lines
45124516 goto fail;
45134517 }
45144518
4519+ usb_detect_quirks(udev);
4520+
45154521 if (udev->wusb == 0 && le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0201) {
45164522 retval = usb_get_bos_descriptor(udev);
45174523 if (!retval) {
@@ -4710,7 +4716,6 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, · 192 unmodified lines
47104716 if (status < 0)
47114717 goto loop;
47124718
4713− usb_detect_quirks(udev);
47144719 if (udev->quirks & USB_QUIRK_DELAY_INIT)
47154720 msleep(1000);
47164721
@@ -5326,9 +5331,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev) · 609 unmodified lines
53265331 if (udev->usb2_hw_lpm_enabled == 1)
53275332 usb_set_usb2_hardware_lpm(udev, 0);
53285333
5329− bos = udev->bos;
5330− udev->bos = NULL;
5331−
53325334 /* Disable LPM and LTM while we reset the device and reinstall the alt
53335335 * settings. Device-initiated LPM settings, and system exit latency
53345336 * settings are cleared when the device is reset, so we have to set
@@ -5337,15 +5339,18 @@ static int usb_reset_and_verify_device(struct usb_device *udev) · 2 unmodified lines
53375339 ret = usb_unlocked_disable_lpm(udev);
53385340 if (ret) {
53395341 dev_err(&udev->dev, "%s Failed to disable LPM\n.", __func__);
5340− goto re_enumerate;
5342+ goto re_enumerate_no_bos;
53415343 }
53425344 ret = usb_disable_ltm(udev);
53435345 if (ret) {
53445346 dev_err(&udev->dev, "%s Failed to disable LTM\n.",
53455347 __func__);
5346− goto re_enumerate;
5348+ goto re_enumerate_no_bos;
53475349 }
53485350
5351+ bos = udev->bos;
5352+ udev->bos = NULL;
5353+
53495354 for (i = 0; i < SET_CONFIG_TRIES; ++i) {
53505355
53515356 /* ep0 maxpacket size may change; let the HCD know about it.
@@ -5442,10 +5447,11 @@ done: · 90 unmodified lines
54425447 return 0;
54435448
54445449 re_enumerate:
5445− /* LPM state doesn't matter when we're about to destroy the device. */
5446− hub_port_logical_disconnect(parent_hub, port1);
54475450 usb_release_bos_descriptor(udev);
54485451 udev->bos = bos;
5452+re_enumerate_no_bos:
5453+ /* LPM state doesn't matter when we're about to destroy the device. */
5454+ hub_port_logical_disconnect(parent_hub, port1);
54495455 return -ENODEV;
54505456 }
54515457
drivers/usb/core/port.c+2−2
@@ -206,7 +206,7 @@ static int link_peers(struct usb_port *left, struct usb_port *right) · 205 unmodified lines
206206 else
207207 method = "default";
208208
209− pr_warn("usb: failed to peer %s and %s by %s (%s:%s) (%s:%s)\n",
209+ pr_debug("usb: failed to peer %s and %s by %s (%s:%s) (%s:%s)\n",
210210 dev_name(&left->dev), dev_name(&right->dev), method,
211211 dev_name(&left->dev),
212212 lpeer ? dev_name(&lpeer->dev) : "none",
@@ -265,7 +265,7 @@ static void link_peers_report(struct usb_port *left, struct usb_port *right) · 52 unmodified lines
265265 if (rc == 0) {
266266 dev_dbg(&left->dev, "peered to %s\n", dev_name(&right->dev));
267267 } else {
268− dev_warn(&left->dev, "failed to peer to %s (%d)\n",
268+ dev_dbg(&left->dev, "failed to peer to %s (%d)\n",
269269 dev_name(&right->dev), rc);
270270 pr_warn_once("usb: port power management may be unreliable\n");
271271 usb_port_block_power_off = 1;
drivers/usb/core/quirks.c+9−0
@@ -125,6 +125,9 @@ static const struct usb_device_id usb_quirk_list[] = { · 124 unmodified lines
125125 { USB_DEVICE(0x04f3, 0x016f), .driver_info =
126126 USB_QUIRK_DEVICE_QUALIFIER },
127127
128+ { USB_DEVICE(0x04f3, 0x21b8), .driver_info =
129+ USB_QUIRK_DEVICE_QUALIFIER },
130+
128131 /* Roland SC-8820 */
129132 { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
130133
@@ -199,6 +202,12 @@ static const struct usb_device_id usb_quirk_list[] = { · 68 unmodified lines
199202 { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
200203 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
201204
205+ /* Blackmagic Design Intensity Shuttle */
206+ { USB_DEVICE(0x1edb, 0xbd3b), .driver_info = USB_QUIRK_NO_LPM },
207+
208+ /* Blackmagic Design UltraStudio SDI */
209+ { USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM },
210+
202211 { } /* terminating entry must be last */
203212 };
204213
drivers/usb/dwc2/platform.c+53−28
@@ -125,9 +125,11 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) · 124 unmodified lines
125125 if (ret)
126126 return ret;
127127
128− ret = clk_prepare_enable(hsotg->clk);
129− if (ret)
130− return ret;
128+ if (hsotg->clk) {
129+ ret = clk_prepare_enable(hsotg->clk);
130+ if (ret)
131+ return ret;
132+ }
131133
132134 if (hsotg->uphy)
133135 ret = usb_phy_init(hsotg->uphy);
@@ -175,7 +177,8 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg) · 41 unmodified lines
175177 if (ret)
176178 return ret;
177179
178− clk_disable_unprepare(hsotg->clk);
180+ if (hsotg->clk)
181+ clk_disable_unprepare(hsotg->clk);
179182
180183 ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
181184 hsotg->supplies);
@@ -212,14 +215,41 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) · 30 unmodified lines
212215 */
213216 hsotg->phy = devm_phy_get(hsotg->dev, "usb2-phy");
214217 if (IS_ERR(hsotg->phy)) {
215− hsotg->phy = NULL;
218+ ret = PTR_ERR(hsotg->phy);
219+ switch (ret) {
220+ case -ENODEV:
221+ case -ENOSYS:
222+ hsotg->phy = NULL;
223+ break;
224+ case -EPROBE_DEFER:
225+ return ret;
226+ default:
227+ dev_err(hsotg->dev, "error getting phy %d\n", ret);
228+ return ret;
229+ }
230+ }
231+
232+ if (!hsotg->phy) {
216233 hsotg->uphy = devm_usb_get_phy(hsotg->dev, USB_PHY_TYPE_USB2);
217− if (IS_ERR(hsotg->uphy))
218− hsotg->uphy = NULL;
219− else
220− hsotg->plat = dev_get_platdata(hsotg->dev);
234+ if (IS_ERR(hsotg->uphy)) {
235+ ret = PTR_ERR(hsotg->uphy);
236+ switch (ret) {
237+ case -ENODEV:
238+ case -ENXIO:
239+ hsotg->uphy = NULL;
240+ break;
241+ case -EPROBE_DEFER:
242+ return ret;
243+ default:
244+ dev_err(hsotg->dev, "error getting usb phy %d\n",
245+ ret);
246+ return ret;
247+ }
248+ }
221249 }
222250
251+ hsotg->plat = dev_get_platdata(hsotg->dev);
252+
223253 if (hsotg->phy) {
224254 /*
225255 * If using the generic PHY framework, check if the PHY bus
@@ -229,11 +259,6 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) · 3 unmodified lines
229259 hsotg->phyif = GUSBCFG_PHYIF8;
230260 }
231261
232− if (!hsotg->phy && !hsotg->uphy && !hsotg->plat) {
233− dev_err(hsotg->dev, "no platform data or transceiver defined\n");
234− return -EPROBE_DEFER;
235− }
236−
237262 /* Clock */
238263 hsotg->clk = devm_clk_get(hsotg->dev, "otg");
239264 if (IS_ERR(hsotg->clk)) {
@@ -342,20 +367,6 @@ static int dwc2_driver_probe(struct platform_device *dev) · 102 unmodified lines
342367 if (retval)
343368 return retval;
344369
345− irq = platform_get_irq(dev, 0);
346− if (irq < 0) {
347− dev_err(&dev->dev, "missing IRQ resource\n");
348− return irq;
349− }
350−
351− dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
352− irq);
353− retval = devm_request_irq(hsotg->dev, irq,
354− dwc2_handle_common_intr, IRQF_SHARED,
355− dev_name(hsotg->dev), hsotg);
356− if (retval)
357− return retval;
358−
359370 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
360371 hsotg->regs = devm_ioremap_resource(&dev->dev, res);
361372 if (IS_ERR(hsotg->regs))
@@ -390,6 +401,20 @@ static int dwc2_driver_probe(struct platform_device *dev) · 28 unmodified lines
390401
391402 dwc2_set_all_params(hsotg->core_params, -1);
392403
404+ irq = platform_get_irq(dev, 0);
405+ if (irq < 0) {
406+ dev_err(&dev->dev, "missing IRQ resource\n");
407+ return irq;
408+ }
409+
410+ dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
411+ irq);
412+ retval = devm_request_irq(hsotg->dev, irq,
413+ dwc2_handle_common_intr, IRQF_SHARED,
414+ dev_name(hsotg->dev), hsotg);
415+ if (retval)
416+ return retval;
417+
393418 retval = dwc2_lowlevel_hw_enable(hsotg);
394419 if (retval)
395420 return retval;
drivers/usb/dwc3/gadget.c+1−0
@@ -1078,6 +1078,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) · 1077 unmodified lines
10781078 * little bit faster.
10791079 */
10801080 if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
1081+ !usb_endpoint_xfer_int(dep->endpoint.desc) &&
10811082 !(dep->flags & DWC3_EP_BUSY)) {
10821083 ret = __dwc3_gadget_kick_transfer(dep, 0, true);
10831084 goto out;
drivers/usb/gadget/function/f_fs.c+3−3
@@ -423,7 +423,7 @@ static ssize_t __ffs_ep0_read_events(struct ffs_data *ffs, char __user *buf, · 422 unmodified lines
423423 spin_unlock_irq(&ffs->ev.waitq.lock);
424424 mutex_unlock(&ffs->mutex);
425425
426− return unlikely(__copy_to_user(buf, events, size)) ? -EFAULT : size;
426+ return unlikely(copy_to_user(buf, events, size)) ? -EFAULT : size;
427427 }
428428
429429 static ssize_t ffs_ep0_read(struct file *file, char __user *buf,
@@ -513,7 +513,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf, · 83 unmodified lines
513513
514514 /* unlocks spinlock */
515515 ret = __ffs_ep0_queue_wait(ffs, data, len);
516− if (likely(ret > 0) && unlikely(__copy_to_user(buf, data, len)))
516+ if (likely(ret > 0) && unlikely(copy_to_user(buf, data, len)))
517517 ret = -EFAULT;
518518 goto done_mutex;
519519
@@ -3493,7 +3493,7 @@ static char *ffs_prepare_buffer(const char __user *buf, size_t len) · 2973 unmodified lines
34933493 if (unlikely(!data))
34943494 return ERR_PTR(-ENOMEM);
34953495
3496− if (unlikely(__copy_from_user(data, buf, len))) {
3496+ if (unlikely(copy_from_user(data, buf, len))) {
34973497 kfree(data);
34983498 return ERR_PTR(-EFAULT);
34993499 }
drivers/usb/gadget/function/f_midi.c+2−1
@@ -370,6 +370,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt) · 369 unmodified lines
370370 if (err) {
371371 ERROR(midi, "%s queue req: %d\n",
372372 midi->out_ep->name, err);
373+ free_ep_req(midi->out_ep, req);
373374 }
374375 }
375376
@@ -545,7 +546,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req) · 169 unmodified lines
545546 }
546547 }
547548
548− if (req->length > 0) {
549+ if (req->length > 0 && ep->enabled) {
549550 int err;
550551
551552 err = usb_ep_queue(ep, req, GFP_ATOMIC);
drivers/usb/gadget/function/uvc_configfs.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #define UVC_ATTR(prefix, cname, aname) \
2121 static struct configfs_attribute prefix##attr_##cname = { \
2222 .ca_name = __stringify(aname), \
23− .ca_mode = S_IRUGO, \
23+ .ca_mode = S_IRUGO | S_IWUGO, \
2424 .ca_owner = THIS_MODULE, \
2525 .show = prefix##cname##_show, \
2626 .store = prefix##cname##_store, \
drivers/usb/gadget/udc/pxa27x_udc.c+3−0
@@ -2536,6 +2536,9 @@ static int pxa_udc_suspend(struct platform_device *_dev, pm_message_t state) · 2535 unmodified lines
25362536 udc->pullup_resume = udc->pullup_on;
25372537 dplus_pullup(udc, 0);
25382538
2539+ if (udc->driver)
2540+ udc->driver->disconnect(&udc->gadget);
2541+
25392542 return 0;
25402543 }
25412544
drivers/usb/host/ohci-at91.c+5−6
@@ -473,6 +473,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 472 unmodified lines
473473 if (!pdata)
474474 return -ENOMEM;
475475
476+ pdev->dev.platform_data = pdata;
477+
476478 if (!of_property_read_u32(np, "num-ports", &ports))
477479 pdata->ports = ports;
478480
@@ -483,6 +485,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 4 unmodified lines
483485 */
484486 if (i >= pdata->ports) {
485487 pdata->vbus_pin[i] = -EINVAL;
488+ pdata->overcurrent_pin[i] = -EINVAL;
486489 continue;
487490 }
488491
@@ -513,10 +516,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 24 unmodified lines
513516 }
514517
515518 at91_for_each_port(i) {
516− if (i >= pdata->ports) {
517− pdata->overcurrent_pin[i] = -EINVAL;
518− continue;
519− }
519+ if (i >= pdata->ports)
520+ break;
520521
521522 pdata->overcurrent_pin[i] =
522523 of_get_named_gpio_flags(np, "atmel,oc-gpio", i, &flags);
@@ -552,8 +553,6 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 29 unmodified lines
552553 }
553554 }
554555
555− pdev->dev.platform_data = pdata;
556−
557556 device_init_wakeup(&pdev->dev, 1);
558557 return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
559558 }
drivers/usb/host/whci/qset.c+4−0
@@ -377,6 +377,10 @@ static int qset_fill_page_list(struct whc *whc, struct whc_std *std, gfp_t mem_f · 376 unmodified lines
377377 if (std->pl_virt == NULL)
378378 return -ENOMEM;
379379 std->dma_addr = dma_map_single(whc->wusbhc.dev, std->pl_virt, pl_len, DMA_TO_DEVICE);
380+ if (dma_mapping_error(whc->wusbhc.dev, std->dma_addr)) {
381+ kfree(std->pl_virt);
382+ return -EFAULT;
383+ }
380384
381385 for (p = 0; p < std->num_pointers; p++) {
382386 std->pl_virt[p].buf_ptr = cpu_to_le64(dma_addr);
drivers/usb/host/xhci-hub.c+42−5
@@ -733,8 +733,30 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, · 732 unmodified lines
733733 if ((raw_port_status & PORT_RESET) ||
734734 !(raw_port_status & PORT_PE))
735735 return 0xffffffff;
736− if (time_after_eq(jiffies,
737− bus_state->resume_done[wIndex])) {
736+ /* did port event handler already start resume timing? */
737+ if (!bus_state->resume_done[wIndex]) {
738+ /* If not, maybe we are in a host initated resume? */
739+ if (test_bit(wIndex, &bus_state->resuming_ports)) {
740+ /* Host initated resume doesn't time the resume
741+ * signalling using resume_done[].
742+ * It manually sets RESUME state, sleeps 20ms
743+ * and sets U0 state. This should probably be
744+ * changed, but not right now.
745+ */
746+ } else {
747+ /* port resume was discovered now and here,
748+ * start resume timing
749+ */
750+ unsigned long timeout = jiffies +
751+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
752+
753+ set_bit(wIndex, &bus_state->resuming_ports);
754+ bus_state->resume_done[wIndex] = timeout;
755+ mod_timer(&hcd->rh_timer, timeout);
756+ }
757+ /* Has resume been signalled for USB_RESUME_TIME yet? */
758+ } else if (time_after_eq(jiffies,
759+ bus_state->resume_done[wIndex])) {
738760 int time_left;
739761
740762 xhci_dbg(xhci, "Resume USB2 port %d\n",
@@ -775,13 +797,26 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, · 34 unmodified lines
775797 } else {
776798 /*
777799 * The resume has been signaling for less than
778− * 20ms. Report the port status as SUSPEND,
779− * let the usbcore check port status again
780− * and clear resume signaling later.
800+ * USB_RESUME_TIME. Report the port status as SUSPEND,
801+ * let the usbcore check port status again and clear
802+ * resume signaling later.
781803 */
782804 status |= USB_PORT_STAT_SUSPEND;
783805 }
784806 }
807+ /*
808+ * Clear stale usb2 resume signalling variables in case port changed
809+ * state during resume signalling. For example on error
810+ */
811+ if ((bus_state->resume_done[wIndex] ||
812+ test_bit(wIndex, &bus_state->resuming_ports)) &&
813+ (raw_port_status & PORT_PLS_MASK) != XDEV_U3 &&
814+ (raw_port_status & PORT_PLS_MASK) != XDEV_RESUME) {
815+ bus_state->resume_done[wIndex] = 0;
816+ clear_bit(wIndex, &bus_state->resuming_ports);
817+ }
818+
819+
785820 if ((raw_port_status & PORT_PLS_MASK) == XDEV_U0 &&
786821 (raw_port_status & PORT_POWER)) {
787822 if (bus_state->suspended_ports & (1 << wIndex)) {
@@ -1115,6 +1150,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, · 327 unmodified lines
11151150 if ((temp & PORT_PE) == 0)
11161151 goto error;
11171152
1153+ set_bit(wIndex, &bus_state->resuming_ports);
11181154 xhci_set_link_state(xhci, port_array, wIndex,
11191155 XDEV_RESUME);
11201156 spin_unlock_irqrestore(&xhci->lock, flags);
@@ -1122,6 +1158,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, · 1 unmodified line
11221158 spin_lock_irqsave(&xhci->lock, flags);
11231159 xhci_set_link_state(xhci, port_array, wIndex,
11241160 XDEV_U0);
1161+ clear_bit(wIndex, &bus_state->resuming_ports);
11251162 }
11261163 bus_state->port_c_suspend |= 1 << wIndex;
11271164
drivers/usb/host/xhci-pci.c+6−2
@@ -188,10 +188,14 @@ static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) · 187 unmodified lines
188188 0xb7, 0x0c, 0x34, 0xac, 0x01, 0xe9, 0xbf, 0x45,
189189 0xb7, 0xe6, 0x2b, 0x34, 0xec, 0x93, 0x1e, 0x23,
190190 };
191− acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1, NULL);
191+ union acpi_object *obj;
192+
193+ obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), intel_dsm_uuid, 3, 1,
194+ NULL);
195+ ACPI_FREE(obj);
192196 }
193197 #else
194− static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
198+static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
195199 #endif /* CONFIG_ACPI */
196200
197201 /* called during probe() after chip reset completes */
drivers/usb/host/xhci-ring.c+2−1
@@ -1583,7 +1583,8 @@ static void handle_port_status(struct xhci_hcd *xhci, · 1582 unmodified lines
15831583 */
15841584 bogus_port_status = true;
15851585 goto cleanup;
1586− } else {
1586+ } else if (!test_bit(faked_port_index,
1587+ &bus_state->resuming_ports)) {
15871588 xhci_dbg(xhci, "resume HS port %d\n", port_id);
15881589 bus_state->resume_done[faked_port_index] = jiffies +
15891590 msecs_to_jiffies(USB_RESUME_TIMEOUT);
drivers/usb/host/xhci.c+8−0
@@ -4778,8 +4778,16 @@ int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, · 4777 unmodified lines
47784778 ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
47794779 slot_ctx = xhci_get_slot_ctx(xhci, config_cmd->in_ctx);
47804780 slot_ctx->dev_info |= cpu_to_le32(DEV_HUB);
4781+ /*
4782+ * refer to section 6.2.2: MTT should be 0 for full speed hub,
4783+ * but it may be already set to 1 when setup an xHCI virtual
4784+ * device, so clear it anyway.
4785+ */
47814786 if (tt->multi)
47824787 slot_ctx->dev_info |= cpu_to_le32(DEV_MTT);
4788+ else if (hdev->speed == USB_SPEED_FULL)
4789+ slot_ctx->dev_info &= cpu_to_le32(~DEV_MTT);
4790+
47834791 if (xhci->hci_version > 0x95) {
47844792 xhci_dbg(xhci, "xHCI version %x needs hub "
47854793 "TT think time and number of ports\n",
drivers/usb/musb/Kconfig+1−1
@@ -159,7 +159,7 @@ config USB_TI_CPPI_DMA · 158 unmodified lines
159159
160160 config USB_TI_CPPI41_DMA
161161 bool 'TI CPPI 4.1 (AM335x)'
162− depends on ARCH_OMAP
162+ depends on ARCH_OMAP && DMADEVICES
163163 select TI_CPPI41
164164
165165 config USB_TUSB_OMAP_DMA
drivers/usb/musb/musb_core.c+7−1
@@ -2017,7 +2017,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 2016 unmodified lines
20172017 /* We need musb_read/write functions initialized for PM */
20182018 pm_runtime_use_autosuspend(musb->controller);
20192019 pm_runtime_set_autosuspend_delay(musb->controller, 200);
2020− pm_runtime_irq_safe(musb->controller);
20212020 pm_runtime_enable(musb->controller);
20222021
20232022 /* The musb_platform_init() call:
@@ -2095,6 +2094,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 71 unmodified lines
20952094 #ifndef CONFIG_MUSB_PIO_ONLY
20962095 if (!musb->ops->dma_init || !musb->ops->dma_exit) {
20972096 dev_err(dev, "DMA controller not set\n");
2097+ status = -ENODEV;
20982098 goto fail2;
20992099 }
21002100 musb_dma_controller_create = musb->ops->dma_init;
@@ -2218,6 +2218,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 117 unmodified lines
22182218
22192219 pm_runtime_put(musb->controller);
22202220
2221+ /*
2222+ * For why this is currently needed, see commit 3e43a0725637
2223+ * ("usb: musb: core: add pm_runtime_irq_safe()")
2224+ */
2225+ pm_runtime_irq_safe(musb->controller);
2226+
22212227 return 0;
22222228
22232229 fail5:
drivers/usb/phy/phy-msm-usb.c+3−3
@@ -1506,7 +1506,6 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · 1505 unmodified lines
15061506 {
15071507 struct msm_otg_platform_data *pdata;
15081508 struct extcon_dev *ext_id, *ext_vbus;
1509− const struct of_device_id *id;
15101509 struct device_node *node = pdev->dev.of_node;
15111510 struct property *prop;
15121511 int len, ret, words;
@@ -1518,8 +1517,9 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) · 5 unmodified lines
15181517
15191518 motg->pdata = pdata;
15201519
1521− id = of_match_device(msm_otg_dt_match, &pdev->dev);
1522− pdata->phy_type = (enum msm_usb_phy_type) id->data;
1520+ pdata->phy_type = (enum msm_usb_phy_type)of_device_get_match_data(&pdev->dev);
1521+ if (!pdata->phy_type)
1522+ return 1;
15231523
15241524 motg->link_rst = devm_reset_control_get(&pdev->dev, "link");
15251525 if (IS_ERR(motg->link_rst))
drivers/usb/phy/phy-mxs-usb.c+5−0
@@ -143,12 +143,17 @@ static const struct mxs_phy_data imx6sx_phy_data = { · 142 unmodified lines
143143 .flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
144144 };
145145
146+static const struct mxs_phy_data imx6ul_phy_data = {
147+ .flags = MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS,
148+};
149+
146150 static const struct of_device_id mxs_phy_dt_ids[] = {
147151 { .compatible = "fsl,imx6sx-usbphy", .data = &imx6sx_phy_data, },
148152 { .compatible = "fsl,imx6sl-usbphy", .data = &imx6sl_phy_data, },
149153 { .compatible = "fsl,imx6q-usbphy", .data = &imx6q_phy_data, },
150154 { .compatible = "fsl,imx23-usbphy", .data = &imx23_phy_data, },
151155 { .compatible = "fsl,vf610-usbphy", .data = &vf610_phy_data, },
156+ { .compatible = "fsl,imx6ul-usbphy", .data = &imx6ul_phy_data, },
152157 { /* sentinel */ }
153158 };
154159 MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
drivers/usb/renesas_usbhs/mod_gadget.c+9−2
@@ -131,7 +131,8 @@ static void __usbhsg_queue_pop(struct usbhsg_uep *uep, · 130 unmodified lines
131131 struct device *dev = usbhsg_gpriv_to_dev(gpriv);
132132 struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
133133
134− dev_dbg(dev, "pipe %d : queue pop\n", usbhs_pipe_number(pipe));
134+ if (pipe)
135+ dev_dbg(dev, "pipe %d : queue pop\n", usbhs_pipe_number(pipe));
135136
136137 ureq->req.status = status;
137138 spin_unlock(usbhs_priv_to_lock(priv));
@@ -685,7 +686,13 @@ static int usbhsg_ep_dequeue(struct usb_ep *ep, struct usb_request *req) · 547 unmodified lines
685686 struct usbhsg_request *ureq = usbhsg_req_to_ureq(req);
686687 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
687688
688− usbhs_pkt_pop(pipe, usbhsg_ureq_to_pkt(ureq));
689+ if (pipe)
690+ usbhs_pkt_pop(pipe, usbhsg_ureq_to_pkt(ureq));
691+
692+ /*
693+ * To dequeue a request, this driver should call the usbhsg_queue_pop()
694+ * even if the pipe is NULL.
695+ */
689696 usbhsg_queue_pop(uep, ureq, -ECONNRESET);
690697
691698 return 0;
drivers/usb/serial/cp210x.c+0−1
@@ -132,7 +132,6 @@ static const struct usb_device_id id_table[] = { · 131 unmodified lines
132132 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
133133 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
134134 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
135− { USB_DEVICE(0x10C4, 0xEA80) }, /* Silicon Labs factory default */
136135 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
137136 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
138137 { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */
drivers/usb/serial/usb-serial-simple.c+1−0
@@ -53,6 +53,7 @@ DEVICE(funsoft, FUNSOFT_IDS); · 52 unmodified lines
5353
5454 /* Infineon Flashloader driver */
5555 #define FLASHLOADER_IDS() \
56+ { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \
5657 { USB_DEVICE(0x8087, 0x0716) }
5758 DEVICE(flashloader, FLASHLOADER_IDS);
5859
drivers/usb/storage/uas.c+4−0
@@ -796,6 +796,10 @@ static int uas_slave_configure(struct scsi_device *sdev) · 795 unmodified lines
796796 if (devinfo->flags & US_FL_NO_REPORT_OPCODES)
797797 sdev->no_report_opcodes = 1;
798798
799+ /* A few buggy USB-ATA bridges don't understand FUA */
800+ if (devinfo->flags & US_FL_BROKEN_FUA)
801+ sdev->broken_fua = 1;
802+
799803 scsi_change_queue_depth(sdev, devinfo->qdepth - 2);
800804 return 0;
801805 }
drivers/usb/storage/unusual_devs.h+1−1
@@ -1987,7 +1987,7 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201, · 1986 unmodified lines
19871987 US_FL_IGNORE_RESIDUE ),
19881988
19891989 /* Reported by Michael Büsch <m@bues.ch> */
1990−UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0114,
1990+UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0116,
19911991 "JMicron",
19921992 "USB to ATA/ATAPI Bridge",
19931993 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
drivers/usb/storage/unusual_uas.h+1−1
@@ -132,7 +132,7 @@ UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, · 131 unmodified lines
132132 "JMicron",
133133 "JMS567",
134134 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
135− US_FL_NO_REPORT_OPCODES),
135+ US_FL_BROKEN_FUA | US_FL_NO_REPORT_OPCODES),
136136
137137 /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
138138 UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
include/linux/usb/quirks.h+3−0
@@ -47,4 +47,7 @@ · 46 unmodified lines
4747 /* device generates spurious wakeup, ignore remote wakeup capability */
4848 #define USB_QUIRK_IGNORE_REMOTE_WAKEUP BIT(9)
4949
50+/* device can't handle Link Power Management */
51+#define USB_QUIRK_NO_LPM BIT(10)
52+
5053 #endif /* __LINUX_USB_QUIRKS_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t