Commit b9427910d2f7fae717dc780fd7bde58e6a475c61

Authored by Linus Torvalds

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

Pull USB fixes from Greg KH:
 "Here are some USB fixes for 3.18-rc4.

  Just a bunch of little fixes resolving reported issues and new device
  ids for existing drivers.  Full details are in the shortlog"

* tag 'usb-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
  USB: Update default usb-storage delay_use value in kernel-parameters.txt
  USB: cdc-acm: add quirk for control-line state requests
  phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  USB: storage: Fix timeout in usb_stor_euscsi_init() and usb_stor_huawei_e220_init()
  USB: cdc-acm: only raise DTR on transitions from B0
  Revert "storage: Replace magic number with define in usb_stor_euscsi_init()"
  usb: core: notify disconnection when core detects disconnect
  usb: core: need to call usb_phy_notify_connect after device setup
  uas: Add US_FL_NO_ATA_1X quirk for 2 more Seagate models
  xhci: no switching back on non-ULT Haswell
  USB: quirks: enable device-qualifier quirk for yet another Elan touchscreen
  USB: quirks: enable device-qualifier quirk for another Elan touchscreen
  MAINTAINERS: Remove duplicate entry for usbip driver
  usb: storage: fix build warnings !CONFIG_PM
  usb: Remove references to non-existent PLAT_S5P symbol
  uas: Add NO_ATA_1X for VIA VL711 devices
  xhci: Disable streams on Asmedia 1042 xhci controllers
  USB: HWA: fix a warning message
  uas: Add US_FL_NO_ATA_1X quirk for 1 more Seagate model
  usb-storage: handle a skipped data phase
  ...

Showing 18 changed files Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -3621,7 +3621,7 @@
3621 3621  
3622 3622 usb-storage.delay_use=
3623 3623 [UMS] The delay in seconds before a new device is
3624   - scanned for Logical Units (default 5).
  3624 + scanned for Logical Units (default 1).
3625 3625  
3626 3626 usb-storage.quirks=
3627 3627 [UMS] A list of quirks entries to supplement or
... ... @@ -9703,11 +9703,6 @@
9703 9703 F: Documentation/hid/hiddev.txt
9704 9704 F: drivers/hid/usbhid/
9705 9705  
9706   -USB/IP DRIVERS
9707   -L: linux-usb@vger.kernel.org
9708   -S: Orphan
9709   -F: drivers/staging/usbip/
9710   -
9711 9706 USB ISP116X DRIVER
9712 9707 M: Olav Kongas <ok@artecdesign.ee>
9713 9708 L: linux-usb@vger.kernel.org
drivers/phy/phy-omap-usb2.c
... ... @@ -258,14 +258,16 @@
258 258 otg->phy = &phy->phy;
259 259  
260 260 platform_set_drvdata(pdev, phy);
  261 + pm_runtime_enable(phy->dev);
261 262  
262 263 generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL);
263   - if (IS_ERR(generic_phy))
  264 + if (IS_ERR(generic_phy)) {
  265 + pm_runtime_disable(phy->dev);
264 266 return PTR_ERR(generic_phy);
  267 + }
265 268  
266 269 phy_set_drvdata(generic_phy, phy);
267 270  
268   - pm_runtime_enable(phy->dev);
269 271 phy_provider = devm_of_phy_provider_register(phy->dev,
270 272 of_phy_simple_xlate);
271 273 if (IS_ERR(phy_provider)) {
drivers/usb/class/cdc-acm.c
... ... @@ -60,6 +60,9 @@
60 60  
61 61 static DEFINE_MUTEX(acm_table_lock);
62 62  
  63 +static void acm_tty_set_termios(struct tty_struct *tty,
  64 + struct ktermios *termios_old);
  65 +
63 66 /*
64 67 * acm_table accessors
65 68 */
... ... @@ -145,8 +148,15 @@
145 148 /* devices aren't required to support these requests.
146 149 * the cdc acm descriptor tells whether they do...
147 150 */
148   -#define acm_set_control(acm, control) \
149   - acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE, control, NULL, 0)
  151 +static inline int acm_set_control(struct acm *acm, int control)
  152 +{
  153 + if (acm->quirks & QUIRK_CONTROL_LINE_STATE)
  154 + return -EOPNOTSUPP;
  155 +
  156 + return acm_ctrl_msg(acm, USB_CDC_REQ_SET_CONTROL_LINE_STATE,
  157 + control, NULL, 0);
  158 +}
  159 +
