Commit 8ee7a330fbb78344802cc6c3cc8be023b6d05aa0

Authored by Linus Torvalds

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

Pull USB fixes from Greg KH:
 "Here are some fixes for 3.15-rc8 that resolve a number of tiny USB
  issues that have been reported, and there are some new device ids as
  well.

  All have been tested in linux-next"

* tag 'usb-3.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  xhci: delete endpoints from bandwidth list before freeing whole device
  usb: pci-quirks: Prevent Sony VAIO t-series from switching usb ports
  USB: cdc-wdm: properly include types.h
  usb: cdc-wdm: export cdc-wdm uapi header
  USB: serial: option: add support for Novatel E371 PCIe card
  USB: ftdi_sio: add NovaTech OrionLXm product ID
  USB: io_ti: fix firmware download on big-endian machines (part 2)
  USB: Avoid runtime suspend loops for HCDs that can't handle suspend/resume

Showing 11 changed files Side-by-side Diff

drivers/usb/core/driver.c
... ... @@ -1822,10 +1822,13 @@
1822 1822 if (status == -EAGAIN || status == -EBUSY)
1823 1823 usb_mark_last_busy(udev);
1824 1824  
1825   - /* The PM core reacts badly unless the return code is 0,
1826   - * -EAGAIN, or -EBUSY, so always return -EBUSY on an error.
  1825 + /*
  1826 + * The PM core reacts badly unless the return code is 0,
  1827 + * -EAGAIN, or -EBUSY, so always return -EBUSY on an error
  1828 + * (except for root hubs, because they don't suspend through
  1829 + * an upstream port like other USB devices).
1827 1830 */
1828   - if (status != 0)
  1831 + if (status != 0 && udev->parent)
1829 1832 return -EBUSY;
1830 1833 return status;
1831 1834 }
drivers/usb/core/hub.c
... ... @@ -1691,8 +1691,19 @@
1691 1691 */
1692 1692 pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
1693 1693  
1694   - /* Hubs have proper suspend/resume support. */
1695   - usb_enable_autosuspend(hdev);
  1694 + /*
  1695 + * Hubs have proper suspend/resume support, except for root hubs
  1696 + * where the controller driver doesn't have bus_suspend and
  1697 + * bus_resume methods.
  1698 + */
  1699 + if (hdev->parent) { /* normal device */
  1700 + usb_enable_autosuspend(hdev);
  1701 + } else { /* root hub */
  1702 + const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver;
  1703 +
  1704 + if (drv->bus_suspend && drv->bus_resume)
  1705 + usb_enable_autosuspend(hdev);
  1706 + }
