Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull USB fixes from Greg KH:
"Here are a bunch of fixes for the USB drivers for 3.17-rc3.

Also in here is the movement of the usbip driver out of staging, into
the "real" part of the kernel, it had to wait until after -rc1 to
handle the merge issues involved between the USB and staging trees.
The code is identical, just file movements there.

The USB fixes are all over the place, new device ids, xhci fixes for
reported issues and the usual gadget driver fixes as well. All have
been in linux-next for a while now"

* tag 'usb-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (46 commits)
USB: fix build error with CONFIG_PM_RUNTIME disabled
Revert "usb: ehci/ohci-exynos: Fix PHY getting sequence"
xhci: Disable streams on Via XHCI with device-id 0x3432
USB: serial: fix potential heap buffer overflow
USB: serial: fix potential stack buffer overflow
usb: ehci/ohci-exynos: Fix PHY getting sequence
usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1
USB: sisusb: add device id for Magic Control USB video
usb: dwc2: gadget: Set the default EP max packet value as 8 bytes
usb: ehci: using wIndex + 1 for hub port
USB: storage: add quirk for Newer Technology uSCSI SCSI-USB converter
MAINTAINERS: Add an entry for USB/IP driver
usbip: remove struct usb_device_id table
usbip: move usbip kernel code out of staging
usbip: move usbip userspace code out of staging
USB: whiteheat: Added bounds checking for bulk command response
usb: gadget: remove $(PWD) in ccflags-y
usb: pch_udc: usb gadget device support for Intel Quark X1000
usb: gadget: uvc: fix possible lockup in uvc gadget
usb: wusbcore: fix below build warning
...