150 160 #define acm_set_line(acm, line) \
151 161 acm_ctrl_msg(acm, USB_CDC_REQ_SET_LINE_CODING, 0, line, sizeof *(line))
152 162 #define acm_send_break(acm, ms) \
... ... @@ -554,6 +564,8 @@
554 564 goto error_submit_urb;
555 565 }
556 566  
  567 + acm_tty_set_termios(tty, NULL);
  568 +
557 569 /*
558 570 * Unthrottle device in case the TTY was closed while throttled.
559 571 */
560 572  
561 573  
... ... @@ -980,11 +992,12 @@
980 992 /* FIXME: Needs to clear unsupported bits in the termios */
981 993 acm->clocal = ((termios->c_cflag & CLOCAL) != 0);
982 994  
983   - if (!newline.dwDTERate) {
  995 + if (C_BAUD(tty) == B0) {
984 996 newline.dwDTERate = acm->line.dwDTERate;
985 997 newctrl &= ~ACM_CTRL_DTR;
986   - } else
  998 + } else if (termios_old && (termios_old->c_cflag & CBAUD) == B0) {
987 999 newctrl |= ACM_CTRL_DTR;
  1000 + }
988 1001  
989 1002 if (newctrl != acm->ctrlout)
990 1003 acm_set_control(acm, acm->ctrlout = newctrl);
... ... @@ -1314,6 +1327,7 @@
1314 1327 tty_port_init(&acm->port);
1315 1328 acm->port.ops = &acm_port_ops;
1316 1329 init_usb_anchor(&acm->delayed);
  1330 + acm->quirks = quirks;
1317 1331  
1318 1332 buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
1319 1333 if (!buf) {
... ... @@ -1681,6 +1695,9 @@
1681 1695 { USB_DEVICE(0x0572, 0x1328), /* Shiro / Aztech USB MODEM UM-3100 */
1682 1696 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1683 1697 },
  1698 + { USB_DEVICE(0x20df, 0x0001), /* Simtec Electronics Entropy Key */
  1699 + .driver_info = QUIRK_CONTROL_LINE_STATE, },
  1700 + { USB_DEVICE(0x2184, 0x001c) }, /* GW Instek AFG-2225 */
1684 1701 { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
1685 1702 },
1686 1703 /* Motorola H24 HSPA module: */
drivers/usb/class/cdc-acm.h
... ... @@ -121,6 +121,7 @@
121 121 unsigned int throttle_req:1; /* throttle requested */
122 122 u8 bInterval;
123 123 struct usb_anchor delayed; /* writes queued for a device about to be woken */
  124 + unsigned long quirks;
124 125 };
125 126  
126 127 #define CDC_DATA_INTERFACE_TYPE 0x0a
... ... @@ -132,4 +133,5 @@
132 133 #define NOT_A_MODEM BIT(3)
133 134 #define NO_DATA_INTERFACE BIT(4)
134 135 #define IGNORE_DEVICE BIT(5)
  136 +#define QUIRK_CONTROL_LINE_STATE BIT(6)
drivers/usb/core/hcd.c
... ... @@ -2060,6 +2060,8 @@
2060 2060 return -EINVAL;
2061 2061 if (dev->speed != USB_SPEED_SUPER)
2062 2062 return -EINVAL;
  2063 + if (dev->state < USB_STATE_CONFIGURED)
  2064 + return -ENODEV;