1696 1707  
1697 1708 if (hdev->level == MAX_TOPO_LEVEL) {
1698 1709 dev_err(&intf->dev,
drivers/usb/host/pci-quirks.c
... ... @@ -847,6 +847,13 @@
847 847 bool ehci_found = false;
848 848 struct pci_dev *companion = NULL;
849 849  
  850 + /* Sony VAIO t-series with subsystem device ID 90a8 is not capable of
  851 + * switching ports from EHCI to xHCI
  852 + */
  853 + if (xhci_pdev->subsystem_vendor == PCI_VENDOR_ID_SONY &&
  854 + xhci_pdev->subsystem_device == 0x90a8)
  855 + return;
  856 +
850 857 /* make sure an intel EHCI controller exists */
851 858 for_each_pci_dev(companion) {
852 859 if (companion->class == PCI_CLASS_SERIAL_USB_EHCI &&
drivers/usb/host/xhci-mem.c
... ... @@ -1822,6 +1822,16 @@
1822 1822 kfree(cur_cd);
1823 1823 }
1824 1824  
  1825 + num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
  1826 + for (i = 0; i < num_ports; i++) {
  1827 + struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
  1828 + for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
  1829 + struct list_head *ep = &bwt->interval_bw[j].endpoints;
  1830 + while (!list_empty(ep))
  1831 + list_del_init(ep->next);
  1832 + }
  1833 + }
  1834 +
1825 1835 for (i = 1; i < MAX_HC_SLOTS; ++i)
1826 1836 xhci_free_virt_device(xhci, i);
1827 1837  
... ... @@ -1856,16 +1866,6 @@
1856 1866  
1857 1867 if (!xhci->rh_bw)
1858 1868 goto no_bw;
1859   -
1860   - num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
1861   - for (i = 0; i < num_ports; i++) {
1862   - struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
1863   - for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
1864   - struct list_head *ep = &bwt->interval_bw[j].endpoints;
1865   - while (!list_empty(ep))
1866   - list_del_init(ep->next);
1867   - }
1868   - }
1869 1869  
1870 1870 for (i = 0; i < num_ports; i++) {
1871 1871 struct xhci_tt_bw_info *tt, *n;
drivers/usb/serial/ftdi_sio.c
... ... @@ -580,6 +580,8 @@
580 580 { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) },
581 581 { USB_DEVICE(FTDI_VID, FTDI_TIAO_UMPA_PID),
582 582 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
  583 + { USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
  584 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
583 585 /*
584 586 * ELV devices:
585 587 */
drivers/usb/serial/ftdi_sio_ids.h
... ... @@ -538,6 +538,11 @@
538 538 */
539 539 #define FTDI_TIAO_UMPA_PID 0x8a98 /* TIAO/DIYGADGET USB Multi-Protocol Adapter */
540 540  
  541 +/*
  542 + * NovaTech product ids (FTDI_VID)
  543 + */
  544 +#define FTDI_NT_ORIONLXM_PID 0x7c90 /* OrionLXm Substation Automation Platform */
  545 +
541 546  
542 547 /********************************/
543 548 /** third-party VID/PID combos **/
drivers/usb/serial/io_ti.c
... ... @@ -821,7 +821,7 @@
821 821 firmware_rec = (struct ti_i2c_firmware_rec*)i2c_header->Data;
822 822  
823 823 i2c_header->Type = I2C_DESC_TYPE_FIRMWARE_BLANK;
824   - i2c_header->Size = (__u16)buffer_size;
  824 + i2c_header->Size = cpu_to_le16(buffer_size);
825 825 i2c_header->CheckSum = cs;
826 826 firmware_rec->Ver_Major = OperationalMajorVersion;
827 827 firmware_rec->Ver_Minor = OperationalMinorVersion;
drivers/usb/serial/io_usbvend.h
... ... @@ -594,7 +594,7 @@
594 594  
595 595 struct ti_i2c_desc {
596 596 __u8 Type; // Type of descriptor
597   - __u16 Size; // Size of data only not including header
  597 + __le16 Size; // Size of data only not including header
598 598 __u8 CheckSum; // Checksum (8 bit sum of data only)
599 599 __u8 Data[0]; // Data starts here
600 600 } __attribute__((packed));
drivers/usb/serial/option.c
... ... @@ -161,6 +161,7 @@
161 161 #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000
162 162 #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
163 163 #define NOVATELWIRELESS_PRODUCT_E362 0x9010
  164 +#define NOVATELWIRELESS_PRODUCT_E371 0x9011
164 165 #define NOVATELWIRELESS_PRODUCT_G2 0xA010
165 166 #define NOVATELWIRELESS_PRODUCT_MC551 0xB001
166 167  
... ... @@ -1012,6 +1013,7 @@
1012 1013 /* Novatel Ovation MC551 a.k.a. Verizon USB551L */
1013 1014 { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
1014 1015 { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) },
  1016 + { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) },
1015 1017  
1016 1018 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
1017 1019 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
include/uapi/linux/usb/Kbuild
1 1 # UAPI Header export list
2 2 header-y += audio.h
3 3 header-y += cdc.h
  4 +header-y += cdc-wdm.h
4 5 header-y += ch11.h
5 6 header-y += ch9.h
6 7 header-y += functionfs.h
include/uapi/linux/usb/cdc-wdm.h
... ... @@ -9,6 +9,8 @@
9 9 #ifndef _UAPI__LINUX_USB_CDC_WDM_H
10 10 #define _UAPI__LINUX_USB_CDC_WDM_H
11 11  
  12 +#include <linux/types.h>
  13 +
12 14 /*
13 15 * This IOCTL is used to retrieve the wMaxCommand for the device,
14 16 * defining the message limit for both reading and writing.