+210 -165
+8
MAINTAINERS
··· 9557 9557 F: Documentation/usb/ohci.txt 9558 9558 F: drivers/usb/host/ohci* 9559 9559 9560 + USB OVER IP DRIVER 9561 + M: Valentina Manea <valentina.manea.m@gmail.com> 9562 + M: Shuah Khan <shuah.kh@samsung.com> 9563 + L: linux-usb@vger.kernel.org 9564 + S: Maintained 9565 + F: drivers/usb/usbip/ 9566 + F: tools/usb/usbip/ 9567 + 9560 9568 USB PEGASUS DRIVER 9561 9569 M: Petko Manolov <petkan@nucleusys.com> 9562 9570 L: linux-usb@vger.kernel.org
-2
drivers/staging/Kconfig
··· 28 28 29 29 source "drivers/staging/slicoss/Kconfig" 30 30 31 - source "drivers/staging/usbip/Kconfig" 32 - 33 31 source "drivers/staging/wlan-ng/Kconfig" 34 32 35 33 source "drivers/staging/comedi/Kconfig"
-1
drivers/staging/Makefile
··· 6 6 obj-y += media/ 7 7 obj-$(CONFIG_ET131X) += et131x/ 8 8 obj-$(CONFIG_SLICOSS) += slicoss/ 9 - obj-$(CONFIG_USBIP_CORE) += usbip/ 10 9 obj-$(CONFIG_PRISM2_USB) += wlan-ng/ 11 10 obj-$(CONFIG_COMEDI) += comedi/ 12 11 obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/
drivers/staging/usbip/Kconfig drivers/usb/usbip/Kconfig
drivers/staging/usbip/Makefile drivers/usb/usbip/Makefile
drivers/staging/usbip/README drivers/usb/usbip/README
drivers/staging/usbip/stub.h drivers/usb/usbip/stub.h
-27
drivers/staging/usbip/stub_dev.c drivers/usb/usbip/stub_dev.c
··· 26 26 #include "stub.h" 27 27 28 28 /* 29 - * Define device IDs here if you want to explicitly limit exportable devices. 30 - * In most cases, wildcard matching will be okay because driver binding can be 31 - * changed dynamically by a userland program. 32 - */ 33 - static struct usb_device_id stub_table[] = { 34 - #if 0 35 - /* just an example */ 36 - { USB_DEVICE(0x05ac, 0x0301) }, /* Mac 1 button mouse */ 37 - { USB_DEVICE(0x0430, 0x0009) }, /* Plat Home Keyboard */ 38 - { USB_DEVICE(0x059b, 0x0001) }, /* Iomega USB Zip 100 */ 39 - { USB_DEVICE(0x04b3, 0x4427) }, /* IBM USB CD-ROM */ 40 - { USB_DEVICE(0x05a9, 0xa511) }, /* LifeView USB cam */ 41 - { USB_DEVICE(0x55aa, 0x0201) }, /* Imation card reader */ 42 - { USB_DEVICE(0x046d, 0x0870) }, /* Qcam Express(QV-30) */ 43 - { USB_DEVICE(0x04bb, 0x0101) }, /* IO-DATA HD 120GB */ 44 - { USB_DEVICE(0x04bb, 0x0904) }, /* IO-DATA USB-ET/TX */ 45 - { USB_DEVICE(0x04bb, 0x0201) }, /* IO-DATA USB-ET/TX */ 46 - { USB_DEVICE(0x08bb, 0x2702) }, /* ONKYO USB Speaker */ 47 - { USB_DEVICE(0x046d, 0x08b2) }, /* Logicool Qcam 4000 Pro */ 48 - #endif 49 - /* magic for wild card */ 50 - { .driver_info = 1 }, 51 - { 0, } /* Terminating entry */ 52 - }; 53 - MODULE_DEVICE_TABLE(usb, stub_table); 54 - 55 - /* 56 29 * usbip_status shows the status of usbip-host as long as this driver is bound 57 30 * to the target device. 58 31 */
drivers/staging/usbip/stub_main.c drivers/usb/usbip/stub_main.c
drivers/staging/usbip/stub_rx.c drivers/usb/usbip/stub_rx.c
drivers/staging/usbip/stub_tx.c drivers/usb/usbip/stub_tx.c
drivers/staging/usbip/uapi/usbip.h include/uapi/linux/usbip.h
drivers/staging/usbip/usbip_common.c drivers/usb/usbip/usbip_common.c
+1 -1
drivers/staging/usbip/usbip_common.h drivers/usb/usbip/usbip_common.h
··· 29 29 #include <linux/types.h> 30 30 #include <linux/usb.h> 31 31 #include <linux/wait.h> 32 - #include "uapi/usbip.h" 32 + #include <uapi/linux/usbip.h> 33 33 34 34 #define USBIP_VERSION "1.0.0" 35 35
drivers/staging/usbip/usbip_event.c drivers/usb/usbip/usbip_event.c
drivers/staging/usbip/usbip_protocol.txt drivers/usb/usbip/usbip_protocol.txt
drivers/staging/usbip/userspace/.gitignore tools/usb/usbip/.gitignore
drivers/staging/usbip/userspace/AUTHORS tools/usb/usbip/AUTHORS
drivers/staging/usbip/userspace/COPYING tools/usb/usbip/COPYING
drivers/staging/usbip/userspace/INSTALL tools/usb/usbip/INSTALL
drivers/staging/usbip/userspace/Makefile.am tools/usb/usbip/Makefile.am
drivers/staging/usbip/userspace/README tools/usb/usbip/README
drivers/staging/usbip/userspace/autogen.sh tools/usb/usbip/autogen.sh
drivers/staging/usbip/userspace/cleanup.sh tools/usb/usbip/cleanup.sh
drivers/staging/usbip/userspace/configure.ac tools/usb/usbip/configure.ac
drivers/staging/usbip/userspace/doc/usbip.8 tools/usb/usbip/doc/usbip.8
drivers/staging/usbip/userspace/doc/usbipd.8 tools/usb/usbip/doc/usbipd.8
drivers/staging/usbip/userspace/libsrc/Makefile.am tools/usb/usbip/libsrc/Makefile.am
drivers/staging/usbip/userspace/libsrc/list.h tools/usb/usbip/libsrc/list.h
drivers/staging/usbip/userspace/libsrc/names.c tools/usb/usbip/libsrc/names.c
drivers/staging/usbip/userspace/libsrc/names.h tools/usb/usbip/libsrc/names.h
drivers/staging/usbip/userspace/libsrc/sysfs_utils.c tools/usb/usbip/libsrc/sysfs_utils.c
drivers/staging/usbip/userspace/libsrc/sysfs_utils.h tools/usb/usbip/libsrc/sysfs_utils.h
drivers/staging/usbip/userspace/libsrc/usbip_common.c tools/usb/usbip/libsrc/usbip_common.c
drivers/staging/usbip/userspace/libsrc/usbip_common.h tools/usb/usbip/libsrc/usbip_common.h
drivers/staging/usbip/userspace/libsrc/usbip_host_driver.c tools/usb/usbip/libsrc/usbip_host_driver.c
drivers/staging/usbip/userspace/libsrc/usbip_host_driver.h tools/usb/usbip/libsrc/usbip_host_driver.h
drivers/staging/usbip/userspace/libsrc/vhci_driver.c tools/usb/usbip/libsrc/vhci_driver.c
drivers/staging/usbip/userspace/libsrc/vhci_driver.h tools/usb/usbip/libsrc/vhci_driver.h
drivers/staging/usbip/userspace/src/Makefile.am tools/usb/usbip/src/Makefile.am
drivers/staging/usbip/userspace/src/usbip.c tools/usb/usbip/src/usbip.c
drivers/staging/usbip/userspace/src/usbip.h tools/usb/usbip/src/usbip.h
drivers/staging/usbip/userspace/src/usbip_attach.c tools/usb/usbip/src/usbip_attach.c
drivers/staging/usbip/userspace/src/usbip_bind.c tools/usb/usbip/src/usbip_bind.c
drivers/staging/usbip/userspace/src/usbip_detach.c tools/usb/usbip/src/usbip_detach.c
drivers/staging/usbip/userspace/src/usbip_list.c tools/usb/usbip/src/usbip_list.c
drivers/staging/usbip/userspace/src/usbip_network.c tools/usb/usbip/src/usbip_network.c
drivers/staging/usbip/userspace/src/usbip_network.h tools/usb/usbip/src/usbip_network.h
drivers/staging/usbip/userspace/src/usbip_port.c tools/usb/usbip/src/usbip_port.c
drivers/staging/usbip/userspace/src/usbip_unbind.c tools/usb/usbip/src/usbip_unbind.c
drivers/staging/usbip/userspace/src/usbipd.c tools/usb/usbip/src/usbipd.c
drivers/staging/usbip/userspace/src/utils.c tools/usb/usbip/src/utils.c
drivers/staging/usbip/userspace/src/utils.h tools/usb/usbip/src/utils.h
drivers/staging/usbip/vhci.h drivers/usb/usbip/vhci.h
drivers/staging/usbip/vhci_hcd.c drivers/usb/usbip/vhci_hcd.c
drivers/staging/usbip/vhci_rx.c drivers/usb/usbip/vhci_rx.c
drivers/staging/usbip/vhci_sysfs.c drivers/usb/usbip/vhci_sysfs.c
drivers/staging/usbip/vhci_tx.c drivers/usb/usbip/vhci_tx.c
+2
drivers/usb/Kconfig
··· 92 92 93 93 source "drivers/usb/image/Kconfig" 94 94 95 + source "drivers/usb/usbip/Kconfig" 96 + 95 97 endif 96 98 97 99 source "drivers/usb/musb/Kconfig"
+2
drivers/usb/Makefile
··· 60 60 obj-$(CONFIG_USB_GADGET) += gadget/ 61 61 62 62 obj-$(CONFIG_USB_COMMON) += common/ 63 + 64 + obj-$(CONFIG_USBIP_CORE) += usbip/
+10 -6
drivers/usb/core/hub.c
··· 1728 1728 * - Change autosuspend delay of hub can avoid unnecessary auto 1729 1729 * suspend timer for hub, also may decrease power consumption 1730 1730 * of USB bus. 1731 + * 1732 + * - If user has indicated to prevent autosuspend by passing 1733 + * usbcore.autosuspend = -1 then keep autosuspend disabled. 1731 1734 */ 1732 - pm_runtime_set_autosuspend_delay(&hdev->dev, 0); 1735 + #ifdef CONFIG_PM_RUNTIME 1736 + if (hdev->dev.power.autosuspend_delay >= 0) 1737 + pm_runtime_set_autosuspend_delay(&hdev->dev, 0); 1738 + #endif 1733 1739 1734 1740 /* 1735 1741 * Hubs have proper suspend/resume support, except for root hubs ··· 2113 2107 { 2114 2108 struct usb_port *port_dev = NULL; 2115 2109 struct usb_device *udev = *pdev; 2116 - struct usb_hub *hub; 2117 - int port1; 2110 + struct usb_hub *hub = NULL; 2111 + int port1 = 1; 2118 2112 2119 2113 /* mark the device as inactive, so any further urb submissions for 2120 2114 * this device (and any of its children) will fail immediately. ··· 4637 4631 if (status != -ENODEV && 4638 4632 port1 != unreliable_port && 4639 4633 printk_ratelimit()) 4640 - dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n", 4641 - port1); 4642 - 4634 + dev_err(&port_dev->dev, "connect-debounce failed\n"); 4643 4635 portstatus &= ~USB_PORT_STAT_CONNECTION; 4644 4636 unreliable_port = port1; 4645 4637 } else {
+1 -1
drivers/usb/dwc2/gadget.c
··· 1901 1901 static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg) 1902 1902 { 1903 1903 u32 dsts = readl(hsotg->regs + DSTS); 1904 - int ep0_mps = 0, ep_mps; 1904 + int ep0_mps = 0, ep_mps = 8; 1905 1905 1906 1906 /* 1907 1907 * This should signal the finish of the enumeration phase
+1 -1
drivers/usb/dwc3/dwc3-omap.c
··· 425 425 426 426 static int dwc3_omap_extcon_register(struct dwc3_omap *omap) 427 427 { 428 - u32 ret; 428 + int ret; 429 429 struct device_node *node = omap->dev->of_node; 430 430 struct extcon_dev *edev; 431 431
+1 -1
drivers/usb/gadget/Makefile
··· 3 3 # 4 4 subdir-ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG 5 5 subdir-ccflags-$(CONFIG_USB_GADGET_VERBOSE) += -DVERBOSE_DEBUG 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc 6 + ccflags-y += -Idrivers/usb/gadget/udc 7 7 8 8 obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o 9 9 libcomposite-y := usbstring.o config.o epautoconf.o
+2 -2
drivers/usb/gadget/function/Makefile
··· 2 2 # USB peripheral controller drivers 3 3 # 4 4 5 - ccflags-y := -I$(PWD)/drivers/usb/gadget/ 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/ 5 + ccflags-y := -Idrivers/usb/gadget/ 6 + ccflags-y += -Idrivers/usb/gadget/udc/ 7 7 8 8 # USB Functions 9 9 usb_f_acm-y := f_acm.o
-3
drivers/usb/gadget/function/u_ether.c
··· 1127 1127 1128 1128 DBG(dev, "%s\n", __func__); 1129 1129 1130 - netif_tx_lock(dev->net); 1131 1130 netif_stop_queue(dev->net); 1132 - netif_tx_unlock(dev->net); 1133 - 1134 1131 netif_carrier_off(dev->net); 1135 1132 1136 1133 /* disable endpoints, forcing (synchronous) completion
+3
drivers/usb/gadget/function/uvc_video.c
··· 195 195 printk(KERN_INFO "Failed to queue request (%d).\n", ret); 196 196 usb_ep_set_halt(ep); 197 197 spin_unlock_irqrestore(&video->queue.irqlock, flags); 198 + uvc_queue_cancel(queue, 0); 198 199 goto requeue; 199 200 } 200 201 spin_unlock_irqrestore(&video->queue.irqlock, flags); ··· 282 281 static int 283 282 uvc_video_pump(struct uvc_video *video) 284 283 { 284 + struct uvc_video_queue *queue = &video->queue; 285 285 struct usb_request *req; 286 286 struct uvc_buffer *buf; 287 287 unsigned long flags; ··· 324 322 printk(KERN_INFO "Failed to queue request (%d)\n", ret); 325 323 usb_ep_set_halt(video->ep); 326 324 spin_unlock_irqrestore(&video->queue.irqlock, flags); 325 + uvc_queue_cancel(queue, 0); 327 326 break; 328 327 } 329 328 spin_unlock_irqrestore(&video->queue.irqlock, flags);
+3 -3
drivers/usb/gadget/legacy/Makefile
··· 2 2 # USB gadget drivers 3 3 # 4 4 5 - ccflags-y := -I$(PWD)/drivers/usb/gadget/ 6 - ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/ 7 - ccflags-y += -I$(PWD)/drivers/usb/gadget/function/ 5 + ccflags-y := -Idrivers/usb/gadget/ 6 + ccflags-y += -Idrivers/usb/gadget/udc/ 7 + ccflags-y += -Idrivers/usb/gadget/function/ 8 8 9 9 g_zero-y := zero.o 10 10 g_audio-y := audio.o
+2
drivers/usb/gadget/legacy/dbgp.c
··· 222 222 { 223 223 #ifdef CONFIG_USB_G_DBGP_SERIAL 224 224 kfree(dbgp.serial); 225 + dbgp.serial = NULL; 225 226 #endif 226 227 if (dbgp.req) { 227 228 kfree(dbgp.req->buf); 228 229 usb_ep_free_request(gadget->ep0, dbgp.req); 230 + dbgp.req = NULL; 229 231 } 230 232 231 233 gadget->ep0->driver_data = NULL;
+1 -1
drivers/usb/gadget/legacy/inode.c
··· 440 440 441 441 value = -ENOMEM; 442 442 kbuf = memdup_user(buf, len); 443 - if (!kbuf) { 443 + if (IS_ERR(kbuf)) { 444 444 value = PTR_ERR(kbuf); 445 445 goto free1; 446 446 }
+2 -1
drivers/usb/gadget/udc/Kconfig
··· 332 332 gadget drivers to also be dynamically linked. 333 333 334 334 config USB_EG20T 335 - tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC" 335 + tristate "Intel QUARK X1000/EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC" 336 336 depends on PCI 337 337 help 338 338 This is a USB device driver for EG20T PCH. ··· 353 353 ML7213/ML7831 is companion chip for Intel Atom E6xx series. 354 354 ML7213/ML7831 is completely compatible for Intel EG20T PCH. 355 355 356 + This driver can be used with Intel's Quark X1000 SOC platform 356 357 # 357 358 # LAST -- dummy/emulated controller 358 359 #
+1 -1
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 1661 1661 if (dma_status) { 1662 1662 int i; 1663 1663 1664 - for (i = 1; i < USBA_NR_DMAS; i++) 1664 + for (i = 1; i <= USBA_NR_DMAS; i++) 1665 1665 if (dma_status & (1 << i)) 1666 1666 usba_dma_irq(udc, &udc->usba_ep[i]); 1667 1667 }
+6 -2
drivers/usb/gadget/udc/fusb300_udc.c
··· 1398 1398 1399 1399 /* initialize udc */ 1400 1400 fusb300 = kzalloc(sizeof(struct fusb300), GFP_KERNEL); 1401 - if (fusb300 == NULL) 1401 + if (fusb300 == NULL) { 1402 + ret = -ENOMEM; 1402 1403 goto clean_up; 1404 + } 1403 1405 1404 1406 for (i = 0; i < FUSB300_MAX_NUM_EP; i++) { 1405 1407 _ep[i] = kzalloc(sizeof(struct fusb300_ep), GFP_KERNEL); 1406 - if (_ep[i] == NULL) 1408 + if (_ep[i] == NULL) { 1409 + ret = -ENOMEM; 1407 1410 goto clean_up; 1411 + } 1408 1412 fusb300->ep[i] = _ep[i]; 1409 1413 } 1410 1414
+19 -3
drivers/usb/gadget/udc/pch_udc.c
··· 343 343 * @setup_data: Received setup data 344 344 * @phys_addr: of device memory 345 345 * @base_addr: for mapped device memory 346 + * @bar: Indicates which PCI BAR for USB regs 346 347 * @irq: IRQ line for the device 347 348 * @cfg_data: current cfg, intf, and alt in use 348 349 * @vbus_gpio: GPIO informaton for detecting VBUS ··· 371 370 struct usb_ctrlrequest setup_data; 372 371 unsigned long phys_addr; 373 372 void __iomem *base_addr; 373 + unsigned bar; 374 374 unsigned irq; 375 375 struct pch_udc_cfg_data cfg_data; 376 376 struct pch_vbus_gpio_data vbus_gpio; 377 377 }; 378 378 #define to_pch_udc(g) (container_of((g), struct pch_udc_dev, gadget)) 379 379 380 + #define PCH_UDC_PCI_BAR_QUARK_X1000 0 380 381 #define PCH_UDC_PCI_BAR 1 381 382 #define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808 383 + #define PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC 0x0939 382 384 #define PCI_VENDOR_ID_ROHM 0x10DB 383 385 #define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D 384 386 #define PCI_DEVICE_ID_ML7831_IOH_UDC 0x8808 ··· 3080 3076 iounmap(dev->base_addr); 3081 3077 if (dev->mem_region) 3082 3078 release_mem_region(dev->phys_addr, 3083 - pci_resource_len(pdev, PCH_UDC_PCI_BAR)); 3079 + pci_resource_len(pdev, dev->bar)); 3084 3080 if (dev->active) 3085 3081 pci_disable_device(pdev); 3086 3082 kfree(dev); ··· 3148 3144 dev->active = 1; 3149 3145 pci_set_drvdata(pdev, dev); 3150 3146 3147 + /* Determine BAR based on PCI ID */ 3148 + if (id->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC) 3149 + dev->bar = PCH_UDC_PCI_BAR_QUARK_X1000; 3150 + else 3151 + dev->bar = PCH_UDC_PCI_BAR; 3152 + 3151 3153 /* PCI resource allocation */ 3152 - resource = pci_resource_start(pdev, 1); 3153 - len = pci_resource_len(pdev, 1); 3154 + resource = pci_resource_start(pdev, dev->bar); 3155 + len = pci_resource_len(pdev, dev->bar); 3154 3156 3155 3157 if (!request_mem_region(resource, len, KBUILD_MODNAME)) { 3156 3158 dev_err(&pdev->dev, "%s: pci device used already\n", __func__); ··· 3221 3211 } 3222 3212 3223 3213 static const struct pci_device_id pch_udc_pcidev_id[] = { 3214 + { 3215 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 3216 + PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC), 3217 + .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe, 3218 + .class_mask = 0xffffffff, 3219 + }, 3224 3220 { 3225 3221 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC), 3226 3222 .class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
+2 -2
drivers/usb/gadget/udc/r8a66597-udc.c
··· 1868 1868 1869 1869 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1870 1870 reg = devm_ioremap_resource(&pdev->dev, res); 1871 - if (!reg) 1872 - return -ENODEV; 1871 + if (IS_ERR(reg)) 1872 + return PTR_ERR(reg); 1873 1873 1874 1874 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1875 1875 irq = ires->start;
+1 -1
drivers/usb/host/ehci-hub.c
··· 1230 1230 if (selector == EHSET_TEST_SINGLE_STEP_SET_FEATURE) { 1231 1231 spin_unlock_irqrestore(&ehci->lock, flags); 1232 1232 retval = ehset_single_step_set_feature(hcd, 1233 - wIndex); 1233 + wIndex + 1); 1234 1234 spin_lock_irqsave(&ehci->lock, flags); 1235 1235 break; 1236 1236 }
+9
drivers/usb/host/xhci-pci.c
··· 101 101 /* AMD PLL quirk */ 102 102 if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info()) 103 103 xhci->quirks |= XHCI_AMD_PLL_FIX; 104 + 105 + if (pdev->vendor == PCI_VENDOR_ID_AMD) 106 + xhci->quirks |= XHCI_TRUST_TX_LENGTH; 107 + 104 108 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { 105 109 xhci->quirks |= XHCI_LPM_SUPPORT; 106 110 xhci->quirks |= XHCI_INTEL_HOST; ··· 154 150 xhci->quirks |= XHCI_RESET_ON_RESUME; 155 151 if (pdev->vendor == PCI_VENDOR_ID_VIA) 156 152 xhci->quirks |= XHCI_RESET_ON_RESUME; 153 + 154 + /* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ 155 + if (pdev->vendor == PCI_VENDOR_ID_VIA && 156 + pdev->device == 0x3432) 157 + xhci->quirks |= XHCI_BROKEN_STREAMS; 157 158 158 159 if (xhci->quirks & XHCI_RESET_ON_RESUME) 159 160 xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
+41 -63
drivers/usb/host/xhci-ring.c
··· 364 364 } 365 365 } 366 366 367 - /* 368 - * Find the segment that trb is in. Start searching in start_seg. 369 - * If we must move past a segment that has a link TRB with a toggle cycle state 370 - * bit set, then we will toggle the value pointed at by cycle_state. 371 - */ 372 - static struct xhci_segment *find_trb_seg( 373 - struct xhci_segment *start_seg, 374 - union xhci_trb *trb, int *cycle_state) 375 - { 376 - struct xhci_segment *cur_seg = start_seg; 377 - struct xhci_generic_trb *generic_trb; 378 - 379 - while (cur_seg->trbs > trb || 380 - &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) { 381 - generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic; 382 - if (generic_trb->field[3] & cpu_to_le32(LINK_TOGGLE)) 383 - *cycle_state ^= 0x1; 384 - cur_seg = cur_seg->next; 385 - if (cur_seg == start_seg) 386 - /* Looped over the entire list. Oops! */ 387 - return NULL; 388 - } 389 - return cur_seg; 390 - } 391 - 392 - 393 367 static struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci, 394 368 unsigned int slot_id, unsigned int ep_index, 395 369 unsigned int stream_id) ··· 433 459 struct xhci_virt_device *dev = xhci->devs[slot_id]; 434 460 struct xhci_virt_ep *ep = &dev->eps[ep_index]; 435 461 struct xhci_ring *ep_ring; 436 - struct xhci_generic_trb *trb; 462 + struct xhci_segment *new_seg; 463 + union xhci_trb *new_deq; 437 464 dma_addr_t addr; 438 465 u64 hw_dequeue; 466 + bool cycle_found = false; 467 + bool td_last_trb_found = false; 439 468 440 469 ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id, 441 470 ep_index, stream_id); ··· 463 486 hw_dequeue = le64_to_cpu(ep_ctx->deq); 464 487 } 465 488 466 - /* Find virtual address and segment of hardware dequeue pointer */ 467 - state->new_deq_seg = ep_ring->deq_seg; 468 - state->new_deq_ptr = ep_ring->dequeue; 469 - while (xhci_trb_virt_to_dma(state->new_deq_seg, state->new_deq_ptr) 470 - != (dma_addr_t)(hw_dequeue & ~0xf)) { 471 - next_trb(xhci, ep_ring, &state->new_deq_seg, 472 - &state->new_deq_ptr); 473 - if (state->new_deq_ptr == ep_ring->dequeue) { 474 - WARN_ON(1); 489 + new_seg = ep_ring->deq_seg; 490 + new_deq = ep_ring->dequeue; 491 + state->new_cycle_state = hw_dequeue & 0x1; 492 + 493 + /* 494 + * We want to find the pointer, segment and cycle state of the new trb 495 + * (the one after current TD's last_trb). We know the cycle state at 496 + * hw_dequeue, so walk the ring until both hw_dequeue and last_trb are 497 + * found. 498 + */ 499 + do { 500 + if (!cycle_found && xhci_trb_virt_to_dma(new_seg, new_deq) 501 + == (dma_addr_t)(hw_dequeue & ~0xf)) { 502 + cycle_found = true; 503 + if (td_last_trb_found) 504 + break; 505 + } 506 + if (new_deq == cur_td->last_trb) 507 + td_last_trb_found = true; 508 + 509 + if (cycle_found && 510 + TRB_TYPE_LINK_LE32(new_deq->generic.field[3]) && 511 + new_deq->generic.field[3] & cpu_to_le32(LINK_TOGGLE)) 512 + state->new_cycle_state ^= 0x1; 513 + 514 + next_trb(xhci, ep_ring, &new_seg, &new_deq); 515 + 516 + /* Search wrapped around, bail out */ 517 + if (new_deq == ep->ring->dequeue) { 518 + xhci_err(xhci, "Error: Failed finding new dequeue state\n"); 519 + state->new_deq_seg = NULL; 520 + state->new_deq_ptr = NULL; 475 521 return; 476 522 } 477 - } 478 - /* 479 - * Find cycle state for last_trb, starting at old cycle state of 480 - * hw_dequeue. If there is only one segment ring, find_trb_seg() will 481 - * return immediately and cannot toggle the cycle state if this search 482 - * wraps around, so add one more toggle manually in that case. 483 - */ 484 - state->new_cycle_state = hw_dequeue & 0x1; 485 - if (ep_ring->first_seg == ep_ring->first_seg->next && 486 - cur_td->last_trb < state->new_deq_ptr) 487 - state->new_cycle_state ^= 0x1; 488 523 489 - state->new_deq_ptr = cur_td->last_trb; 490 - xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 491 - "Finding segment containing last TRB in TD."); 492 - state->new_deq_seg = find_trb_seg(state->new_deq_seg, 493 - state->new_deq_ptr, &state->new_cycle_state); 494 - if (!state->new_deq_seg) { 495 - WARN_ON(1); 496 - return; 497 - } 524 + } while (!cycle_found || !td_last_trb_found); 498 525 499 - /* Increment to find next TRB after last_trb. Cycle if appropriate. */ 500 - trb = &state->new_deq_ptr->generic; 501 - if (TRB_TYPE_LINK_LE32(trb->field[3]) && 502 - (trb->field[3] & cpu_to_le32(LINK_TOGGLE))) 503 - state->new_cycle_state ^= 0x1; 504 - next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr); 526 + state->new_deq_seg = new_seg; 527 + state->new_deq_ptr = new_deq; 505 528 506 529 /* Don't update the ring cycle state for the producer (us). */ 507 530 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, ··· 2464 2487 * last TRB of the previous TD. The command completion handle 2465 2488 * will take care the rest. 2466 2489 */ 2467 - if (!event_seg && trb_comp_code == COMP_STOP_INVAL) { 2490 + if (!event_seg && (trb_comp_code == COMP_STOP || 2491 + trb_comp_code == COMP_STOP_INVAL)) { 2468 2492 ret = 0; 2469 2493 goto cleanup; 2470 2494 }
+3
drivers/usb/host/xhci.c
··· 2880 2880 ep_index, ep->stopped_stream, ep->stopped_td, 2881 2881 &deq_state); 2882 2882 2883 + if (!deq_state.new_deq_ptr || !deq_state.new_deq_seg) 2884 + return; 2885 + 2883 2886 /* HW with the reset endpoint quirk will use the saved dequeue state to 2884 2887 * issue a configure endpoint command later. 2885 2888 */
+1
drivers/usb/misc/sisusbvga/sisusb.c
··· 3250 3250 { USB_DEVICE(0x0711, 0x0918) }, 3251 3251 { USB_DEVICE(0x0711, 0x0920) }, 3252 3252 { USB_DEVICE(0x0711, 0x0950) }, 3253 + { USB_DEVICE(0x0711, 0x5200) }, 3253 3254 { USB_DEVICE(0x182d, 0x021c) }, 3254 3255 { USB_DEVICE(0x182d, 0x0269) }, 3255 3256 { }
+1 -1
drivers/usb/musb/ux500_dma.c
··· 96 96 struct musb *musb = ux500_channel->controller->private_data; 97 97 98 98 dev_dbg(musb->controller, 99 - "packet_sz=%d, mode=%d, dma_addr=0x%llu, len=%d is_tx=%d\n", 99 + "packet_sz=%d, mode=%d, dma_addr=0x%llx, len=%d is_tx=%d\n", 100 100 packet_sz, mode, (unsigned long long) dma_addr, 101 101 len, ux500_channel->is_tx); 102 102
+1 -3
drivers/usb/phy/phy-gpio-vbus-usb.c
··· 260 260 261 261 gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), 262 262 GFP_KERNEL); 263 - if (!gpio_vbus->phy.otg) { 264 - kfree(gpio_vbus); 263 + if (!gpio_vbus->phy.otg) 265 264 return -ENOMEM; 266 - } 267 265 268 266 platform_set_drvdata(pdev, gpio_vbus); 269 267 gpio_vbus->dev = &pdev->dev;
+2 -2
drivers/usb/phy/phy-msm-usb.c
··· 1601 1601 */ 1602 1602 if (motg->phy_number) { 1603 1603 phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4); 1604 - if (IS_ERR(phy_select)) 1605 - return PTR_ERR(phy_select); 1604 + if (!phy_select) 1605 + return -ENOMEM; 1606 1606 /* Enable second PHY with the OTG port */ 1607 1607 writel(0x1, phy_select); 1608 1608 }
+1 -1
drivers/usb/phy/phy-samsung-usb.h
··· 216 216 217 217 #define EXYNOS5_DRD_PHYPARAM1 (0x20) 218 218 219 - #define PHYPARAM1_PCS_TXDEEMPH_MASK (0x1f << 0) 219 + #define PHYPARAM1_PCS_TXDEEMPH_MASK (0x3f << 0) 220 220 #define PHYPARAM1_PCS_TXDEEMPH (0x1c) 221 221 222 222 #define EXYNOS5_DRD_PHYTERM (0x24)
+3
drivers/usb/phy/phy.c
··· 232 232 phy = __usb_find_phy_dev(dev, &phy_bind_list, index); 233 233 if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) { 234 234 dev_dbg(dev, "unable to find transceiver\n"); 235 + if (!IS_ERR(phy)) 236 + phy = ERR_PTR(-ENODEV); 237 + 235 238 goto err0; 236 239 } 237 240
+3
drivers/usb/serial/ftdi_sio.c
··· 146 146 { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, 147 147 { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, 148 148 { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, 149 + { USB_DEVICE(FTDI_VID, FTDI_BM_ATOM_NANO_PID) }, 149 150 { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) }, 150 151 { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) }, 151 152 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, ··· 935 934 { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_2_PID) }, 936 935 { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_3_PID) }, 937 936 { USB_DEVICE(BRAINBOXES_VID, BRAINBOXES_US_842_4_PID) }, 937 + /* ekey Devices */ 938 + { USB_DEVICE(FTDI_VID, FTDI_EKEY_CONV_USB_PID) }, 938 939 /* Infineon Devices */ 939 940 { USB_DEVICE_INTERFACE_NUMBER(INFINEON_VID, INFINEON_TRIBOARD_PID, 1) }, 940 941 { } /* Terminating entry */
+7
drivers/usb/serial/ftdi_sio_ids.h
··· 42 42 /* www.candapter.com Ewert Energy Systems CANdapter device */ 43 43 #define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */ 44 44 45 + #define FTDI_BM_ATOM_NANO_PID 0xa559 /* Basic Micro ATOM Nano USB2Serial */ 46 + 45 47 /* 46 48 * Texas Instruments XDS100v2 JTAG / BeagleBone A3 47 49 * http://processors.wiki.ti.com/index.php/XDS100 ··· 1380 1378 #define BRAINBOXES_US_160_6_PID 0x9006 /* US-160 16xRS232 1Mbaud Port 11 and 12 */ 1381 1379 #define BRAINBOXES_US_160_7_PID 0x9007 /* US-160 16xRS232 1Mbaud Port 13 and 14 */ 1382 1380 #define BRAINBOXES_US_160_8_PID 0x9008 /* US-160 16xRS232 1Mbaud Port 15 and 16 */ 1381 + 1382 + /* 1383 + * ekey biometric systems GmbH (http://ekey.net/) 1384 + */ 1385 + #define FTDI_EKEY_CONV_USB_PID 0xCB08 /* Converter USB */
+28 -3
drivers/usb/serial/option.c
··· 275 275 #define ZTE_PRODUCT_MF622 0x0001 276 276 #define ZTE_PRODUCT_MF628 0x0015 277 277 #define ZTE_PRODUCT_MF626 0x0031 278 - #define ZTE_PRODUCT_MC2718 0xffe8 279 278 #define ZTE_PRODUCT_AC2726 0xfff1 279 + #define ZTE_PRODUCT_CDMA_TECH 0xfffe 280 + #define ZTE_PRODUCT_AC8710T 0xffff 281 + #define ZTE_PRODUCT_MC2718 0xffe8 282 + #define ZTE_PRODUCT_AD3812 0xffeb 283 + #define ZTE_PRODUCT_MC2716 0xffed 280 284 281 285 #define BENQ_VENDOR_ID 0x04a5 282 286 #define BENQ_PRODUCT_H10 0x4068 ··· 498 494 #define INOVIA_VENDOR_ID 0x20a6 499 495 #define INOVIA_SEW858 0x1105 500 496 497 + /* VIA Telecom */ 498 + #define VIATELECOM_VENDOR_ID 0x15eb 499 + #define VIATELECOM_PRODUCT_CDS7 0x0001 500 + 501 501 /* some devices interfaces need special handling due to a number of reasons */ 502 502 enum option_blacklist_reason { 503 503 OPTION_BLACKLIST_NONE = 0, ··· 535 527 .reserved = BIT(4), 536 528 }; 537 529 530 + static const struct option_blacklist_info zte_ad3812_z_blacklist = { 531 + .sendsetup = BIT(0) | BIT(1) | BIT(2), 532 + }; 533 + 538 534 static const struct option_blacklist_info zte_mc2718_z_blacklist = { 539 535 .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), 536 + }; 537 + 538 + static const struct option_blacklist_info zte_mc2716_z_blacklist = { 539 + .sendsetup = BIT(1) | BIT(2) | BIT(3), 540 540 }; 541 541 542 542 static const struct option_blacklist_info huawei_cdc12_blacklist = { ··· 1086 1070 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, 1087 1071 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, 1088 1072 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, 1073 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ 1089 1074 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 1090 1075 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ 1091 1076 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ ··· 1561 1544 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 0xff) }, 1562 1545 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 0xff) }, 1563 1546 1564 - /* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */ 1547 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, 1548 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, 1549 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, 1565 1550 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), 1566 1551 .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, 1552 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff), 1553 + .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, 1554 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), 1555 + .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, 1567 1556 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, 1568 1557 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, 1569 1558 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, 1570 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, 1571 1559 1572 1560 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 1573 1561 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, ··· 1746 1724 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ 1747 1725 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ 1748 1726 { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) }, 1727 + { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) }, 1749 1728 { } /* Terminating entry */ 1750 1729 }; 1751 1730 MODULE_DEVICE_TABLE(usb, option_ids); ··· 1939 1916 dev_dbg(dev, "%s: type %x req %x\n", __func__, 1940 1917 req_pkt->bRequestType, req_pkt->bRequest); 1941 1918 } 1919 + } else if (status == -ENOENT || status == -ESHUTDOWN) { 1920 + dev_dbg(dev, "%s: urb stopped: %d\n", __func__, status); 1942 1921 } else 1943 1922 dev_err(dev, "%s: error %d\n", __func__, status); 1944 1923
+1
drivers/usb/serial/pl2303.c
··· 45 45 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) }, 46 46 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) }, 47 47 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) }, 48 + { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ZTEK) }, 48 49 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, 49 50 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, 50 51 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
+1
drivers/usb/serial/pl2303.h
··· 22 22 #define PL2303_PRODUCT_ID_GPRS 0x0609 23 23 #define PL2303_PRODUCT_ID_HCR331 0x331a 24 24 #define PL2303_PRODUCT_ID_MOTOROLA 0x0307 25 + #define PL2303_PRODUCT_ID_ZTEK 0xe1f1 25 26 26 27 #define ATEN_VENDOR_ID 0x0557 27 28 #define ATEN_VENDOR_ID2 0x0547
+27 -10
drivers/usb/serial/usb-serial.c
··· 764 764 if (usb_endpoint_is_bulk_in(endpoint)) { 765 765 /* we found a bulk in endpoint */ 766 766 dev_dbg(ddev, "found bulk in on endpoint %d\n", i); 767 - bulk_in_endpoint[num_bulk_in] = endpoint; 768 - ++num_bulk_in; 767 + if (num_bulk_in < MAX_NUM_PORTS) { 768 + bulk_in_endpoint[num_bulk_in] = endpoint; 769 + ++num_bulk_in; 770 + } 769 771 } 770 772 771 773 if (usb_endpoint_is_bulk_out(endpoint)) { 772 774 /* we found a bulk out endpoint */ 773 775 dev_dbg(ddev, "found bulk out on endpoint %d\n", i); 774 - bulk_out_endpoint[num_bulk_out] = endpoint; 775 - ++num_bulk_out; 776 + if (num_bulk_out < MAX_NUM_PORTS) { 777 + bulk_out_endpoint[num_bulk_out] = endpoint; 778 + ++num_bulk_out; 779 + } 776 780 } 777 781 778 782 if (usb_endpoint_is_int_in(endpoint)) { 779 783 /* we found a interrupt in endpoint */ 780 784 dev_dbg(ddev, "found interrupt in on endpoint %d\n", i); 781 - interrupt_in_endpoint[num_interrupt_in] = endpoint; 782 - ++num_interrupt_in; 785 + if (num_interrupt_in < MAX_NUM_PORTS) { 786 + interrupt_in_endpoint[num_interrupt_in] = 787 + endpoint; 788 + ++num_interrupt_in; 789 + } 783 790 } 784 791 785 792 if (usb_endpoint_is_int_out(endpoint)) { 786 793 /* we found an interrupt out endpoint */ 787 794 dev_dbg(ddev, "found interrupt out on endpoint %d\n", i); 788 - interrupt_out_endpoint[num_interrupt_out] = endpoint; 789 - ++num_interrupt_out; 795 + if (num_interrupt_out < MAX_NUM_PORTS) { 796 + interrupt_out_endpoint[num_interrupt_out] = 797 + endpoint; 798 + ++num_interrupt_out; 799 + } 790 800 } 791 801 } 792 802 ··· 819 809 if (usb_endpoint_is_int_in(endpoint)) { 820 810 /* we found a interrupt in endpoint */ 821 811 dev_dbg(ddev, "found interrupt in for Prolific device on separate interface\n"); 822 - interrupt_in_endpoint[num_interrupt_in] = endpoint; 823 - ++num_interrupt_in; 812 + if (num_interrupt_in < MAX_NUM_PORTS) { 813 + interrupt_in_endpoint[num_interrupt_in] = endpoint; 814 + ++num_interrupt_in; 815 + } 824 816 } 825 817 } 826 818 } ··· 860 848 num_ports = type->calc_num_ports(serial); 861 849 if (!num_ports) 862 850 num_ports = type->num_ports; 851 + } 852 + 853 + if (num_ports > MAX_NUM_PORTS) { 854 + dev_warn(ddev, "too many ports requested: %d\n", num_ports); 855 + num_ports = MAX_NUM_PORTS; 863 856 } 864 857 865 858 serial->num_ports = num_ports;
+6 -1
drivers/usb/serial/whiteheat.c
··· 514 514 dev_dbg(&urb->dev->dev, "%s - command_info is NULL, exiting.\n", __func__); 515 515 return; 516 516 } 517 + if (!urb->actual_length) { 518 + dev_dbg(&urb->dev->dev, "%s - empty response, exiting.\n", __func__); 519 + return; 520 + } 517 521 if (status) { 518 522 dev_dbg(&urb->dev->dev, "%s - nonzero urb status: %d\n", __func__, status); 519 523 if (status != -ENOENT) ··· 538 534 /* These are unsolicited reports from the firmware, hence no 539 535 waiting command to wakeup */ 540 536 dev_dbg(&urb->dev->dev, "%s - event received\n", __func__); 541 - } else if (data[0] == WHITEHEAT_GET_DTR_RTS) { 537 + } else if ((data[0] == WHITEHEAT_GET_DTR_RTS) && 538 + (urb->actual_length - 1 <= sizeof(command_info->result_buffer))) { 542 539 memcpy(command_info->result_buffer, &data[1], 543 540 urb->actual_length - 1); 544 541 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
-20
drivers/usb/serial/zte_ev.c
··· 272 272 } 273 273 274 274 static const struct usb_device_id id_table[] = { 275 - /* AC8710, AC8710T */ 276 - { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffff, 0xff, 0xff, 0xff) }, 277 - /* AC8700 */ 278 - { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfffe, 0xff, 0xff, 0xff) }, 279 275 /* MG880 */ 280 276 { USB_DEVICE(0x19d2, 0xfffd) }, 281 - { USB_DEVICE(0x19d2, 0xfffc) }, 282 - { USB_DEVICE(0x19d2, 0xfffb) }, 283 - /* AC8710_V3 */ 284 - { USB_DEVICE(0x19d2, 0xfff6) }, 285 - { USB_DEVICE(0x19d2, 0xfff7) }, 286 - { USB_DEVICE(0x19d2, 0xfff8) }, 287 - { USB_DEVICE(0x19d2, 0xfff9) }, 288 - { USB_DEVICE(0x19d2, 0xffee) }, 289 - /* AC2716, MC2716 */ 290 - { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffed, 0xff, 0xff, 0xff) }, 291 - /* AD3812 */ 292 - { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffeb, 0xff, 0xff, 0xff) }, 293 - { USB_DEVICE(0x19d2, 0xffec) }, 294 - { USB_DEVICE(0x05C6, 0x3197) }, 295 - { USB_DEVICE(0x05C6, 0x6000) }, 296 - { USB_DEVICE(0x05C6, 0x9008) }, 297 277 { }, 298 278 }; 299 279 MODULE_DEVICE_TABLE(usb, id_table);
+6
drivers/usb/storage/unusual_devs.h
··· 922 922 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 923 923 US_FL_FIX_CAPACITY ), 924 924 925 + UNUSUAL_DEV( 0x06ca, 0x2003, 0x0100, 0x0100, 926 + "Newer Technology", 927 + "uSCSI", 928 + USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_euscsi_init, 929 + US_FL_SCM_MULT_TARG ), 930 + 925 931 /* Reported by Adrian Pilchowiec <adi1981@epf.pl> */ 926 932 UNUSUAL_DEV( 0x071b, 0x3203, 0x0000, 0x0000, 927 933 "RockChip",
+1 -2
drivers/usb/wusbcore/wa-xfer.c
··· 2602 2602 dev = &wa->usb_iface->dev; 2603 2603 --(wa->active_buf_in_urbs); 2604 2604 active_buf_in_urbs = wa->active_buf_in_urbs; 2605 + rpipe = xfer->ep->hcpriv; 2605 2606 2606 2607 if (usb_pipeisoc(xfer->urb->pipe)) { 2607 2608 struct usb_iso_packet_descriptor *iso_frame_desc = ··· 2660 2659 resubmit_dti = (isoc_data_frame_count == 2661 2660 urb_frame_count); 2662 2661 } else if (active_buf_in_urbs == 0) { 2663 - rpipe = xfer->ep->hcpriv; 2664 2662 dev_dbg(dev, 2665 2663 "xfer %p 0x%08X#%u: data in done (%zu bytes)\n", 2666 2664 xfer, wa_xfer_id(xfer), seg->index, ··· 2685 2685 */ 2686 2686 resubmit_dti = wa->dti_state != WA_DTI_TRANSFER_RESULT_PENDING; 2687 2687 spin_lock_irqsave(&xfer->lock, flags); 2688 - rpipe = xfer->ep->hcpriv; 2689 2688 if (printk_ratelimit()) 2690 2689 dev_err(dev, "xfer %p 0x%08X#%u: data in error %d\n", 2691 2690 xfer, wa_xfer_id(xfer), seg->index,