2063 2065  
2064 2066 for (i = 0; i < num_eps; i++) {
2065 2067 /* Streams only apply to bulk endpoints. */
drivers/usb/core/hub.c
... ... @@ -4468,9 +4468,6 @@
4468 4468 if (retval)
4469 4469 goto fail;
4470 4470  
4471   - if (hcd->usb_phy && !hdev->parent)
4472   - usb_phy_notify_connect(hcd->usb_phy, udev->speed);
4473   -
4474 4471 /*
4475 4472 * Some superspeed devices have finished the link training process
4476 4473 * and attached to a superspeed hub port, but the device descriptor
... ... @@ -4627,8 +4624,7 @@
4627 4624  
4628 4625 /* Disconnect any existing devices under this port */
4629 4626 if (udev) {
4630   - if (hcd->usb_phy && !hdev->parent &&
4631   - !(portstatus & USB_PORT_STAT_CONNECTION))
  4627 + if (hcd->usb_phy && !hdev->parent)
4632 4628 usb_phy_notify_disconnect(hcd->usb_phy, udev->speed);
4633 4629 usb_disconnect(&port_dev->child);
4634 4630 }
... ... @@ -4783,6 +4779,10 @@
4783 4779 port_dev->child = NULL;
4784 4780 spin_unlock_irq(&device_state_lock);
4785 4781 mutex_unlock(&usb_port_peer_mutex);
  4782 + } else {
  4783 + if (hcd->usb_phy && !hdev->parent)
  4784 + usb_phy_notify_connect(hcd->usb_phy,
  4785 + udev->speed);
4786 4786 }
4787 4787 }
4788 4788  
drivers/usb/core/quirks.c
... ... @@ -97,6 +97,12 @@
97 97 { USB_DEVICE(0x04f3, 0x0089), .driver_info =
98 98 USB_QUIRK_DEVICE_QUALIFIER },
99 99  
  100 + { USB_DEVICE(0x04f3, 0x009b), .driver_info =
  101 + USB_QUIRK_DEVICE_QUALIFIER },
  102 +
  103 + { USB_DEVICE(0x04f3, 0x016f), .driver_info =
  104 + USB_QUIRK_DEVICE_QUALIFIER },
  105 +
100 106 /* Roland SC-8820 */
101 107 { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
102 108  
drivers/usb/dwc2/gadget.c
... ... @@ -2327,7 +2327,7 @@
2327 2327  
2328 2328 u32 usb_status = readl(hsotg->regs + GOTGCTL);
2329 2329  
2330   - dev_info(hsotg->dev, "%s: USBRst\n", __func__);
  2330 + dev_dbg(hsotg->dev, "%s: USBRst\n", __func__);
2331 2331 dev_dbg(hsotg->dev, "GNPTXSTS=%08x\n",
2332 2332 readl(hsotg->regs + GNPTXSTS));
2333 2333  
drivers/usb/host/Kconfig
... ... @@ -234,7 +234,7 @@
234 234  
235 235 config USB_EHCI_EXYNOS
236 236 tristate "EHCI support for Samsung S5P/EXYNOS SoC Series"
237   - depends on PLAT_S5P || ARCH_EXYNOS
  237 + depends on ARCH_S5PV210 || ARCH_EXYNOS
238 238 help
239 239 Enable support for the Samsung Exynos SOC's on-chip EHCI controller.
240 240  
... ... @@ -550,7 +550,7 @@
550 550  
551 551 config USB_OHCI_EXYNOS
552 552 tristate "OHCI support for Samsung S5P/EXYNOS SoC Series"
553   - depends on PLAT_S5P || ARCH_EXYNOS
  553 + depends on ARCH_S5PV210 || ARCH_EXYNOS
554 554 help
555 555 Enable support for the Samsung Exynos SOC's on-chip OHCI controller.
556 556  
drivers/usb/host/hwa-hc.c
... ... @@ -607,7 +607,7 @@
607 607 wa->wa_descr = wa_descr = (struct usb_wa_descriptor *) hdr;
608 608 if (le16_to_cpu(wa_descr->bcdWAVersion) > 0x0100)
609 609 dev_warn(dev, "Wire Adapter v%d.%d newer than groked v1.0\n",
610   - le16_to_cpu(wa_descr->bcdWAVersion) & 0xff00 >> 8,
  610 + (le16_to_cpu(wa_descr->bcdWAVersion) & 0xff00) >> 8,
611 611 le16_to_cpu(wa_descr->bcdWAVersion) & 0x00ff);
612 612 result = 0;
613 613 error:
drivers/usb/host/xhci-pci.c
... ... @@ -128,20 +128,6 @@
128 128 xhci->quirks |= XHCI_AVOID_BEI;
129 129 }
130 130 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
131   - (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI ||
132   - pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI)) {
133   - /* Workaround for occasional spurious wakeups from S5 (or
134   - * any other sleep) on Haswell machines with LPT and LPT-LP
135   - * with the new Intel BIOS
136   - */
137   - /* Limit the quirk to only known vendors, as this triggers
138   - * yet another BIOS bug on some other machines
139   - * https://bugzilla.kernel.org/show_bug.cgi?id=66171
140   - */
141   - if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP)
142   - xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
143   - }
144   - if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
145 131 pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
146 132 xhci->quirks |= XHCI_SPURIOUS_REBOOT;
147 133 }
... ... @@ -160,6 +146,10 @@
160 146 /* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */
161 147 if (pdev->vendor == PCI_VENDOR_ID_VIA &&
162 148 pdev->device == 0x3432)
  149 + xhci->quirks |= XHCI_BROKEN_STREAMS;
  150 +
  151 + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
  152 + pdev->device == 0x1042)
