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-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some USB fixes and new device ids for 4.6-rc3.

Nothing major, the normal USB gadget fixes and usb-serial driver ids,
along with some other fixes mixed in. All except the USB serial ids
have been tested in linux-next, the id additions should be fine as
they are 'trivial'"

* tag 'usb-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (25 commits)
USB: option: add "D-Link DWM-221 B1" device id
USB: serial: cp210x: Adding GE Healthcare Device ID
USB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices
usb: dwc3: keystone: drop dma_mask configuration
usb: gadget: udc-core: remove manual dma configuration
usb: dwc3: pci: add ID for one more Intel Broxton platform
usb: renesas_usbhs: fix to avoid using a disabled ep in usbhsg_queue_done()
usb: dwc2: do not override forced dr_mode in gadget setup
usb: gadget: f_midi: unlock on error
USB: digi_acceleport: do sanity checking for the number of ports
USB: cypress_m8: add endpoint sanity check
USB: mct_u232: add sanity checking in probe
usb: fix regression in SuperSpeed endpoint descriptor parsing
USB: usbip: fix potential out-of-bounds write
usb: renesas_usbhs: disable TX IRQ before starting TX DMAC transfer
usb: renesas_usbhs: avoid NULL pointer derefernce in usbhsf_pkt_handler()
usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize
usb: phy: qcom-8x16: fix regulator API abuse
usb: ch9: Fix SSP Device Cap wFunctionalitySupport type
usb: gadget: composite: Access SSP Dev Cap fields properly
...