163 153 xhci->quirks |= XHCI_BROKEN_STREAMS;
164 154  
165 155 if (xhci->quirks & XHCI_RESET_ON_RESUME)
drivers/usb/serial/kobil_sct.c
... ... @@ -335,7 +335,8 @@
335 335 port->interrupt_out_urb->transfer_buffer_length = length;
336 336  
337 337 priv->cur_pos = priv->cur_pos + length;
338   - result = usb_submit_urb(port->interrupt_out_urb, GFP_NOIO);
  338 + result = usb_submit_urb(port->interrupt_out_urb,
  339 + GFP_ATOMIC);
339 340 dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result);
340 341 todo = priv->filled - priv->cur_pos;
341 342  
... ... @@ -350,7 +351,7 @@
350 351 if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
351 352 priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
352 353 result = usb_submit_urb(port->interrupt_in_urb,
353   - GFP_NOIO);
  354 + GFP_ATOMIC);
354 355 dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
355 356 }
356 357 }
drivers/usb/serial/opticon.c
... ... @@ -215,7 +215,7 @@
215 215  
216 216 /* The connected devices do not have a bulk write endpoint,
217 217 * to transmit data to de barcode device the control endpoint is used */
218   - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
  218 + dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
219 219 if (!dr) {
220 220 count = -ENOMEM;
221 221 goto error_no_dr;
drivers/usb/storage/initializers.c
... ... @@ -52,7 +52,7 @@
52 52 us->iobuf[0] = 0x1;
53 53 result = usb_stor_control_msg(us, us->send_ctrl_pipe,
54 54 0x0C, USB_RECIP_INTERFACE | USB_TYPE_VENDOR,
55   - 0x01, 0x0, us->iobuf, 0x1, USB_CTRL_SET_TIMEOUT);
  55 + 0x01, 0x0, us->iobuf, 0x1, 5 * HZ);
56 56 usb_stor_dbg(us, "-- result is %d\n", result);
57 57  
58 58 return 0;
... ... @@ -100,7 +100,7 @@
100 100 result = usb_stor_control_msg(us, us->send_ctrl_pipe,
101 101 USB_REQ_SET_FEATURE,
102 102 USB_TYPE_STANDARD | USB_RECIP_DEVICE,
103   - 0x01, 0x0, NULL, 0x0, 1000);
  103 + 0x01, 0x0, NULL, 0x0, 1 * HZ);
104 104 usb_stor_dbg(us, "Huawei mode set result is %d\n", result);
105 105 return 0;
106 106 }
drivers/usb/storage/realtek_cr.c
... ... @@ -626,6 +626,7 @@
626 626 return 0;
627 627 }
628 628  
  629 +#ifdef CONFIG_PM
629 630 static int config_autodelink_before_power_down(struct us_data *us)
630 631 {
631 632 struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra);
... ... @@ -716,6 +717,7 @@
716 717 }
717 718 }
718 719 }
  720 +#endif