+151 -148
+7 -9
drivers/usb/core/config.c
··· 75 75 * be the first thing immediately following the endpoint descriptor. 76 76 */ 77 77 desc = (struct usb_ss_ep_comp_descriptor *) buffer; 78 - buffer += desc->bLength; 79 - size -= desc->bLength; 80 78 81 79 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP || 82 80 size < USB_DT_SS_EP_COMP_SIZE) { ··· 98 100 ep->desc.wMaxPacketSize; 99 101 return; 100 102 } 101 - 103 + buffer += desc->bLength; 104 + size -= desc->bLength; 102 105 memcpy(&ep->ss_ep_comp, desc, USB_DT_SS_EP_COMP_SIZE); 103 106 104 107 /* Check the various values */ ··· 145 146 ep->ss_ep_comp.bmAttributes = 2; 146 147 } 147 148 148 - /* Parse a possible SuperSpeedPlus isoc ep companion descriptor */ 149 - if (usb_endpoint_xfer_isoc(&ep->desc) && 150 - USB_SS_SSP_ISOC_COMP(desc->bmAttributes)) 151 - usb_parse_ssp_isoc_endpoint_companion(ddev, cfgno, inum, asnum, 152 - ep, buffer, size); 153 - 154 149 if (usb_endpoint_xfer_isoc(&ep->desc)) 155 150 max_tx = (desc->bMaxBurst + 1) * 156 151 (USB_SS_MULT(desc->bmAttributes)) * ··· 164 171 max_tx); 165 172 ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx); 166 173 } 174 + /* Parse a possible SuperSpeedPlus isoc ep companion descriptor */ 175 + if (usb_endpoint_xfer_isoc(&ep->desc) && 176 + USB_SS_SSP_ISOC_COMP(desc->bmAttributes)) 177 + usb_parse_ssp_isoc_endpoint_companion(ddev, cfgno, inum, asnum, 178 + ep, buffer, size); 167 179 } 168 180 169 181 static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
+18 -5
drivers/usb/dwc2/gadget.c
··· 2254 2254 { 2255 2255 u32 intmsk; 2256 2256 u32 val; 2257 + u32 usbcfg; 2257 2258 2258 2259 /* Kill any ep0 requests as controller will be reinitialized */ 2259 2260 kill_all_requests(hsotg, hsotg->eps_out[0], -ECONNRESET); ··· 2268 2267 * set configuration. 2269 2268 */ 2270 2269 2270 + /* keep other bits untouched (so e.g. forced modes are not lost) */ 2271 + usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); 2272 + usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | 2273 + GUSBCFG_HNPCAP); 2274 + 2271 2275 /* set the PLL on, remove the HNP/SRP and set the PHY */ 2272 2276 val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; 2273 - dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | 2274 - (val << GUSBCFG_USBTRDTIM_SHIFT), hsotg->regs + GUSBCFG); 2277 + usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) | 2278 + (val << GUSBCFG_USBTRDTIM_SHIFT); 2279 + dwc2_writel(usbcfg, hsotg->regs + GUSBCFG); 2275 2280 2276 2281 dwc2_hsotg_init_fifo(hsotg); 2277 2282 ··· 3038 3031 static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg) 3039 3032 { 3040 3033 u32 trdtim; 3034 + u32 usbcfg; 3041 3035 /* unmask subset of endpoint interrupts */ 3042 3036 3043 3037 dwc2_writel(DIEPMSK_TIMEOUTMSK | DIEPMSK_AHBERRMSK | ··· 3062 3054 3063 3055 dwc2_hsotg_init_fifo(hsotg); 3064 3056 3057 + /* keep other bits untouched (so e.g. forced modes are not lost) */ 3058 + usbcfg = dwc2_readl(hsotg->regs + GUSBCFG); 3059 + usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP | 3060 + GUSBCFG_HNPCAP); 3061 + 3065 3062 /* set the PLL on, remove the HNP/SRP and set the PHY */ 3066 3063 trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5; 3067 - dwc2_writel(hsotg->phyif | GUSBCFG_TOUTCAL(7) | 3068 - (trdtim << GUSBCFG_USBTRDTIM_SHIFT), 3069 - hsotg->regs + GUSBCFG); 3064 + usbcfg |= hsotg->phyif | GUSBCFG_TOUTCAL(7) | 3065 + (trdtim << GUSBCFG_USBTRDTIM_SHIFT); 3066 + dwc2_writel(usbcfg, hsotg->regs + GUSBCFG); 3070 3067 3071 3068 if (using_dma(hsotg)) 3072 3069 __orr32(hsotg->regs + GAHBCFG, GAHBCFG_DMA_EN);
+18 -30
drivers/usb/dwc3/core.c
··· 67 67 static int dwc3_core_soft_reset(struct dwc3 *dwc) 68 68 { 69 69 u32 reg; 70 + int retries = 1000; 70 71 int ret; 71 - 72 - /* Before Resetting PHY, put Core in Reset */ 73 - reg = dwc3_readl(dwc->regs, DWC3_GCTL); 74 - reg |= DWC3_GCTL_CORESOFTRESET; 75 - dwc3_writel(dwc->regs, DWC3_GCTL, reg); 76 - 77 - /* Assert USB3 PHY reset */ 78 - reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); 79 - reg |= DWC3_GUSB3PIPECTL_PHYSOFTRST; 80 - dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); 81 - 82 - /* Assert USB2 PHY reset */ 83 - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); 84 - reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST; 85 - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); 86 72 87 73 usb_phy_init(dwc->usb2_phy); 88 74 usb_phy_init(dwc->usb3_phy); ··· 81 95 phy_exit(dwc->usb2_generic_phy); 82 96 return ret; 83 97 } 84 - mdelay(100); 85 98 86 - /* Clear USB3 PHY reset */ 87 - reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0)); 88 - reg &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST; 89 - dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); 99 + /* 100 + * We're resetting only the device side because, if we're in host mode, 101 + * XHCI driver will reset the host block. If dwc3 was configured for 102 + * host-only mode, then we can return early. 103 + */ 104 + if (dwc->dr_mode == USB_DR_MODE_HOST) 105 + return 0; 90 106 91 - /* Clear USB2 PHY reset */ 92 - reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0)); 93 - reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST; 94 - dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); 107 + reg = dwc3_readl(dwc->regs, DWC3_DCTL); 108 + reg |= DWC3_DCTL_CSFTRST; 109 + dwc3_writel(dwc->regs, DWC3_DCTL, reg); 95 110 96 - mdelay(100); 111 + do { 112 + reg = dwc3_readl(dwc->regs, DWC3_DCTL); 113 + if (!(reg & DWC3_DCTL_CSFTRST)) 114 + return 0; 97 115 98 - /* After PHYs are stable we can take Core out of reset state */ 99 - reg = dwc3_readl(dwc->regs, DWC3_GCTL); 100 - reg &= ~DWC3_GCTL_CORESOFTRESET; 101 - dwc3_writel(dwc->regs, DWC3_GCTL, reg); 116 + udelay(1); 117 + } while (--retries); 102 118 103 - return 0; 119 + return -ETIMEDOUT; 104 120 } 105 121 106 122 /**
-5
drivers/usb/dwc3/dwc3-keystone.c
··· 39 39 #define USBSS_IRQ_COREIRQ_EN BIT(0) 40 40 #define USBSS_IRQ_COREIRQ_CLR BIT(0) 41 41 42 - static u64 kdwc3_dma_mask; 43 - 44 42 struct dwc3_keystone { 45 43 struct device *dev; 46 44 struct clk *clk; ··· 105 107 kdwc->usbss = devm_ioremap_resource(dev, res); 106 108 if (IS_ERR(kdwc->usbss)) 107 109 return PTR_ERR(kdwc->usbss); 108 - 109 - kdwc3_dma_mask = dma_get_mask(dev); 110 - dev->dma_mask = &kdwc3_dma_mask; 111 110 112 111 kdwc->clk = devm_clk_get(kdwc->dev, "usb"); 113 112
+2
drivers/usb/dwc3/dwc3-pci.c
··· 35 35 #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 36 36 #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 37 37 #define PCI_DEVICE_ID_INTEL_BXT 0x0aaa 38 + #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa 38 39 #define PCI_DEVICE_ID_INTEL_APL 0x5aaa 39 40 40 41 static const struct acpi_gpio_params reset_gpios = { 0, 0, false }; ··· 214 213 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTLP), }, 215 214 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SPTH), }, 216 215 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT), }, 216 + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BXT_M), }, 217 217 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_APL), }, 218 218 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), }, 219 219 { } /* Terminating Entry */
+8 -3
drivers/usb/dwc3/gadget.c
··· 568 568 dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); 569 569 570 570 if (!usb_endpoint_xfer_isoc(desc)) 571 - return 0; 571 + goto out; 572 572 573 573 /* Link TRB for ISOC. The HWO bit is never reset */ 574 574 trb_st_hw = &dep->trb_pool[0]; ··· 582 582 trb_link->ctrl |= DWC3_TRB_CTRL_HWO; 583 583 } 584 584 585 + out: 585 586 switch (usb_endpoint_type(desc)) { 586 587 case USB_ENDPOINT_XFER_CONTROL: 587 - strlcat(dep->name, "-control", sizeof(dep->name)); 588 + /* don't change name */ 588 589 break; 589 590 case USB_ENDPOINT_XFER_ISOC: 590 591 strlcat(dep->name, "-isoc", sizeof(dep->name)); ··· 2488 2487 * implemented. 2489 2488 */ 2490 2489 2491 - dwc->gadget_driver->resume(&dwc->gadget); 2490 + if (dwc->gadget_driver && dwc->gadget_driver->resume) { 2491 + spin_unlock(&dwc->lock); 2492 + dwc->gadget_driver->resume(&dwc->gadget); 2493 + spin_lock(&dwc->lock); 2494 + } 2492 2495 } 2493 2496 2494 2497 static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
+5 -3
drivers/usb/gadget/composite.c
··· 656 656 ssp_cap->bmAttributes = cpu_to_le32(1); 657 657 658 658 /* Min RX/TX Lane Count = 1 */ 659 - ssp_cap->wFunctionalitySupport = (1 << 8) | (1 << 12); 659 + ssp_cap->wFunctionalitySupport = 660 + cpu_to_le16((1 << 8) | (1 << 12)); 660 661 661 662 /* 662 663 * bmSublinkSpeedAttr[0]: ··· 667 666 * LSM = 10 (10 Gbps) 668 667 */ 669 668 ssp_cap->bmSublinkSpeedAttr[0] = 670 - (3 << 4) | (1 << 14) | (0xa << 16); 669 + cpu_to_le32((3 << 4) | (1 << 14) | (0xa << 16)); 671 670 /* 672 671 * bmSublinkSpeedAttr[1] = 673 672 * ST = Symmetric, TX ··· 676 675 * LSM = 10 (10 Gbps) 677 676 */ 678 677 ssp_cap->bmSublinkSpeedAttr[1] = 679 - (3 << 4) | (1 << 14) | (0xa << 16) | (1 << 7); 678 + cpu_to_le32((3 << 4) | (1 << 14) | 679 + (0xa << 16) | (1 << 7)); 680 680 } 681 681 682 682 return le16_to_cpu(bos->wTotalLength);
+15 -2
drivers/usb/gadget/function/f_midi.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/device.h> 26 26 #include <linux/kfifo.h> 27 + #include <linux/spinlock.h> 27 28 28 29 #include <sound/core.h> 29 30 #include <sound/initval.h> ··· 90 89 unsigned int buflen, qlen; 91 90 /* This fifo is used as a buffer ring for pre-allocated IN usb_requests */ 92 91 DECLARE_KFIFO_PTR(in_req_fifo, struct usb_request *); 92 + spinlock_t transmit_lock; 93 93 unsigned int in_last_port; 94 94 95 95 struct gmidi_in_port in_ports_array[/* in_ports */]; ··· 360 358 /* allocate a bunch of read buffers and queue them all at once. */ 361 359 for (i = 0; i < midi->qlen && err == 0; i++) { 362 360 struct usb_request *req = 363 - midi_alloc_ep_req(midi->out_ep, midi->buflen); 361 + midi_alloc_ep_req(midi->out_ep, 362 + max_t(unsigned, midi->buflen, 363 + bulk_out_desc.wMaxPacketSize)); 364 364 if (req == NULL) 365 365 return -ENOMEM; 366 366 ··· 601 597 { 602 598 struct usb_ep *ep = midi->in_ep; 603 599 int ret; 600 + unsigned long flags; 604 601 605 602 /* We only care about USB requests if IN endpoint is enabled */ 606 603 if (!ep || !ep->enabled) 607 604 goto drop_out; 608 605 606 + spin_lock_irqsave(&midi->transmit_lock, flags); 607 + 609 608 do { 610 609 ret = f_midi_do_transmit(midi, ep); 611 - if (ret < 0) 610 + if (ret < 0) { 611 + spin_unlock_irqrestore(&midi->transmit_lock, flags); 612 612 goto drop_out; 613 + } 613 614 } while (ret); 615 + 616 + spin_unlock_irqrestore(&midi->transmit_lock, flags); 614 617 615 618 return; 616 619 ··· 1211 1200 status = kfifo_alloc(&midi->in_req_fifo, midi->qlen, GFP_KERNEL); 1212 1201 if (status) 1213 1202 goto setup_fail; 1203 + 1204 + spin_lock_init(&midi->transmit_lock); 1214 1205 1215 1206 ++opts->refcnt; 1216 1207 mutex_unlock(&opts->lock);
-14
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 1045 1045 list_del_init(&req->queue); 1046 1046 request_complete(ep, req, -ECONNRESET); 1047 1047 } 1048 - 1049 - /* NOTE: normally, the next call to the gadget driver is in 1050 - * charge of disabling endpoints... usually disconnect(). 1051 - * The exception would be entering a high speed test mode. 1052 - * 1053 - * FIXME remove this code ... and retest thoroughly. 1054 - */ 1055 - list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { 1056 - if (ep->ep.desc) { 1057 - spin_unlock(&udc->lock); 1058 - usba_ep_disable(&ep->ep); 1059 - spin_lock(&udc->lock); 1060 - } 1061 - } 1062 1048 } 1063 1049 1064 1050 static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex)
-6
drivers/usb/gadget/udc/udc-core.c
··· 371 371 INIT_WORK(&gadget->work, usb_gadget_state_work); 372 372 gadget->dev.parent = parent; 373 373 374 - #ifdef CONFIG_HAS_DMA 375 - dma_set_coherent_mask(&gadget->dev, parent->coherent_dma_mask); 376 - gadget->dev.dma_parms = parent->dma_parms; 377 - gadget->dev.dma_mask = parent->dma_mask; 378 - #endif 379 - 380 374 if (release) 381 375 gadget->dev.release = release; 382 376 else
+11 -61
drivers/usb/phy/phy-qcom-8x16-usb.c
··· 65 65 void __iomem *regs; 66 66 struct clk *core_clk; 67 67 struct clk *iface_clk; 68 - struct regulator *v3p3; 69 - struct regulator *v1p8; 70 - struct regulator *vdd; 68 + struct regulator_bulk_data regulator[3]; 71 69 72 70 struct reset_control *phy_reset; 73 71 ··· 75 77 struct gpio_desc *switch_gpio; 76 78 struct notifier_block reboot_notify; 77 79 }; 78 - 79 - static int phy_8x16_regulators_enable(struct phy_8x16 *qphy) 80 - { 81 - int ret; 82 - 83 - ret = regulator_set_voltage(qphy->vdd, HSPHY_VDD_MIN, HSPHY_VDD_MAX); 84 - if (ret) 85 - return ret; 86 - 87 - ret = regulator_enable(qphy->vdd); 88 - if (ret) 89 - return ret; 90 - 91 - ret = regulator_set_voltage(qphy->v3p3, HSPHY_3P3_MIN, HSPHY_3P3_MAX); 92 - if (ret) 93 - goto off_vdd; 94 - 95 - ret = regulator_enable(qphy->v3p3); 96 - if (ret) 97 - goto off_vdd; 98 - 99 - ret = regulator_set_voltage(qphy->v1p8, HSPHY_1P8_MIN, HSPHY_1P8_MAX); 100 - if (ret) 101 - goto off_3p3; 102 - 103 - ret = regulator_enable(qphy->v1p8); 104 - if (ret) 105 - goto off_3p3; 106 - 107 - return 0; 108 - 109 - off_3p3: 110 - regulator_disable(qphy->v3p3); 111 - off_vdd: 112 - regulator_disable(qphy->vdd); 113 - 114 - return ret; 115 - } 116 - 117 - static void phy_8x16_regulators_disable(struct phy_8x16 *qphy) 118 - { 119 - regulator_disable(qphy->v1p8); 120 - regulator_disable(qphy->v3p3); 121 - regulator_disable(qphy->vdd); 122 - } 123 80 124 81 static int phy_8x16_notify_connect(struct usb_phy *phy, 125 82 enum usb_device_speed speed) ··· 214 261 215 262 static int phy_8x16_read_devicetree(struct phy_8x16 *qphy) 216 263 { 217 - struct regulator_bulk_data regs[3]; 218 264 struct device *dev = qphy->phy.dev; 219 265 int ret; 220 266 ··· 225 273 if (IS_ERR(qphy->iface_clk)) 226 274 return PTR_ERR(qphy->iface_clk); 227 275 228 - regs[0].supply = "v3p3"; 229 - regs[1].supply = "v1p8"; 230 - regs[2].supply = "vddcx"; 276 + qphy->regulator[0].supply = "v3p3"; 277 + qphy->regulator[1].supply = "v1p8"; 278 + qphy->regulator[2].supply = "vddcx"; 231 279 232 - ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(regs), regs); 280 + ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(qphy->regulator), 281 + qphy->regulator); 233 282 if (ret) 234 283 return ret; 235 - 236 - qphy->v3p3 = regs[0].consumer; 237 - qphy->v1p8 = regs[1].consumer; 238 - qphy->vdd = regs[2].consumer; 239 284 240 285 qphy->phy_reset = devm_reset_control_get(dev, "phy"); 241 286 if (IS_ERR(qphy->phy_reset)) ··· 313 364 if (ret < 0) 314 365 goto off_core; 315 366 316 - ret = phy_8x16_regulators_enable(qphy); 317 - if (0 && ret) 367 + ret = regulator_bulk_enable(ARRAY_SIZE(qphy->regulator), 368 + qphy->regulator); 369 + if (WARN_ON(ret)) 318 370 goto off_clks; 319 371 320 372 qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify; ··· 337 387 extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB, 338 388 &qphy->vbus_notify); 339 389 off_power: 340 - phy_8x16_regulators_disable(qphy); 390 + regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); 341 391 off_clks: 342 392 clk_disable_unprepare(qphy->iface_clk); 343 393 off_core: ··· 363 413 364 414 clk_disable_unprepare(qphy->iface_clk); 365 415 clk_disable_unprepare(qphy->core_clk); 366 - phy_8x16_regulators_disable(qphy); 416 + regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator); 367 417 return 0; 368 418 } 369 419
+3 -1
drivers/usb/renesas_usbhs/fifo.c
··· 190 190 goto __usbhs_pkt_handler_end; 191 191 } 192 192 193 - ret = func(pkt, &is_done); 193 + if (likely(func)) 194 + ret = func(pkt, &is_done); 194 195 195 196 if (is_done) 196 197 __usbhsf_pkt_del(pkt); ··· 890 889 891 890 pkt->trans = len; 892 891 892 + usbhsf_tx_irq_ctrl(pipe, 0); 893 893 INIT_WORK(&pkt->work, xfer_work); 894 894 schedule_work(&pkt->work); 895 895
+5 -1
drivers/usb/renesas_usbhs/mod_gadget.c
··· 158 158 struct usbhs_pipe *pipe = pkt->pipe; 159 159 struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); 160 160 struct usbhsg_request *ureq = usbhsg_pkt_to_ureq(pkt); 161 + unsigned long flags; 161 162 162 163 ureq->req.actual = pkt->actual; 163 164 164 - usbhsg_queue_pop(uep, ureq, 0); 165 + usbhs_lock(priv, flags); 166 + if (uep) 167 + __usbhsg_queue_pop(uep, ureq, 0); 168 + usbhs_unlock(priv, flags); 165 169 } 166 170 167 171 static void usbhsg_queue_push(struct usbhsg_uep *uep,
+1
drivers/usb/serial/cp210x.c
··· 165 165 { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ 166 166 { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ 167 167 { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ 168 + { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ 168 169 { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ 169 170 { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ 170 171 { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
+5 -6
drivers/usb/serial/cypress_m8.c
··· 447 447 struct usb_serial *serial = port->serial; 448 448 struct cypress_private *priv; 449 449 450 + if (!port->interrupt_out_urb || !port->interrupt_in_urb) { 451 + dev_err(&port->dev, "required endpoint is missing\n"); 452 + return -ENODEV; 453 + } 454 + 450 455 priv = kzalloc(sizeof(struct cypress_private), GFP_KERNEL); 451 456 if (!priv) 452 457 return -ENOMEM; ··· 611 606 cypress_set_termios(tty, port, &priv->tmp_termios); 612 607 613 608 /* setup the port and start reading from the device */ 614 - if (!port->interrupt_in_urb) { 615 - dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n", 616 - __func__); 617 - return -1; 618 - } 619 - 620 609 usb_fill_int_urb(port->interrupt_in_urb, serial->dev, 621 610 usb_rcvintpipe(serial->dev, port->interrupt_in_endpointAddress), 622 611 port->interrupt_in_urb->transfer_buffer,
+19
drivers/usb/serial/digi_acceleport.c
··· 1251 1251 1252 1252 static int digi_startup(struct usb_serial *serial) 1253 1253 { 1254 + struct device *dev = &serial->interface->dev; 1254 1255 struct digi_serial *serial_priv; 1255 1256 int ret; 1257 + int i; 1258 + 1259 + /* check whether the device has the expected number of endpoints */ 1260 + if (serial->num_port_pointers < serial->type->num_ports + 1) { 1261 + dev_err(dev, "OOB endpoints missing\n"); 1262 + return -ENODEV; 1263 + } 1264 + 1265 + for (i = 0; i < serial->type->num_ports + 1 ; i++) { 1266 + if (!serial->port[i]->read_urb) { 1267 + dev_err(dev, "bulk-in endpoint missing\n"); 1268 + return -ENODEV; 1269 + } 1270 + if (!serial->port[i]->write_urb) { 1271 + dev_err(dev, "bulk-out endpoint missing\n"); 1272 + return -ENODEV; 1273 + } 1274 + } 1256 1275 1257 1276 serial_priv = kzalloc(sizeof(*serial_priv), GFP_KERNEL); 1258 1277 if (!serial_priv)
+4
drivers/usb/serial/ftdi_sio.c
··· 1004 1004 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, 1005 1005 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, 1006 1006 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, 1007 + /* ICP DAS I-756xU devices */ 1008 + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, 1009 + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, 1010 + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, 1007 1011 { } /* Terminating entry */ 1008 1012 }; 1009 1013
+8
drivers/usb/serial/ftdi_sio_ids.h
··· 872 872 #define NOVITUS_BONO_E_PID 0x6010 873 873 874 874 /* 875 + * ICPDAS I-756*U devices 876 + */ 877 + #define ICPDAS_VID 0x1b5c 878 + #define ICPDAS_I7560U_PID 0x0103 879 + #define ICPDAS_I7561U_PID 0x0104 880 + #define ICPDAS_I7563U_PID 0x0105 881 + 882 + /* 875 883 * RT Systems programming cables for various ham radios 876 884 */ 877 885 #define RTSYSTEMS_VID 0x2100 /* Vendor ID */
+8 -1
drivers/usb/serial/mct_u232.c
··· 376 376 377 377 static int mct_u232_port_probe(struct usb_serial_port *port) 378 378 { 379 + struct usb_serial *serial = port->serial; 379 380 struct mct_u232_private *priv; 381 + 382 + /* check first to simplify error handling */ 383 + if (!serial->port[1] || !serial->port[1]->interrupt_in_urb) { 384 + dev_err(&port->dev, "expected endpoint missing\n"); 385 + return -ENODEV; 386 + } 380 387 381 388 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 382 389 if (!priv) 383 390 return -ENOMEM; 384 391 385 392 /* Use second interrupt-in endpoint for reading. */ 386 - priv->read_urb = port->serial->port[1]->interrupt_in_urb; 393 + priv->read_urb = serial->port[1]->interrupt_in_urb; 387 394 priv->read_urb->context = port; 388 395 389 396 spin_lock_init(&priv->lock);
+2
drivers/usb/serial/option.c
··· 1818 1818 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) }, 1819 1819 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) }, 1820 1820 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) }, 1821 + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ 1822 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1821 1823 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ 1822 1824 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ 1823 1825 { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */
+11
drivers/usb/usbip/usbip_common.c
··· 741 741 if (!(size > 0)) 742 742 return 0; 743 743 744 + if (size > urb->transfer_buffer_length) { 745 + /* should not happen, probably malicious packet */ 746 + if (ud->side == USBIP_STUB) { 747 + usbip_event_add(ud, SDEV_EVENT_ERROR_TCP); 748 + return 0; 749 + } else { 750 + usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); 751 + return -EPIPE; 752 + } 753 + } 754 + 744 755 ret = usbip_recv(ud->tcp_socket, urb->transfer_buffer, size); 745 756 if (ret != size) { 746 757 dev_err(&urb->dev->dev, "recv xbuf, %d\n", ret);
+1 -1
include/uapi/linux/usb/ch9.h
··· 899 899 __le32 bmAttributes; 900 900 #define USB_SSP_SUBLINK_SPEED_ATTRIBS (0x1f << 0) /* sublink speed entries */ 901 901 #define USB_SSP_SUBLINK_SPEED_IDS (0xf << 5) /* speed ID entries */ 902 - __u16 wFunctionalitySupport; 902 + __le16 wFunctionalitySupport; 903 903 #define USB_SSP_MIN_SUBLINK_SPEED_ATTRIBUTE_ID (0xf) 904 904 #define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8) 905 905 #define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12)