719 721  
720 722 #ifdef CONFIG_REALTEK_AUTOPM
721 723 static void fw5895_set_mmc_wp(struct us_data *us)
drivers/usb/storage/transport.c
... ... @@ -1118,6 +1118,31 @@
1118 1118 */
1119 1119 if (result == USB_STOR_XFER_LONG)
1120 1120 fake_sense = 1;
  1121 +
  1122 + /*
  1123 + * Sometimes a device will mistakenly skip the data phase
  1124 + * and go directly to the status phase without sending a
  1125 + * zero-length packet. If we get a 13-byte response here,
  1126 + * check whether it really is a CSW.
  1127 + */
  1128 + if (result == USB_STOR_XFER_SHORT &&
  1129 + srb->sc_data_direction == DMA_FROM_DEVICE &&
  1130 + transfer_length - scsi_get_resid(srb) ==
  1131 + US_BULK_CS_WRAP_LEN) {
  1132 + struct scatterlist *sg = NULL;
  1133 + unsigned int offset = 0;
  1134 +
  1135 + if (usb_stor_access_xfer_buf((unsigned char *) bcs,
  1136 + US_BULK_CS_WRAP_LEN, srb, &sg,
  1137 + &offset, FROM_XFER_BUF) ==
  1138 + US_BULK_CS_WRAP_LEN &&
  1139 + bcs->Signature ==
  1140 + cpu_to_le32(US_BULK_CS_SIGN)) {
  1141 + usb_stor_dbg(us, "Device skipped data phase\n");
  1142 + scsi_set_resid(srb, transfer_length);
  1143 + goto skipped_data_phase;
  1144 + }
  1145 + }
1121 1146 }
1122 1147  
1123 1148 /* See flow chart on pg 15 of the Bulk Only Transport spec for
... ... @@ -1153,6 +1178,7 @@
1153 1178 if (result != USB_STOR_XFER_GOOD)
1154 1179 return USB_STOR_TRANSPORT_ERROR;
1155 1180  
  1181 + skipped_data_phase:
1156 1182 /* check bulk status */
1157 1183 residue = le32_to_cpu(bcs->Residue);
1158 1184 usb_stor_dbg(us, "Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
drivers/usb/storage/unusual_uas.h
... ... @@ -54,6 +54,20 @@
54 54 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
55 55 US_FL_NO_ATA_1X),
56 56  
  57 +/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
  58 +UNUSUAL_DEV(0x0bc2, 0x3320, 0x0000, 0x9999,
  59 + "Seagate",
  60 + "Expansion Desk",
  61 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
  62 + US_FL_NO_ATA_1X),
  63 +
  64 +/* Reported-by: Bogdan Mihalcea <bogdan.mihalcea@infim.ro> */
  65 +UNUSUAL_DEV(0x0bc2, 0xa003, 0x0000, 0x9999,
  66 + "Seagate",
  67 + "Backup Plus",
  68 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
  69 + US_FL_NO_ATA_1X),
  70 +
57 71 /* https://bbs.archlinux.org/viewtopic.php?id=183190 */
58 72 UNUSUAL_DEV(0x0bc2, 0xab20, 0x0000, 0x9999,
59 73 "Seagate",
... ... @@ -61,6 +75,13 @@
61 75 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
62 76 US_FL_NO_ATA_1X),
63 77  
  78 +/* https://bbs.archlinux.org/viewtopic.php?id=183190 */
  79 +UNUSUAL_DEV(0x0bc2, 0xab21, 0x0000, 0x9999,
  80 + "Seagate",
  81 + "Backup+ BK",
  82 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
  83 + US_FL_NO_ATA_1X),
  84 +
64 85 /* Reported-by: Claudio Bizzarri <claudio.bizzarri@gmail.com> */
65 86 UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999,
66 87 "JMicron",
... ... @@ -75,4 +96,11 @@
75 96 "ASM1051",
76 97 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
77 98 US_FL_IGNORE_UAS),
  99 +
  100 +/* Reported-by: Hans de Goede <hdegoede@redhat.com> */
  101 +UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
  102 + "VIA",
  103 + "VL711",
  104 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
  105 + US_FL_NO_ATA_1X),