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

Pull USB fixes from Greg KH:
"Here is a number of different USB fixes for 4.11-rc2.

Seems like there were a lot of unresolved issues that people have been
finding for this subsystem, and a bunch of good security auditing
happening as well from Johan Hovold. There's the usual batch of gadget
driver fixes and xhci issues resolved as well.

All of these have been in linux-next with no reported issues"

* tag 'usb-4.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits)
usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers
usb: host: xhci-dbg: HCIVERSION should be a binary number
usb: xhci: remove dummy extra_priv_size for size of xhci_hcd struct
usb: xhci-mtk: check hcc_params after adding primary hcd
USB: serial: digi_acceleport: fix OOB-event processing
MAINTAINERS: usb251xb: remove reference inexistent file
doc: dt-bindings: usb251xb: mark reg as required
usb: usb251xb: dt: add unit suffix to oc-delay and power-on-time
usb: usb251xb: remove max_{power,current}_{sp,bp} properties
usb-storage: Add ignore-residue quirk for Initio INIC-3619
USB: iowarrior: fix NULL-deref in write
USB: iowarrior: fix NULL-deref at probe
usb: phy: isp1301: Add OF device ID table
usb: ohci-at91: Do not drop unhandled USB suspend control requests
USB: serial: safe_serial: fix information leak in completion handler
USB: serial: io_ti: fix information leak in completion handler
USB: serial: omninet: drop open callback
USB: serial: omninet: fix reference leaks at open
USB: serial: io_ti: fix NULL-deref in interrupt callback
usb: dwc3: gadget: make to increment req->remaining in all cases
...

+213 -144
+18 -35
Documentation/devicetree/bindings/usb/usb251xb.txt
··· 7 7 - compatible : Should be "microchip,usb251xb" or one of the specific types: 8 8 "microchip,usb2512b", "microchip,usb2512bi", "microchip,usb2513b", 9 9 "microchip,usb2513bi", "microchip,usb2514b", "microchip,usb2514bi" 10 - - hub-reset-gpios : Should specify the gpio for hub reset 10 + - reset-gpios : Should specify the gpio for hub reset 11 + - reg : I2C address on the selected bus (default is <0x2C>) 11 12 12 13 Optional properties : 13 - - reg : I2C address on the selected bus (default is <0x2C>) 14 14 - skip-config : Skip Hub configuration, but only send the USB-Attach command 15 - - vendor-id : USB Vendor ID of the hub (16 bit, default is 0x0424) 16 - - product-id : USB Product ID of the hub (16 bit, default depends on type) 17 - - device-id : USB Device ID of the hub (16 bit, default is 0x0bb3) 18 - - language-id : USB Language ID (16 bit, default is 0x0000) 19 - - manufacturer : USB Manufacturer string (max 31 characters long) 20 - - product : USB Product string (max 31 characters long) 21 - - serial : USB Serial string (max 31 characters long) 15 + - vendor-id : Set USB Vendor ID of the hub (16 bit, default is 0x0424) 16 + - product-id : Set USB Product ID of the hub (16 bit, default depends on type) 17 + - device-id : Set USB Device ID of the hub (16 bit, default is 0x0bb3) 18 + - language-id : Set USB Language ID (16 bit, default is 0x0000) 19 + - manufacturer : Set USB Manufacturer string (max 31 characters long) 20 + - product : Set USB Product string (max 31 characters long) 21 + - serial : Set USB Serial string (max 31 characters long) 22 22 - {bus,self}-powered : selects between self- and bus-powered operation (default 23 23 is self-powered) 24 24 - disable-hi-speed : disable USB Hi-Speed support ··· 31 31 (default is individual) 32 32 - dynamic-power-switching : enable auto-switching from self- to bus-powered 33 33 operation if the local power source is removed or unavailable 34 - - oc-delay-{100us,4ms,8ms,16ms} : set over current timer delay (default is 8ms) 35 - - compound-device : indicated the hub is part of a compound device 34 + - oc-delay-us : Delay time (in microseconds) for filtering the over-current 35 + sense inputs. Valid values are 100, 4000, 8000 (default) and 16000. If 36 + an invalid value is given, the default is used instead. 37 + - compound-device : indicate the hub is part of a compound device 36 38 - port-mapping-mode : enable port mapping mode 37 39 - string-support : enable string descriptor support (required for manufacturer, 38 40 product and serial string configuration) ··· 42 40 device connected. 43 41 - sp-disabled-ports : Specifies the ports which will be self-power disabled 44 42 - bp-disabled-ports : Specifies the ports which will be bus-power disabled 45 - - max-sp-power : Specifies the maximum current the hub consumes from an 46 - upstream port when operating as self-powered hub including the power 47 - consumption of a permanently attached peripheral if the hub is 48 - configured as a compound device. The value is given in mA in a 0 - 500 49 - range (default is 2). 50 - - max-bp-power : Specifies the maximum current the hub consumes from an 51 - upstream port when operating as bus-powered hub including the power 52 - consumption of a permanently attached peripheral if the hub is 53 - configured as a compound device. The value is given in mA in a 0 - 500 54 - range (default is 100). 55 - - max-sp-current : Specifies the maximum current the hub consumes from an 56 - upstream port when operating as self-powered hub EXCLUDING the power 57 - consumption of a permanently attached peripheral if the hub is 58 - configured as a compound device. The value is given in mA in a 0 - 500 59 - range (default is 2). 60 - - max-bp-current : Specifies the maximum current the hub consumes from an 61 - upstream port when operating as bus-powered hub EXCLUDING the power 62 - consumption of a permanently attached peripheral if the hub is 63 - configured as a compound device. The value is given in mA in a 0 - 500 64 - range (default is 100). 65 - - power-on-time : Specifies the time it takes from the time the host initiates 66 - the power-on sequence to a port until the port has adequate power. The 67 - value is given in ms in a 0 - 510 range (default is 100ms). 43 + - power-on-time-ms : Specifies the time it takes from the time the host 44 + initiates the power-on sequence to a port until the port has adequate 45 + power. The value is given in ms in a 0 - 510 range (default is 100ms). 68 46 69 47 Examples: 70 48 usb2512b@2c { 71 49 compatible = "microchip,usb2512b"; 72 - hub-reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; 50 + reg = <0x2c>; 51 + reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; 73 52 }; 74 53 75 54 usb2514b@2c {
-1
MAINTAINERS
··· 8307 8307 L: linux-usb@vger.kernel.org 8308 8308 S: Maintained 8309 8309 F: drivers/usb/misc/usb251xb.c 8310 - F: include/linux/platform_data/usb251xb.h 8311 8310 F: Documentation/devicetree/bindings/usb/usb251xb.txt 8312 8311 8313 8312 MICROSOFT SURFACE PRO 3 BUTTON DRIVER
+2 -1
drivers/usb/dwc3/dwc3-omap.c
··· 250 250 val = dwc3_omap_read_utmi_ctrl(omap); 251 251 val |= USBOTGSS_UTMI_OTG_CTRL_IDDIG; 252 252 dwc3_omap_write_utmi_ctrl(omap, val); 253 + break; 253 254 254 255 case OMAP_DWC3_VBUS_OFF: 255 256 val = dwc3_omap_read_utmi_ctrl(omap); ··· 393 392 { 394 393 u32 reg; 395 394 struct device_node *node = omap->dev->of_node; 396 - int utmi_mode = 0; 395 + u32 utmi_mode = 0; 397 396 398 397 reg = dwc3_omap_read_utmi_ctrl(omap); 399 398
+67 -9
drivers/usb/dwc3/gadget.c
··· 1342 1342 if (r == req) { 1343 1343 /* wait until it is processed */ 1344 1344 dwc3_stop_active_transfer(dwc, dep->number, true); 1345 + 1346 + /* 1347 + * If request was already started, this means we had to 1348 + * stop the transfer. With that we also need to ignore 1349 + * all TRBs used by the request, however TRBs can only 1350 + * be modified after completion of END_TRANSFER 1351 + * command. So what we do here is that we wait for 1352 + * END_TRANSFER completion and only after that, we jump 1353 + * over TRBs by clearing HWO and incrementing dequeue 1354 + * pointer. 1355 + * 1356 + * Note that we have 2 possible types of transfers here: 1357 + * 1358 + * i) Linear buffer request 1359 + * ii) SG-list based request 1360 + * 1361 + * SG-list based requests will have r->num_pending_sgs 1362 + * set to a valid number (> 0). Linear requests, 1363 + * normally use a single TRB. 1364 + * 1365 + * For each of these two cases, if r->unaligned flag is 1366 + * set, one extra TRB has been used to align transfer 1367 + * size to wMaxPacketSize. 1368 + * 1369 + * All of these cases need to be taken into 1370 + * consideration so we don't mess up our TRB ring 1371 + * pointers. 1372 + */ 1373 + wait_event_lock_irq(dep->wait_end_transfer, 1374 + !(dep->flags & DWC3_EP_END_TRANSFER_PENDING), 1375 + dwc->lock); 1376 + 1377 + if (!r->trb) 1378 + goto out1; 1379 + 1380 + if (r->num_pending_sgs) { 1381 + struct dwc3_trb *trb; 1382 + int i = 0; 1383 + 1384 + for (i = 0; i < r->num_pending_sgs; i++) { 1385 + trb = r->trb + i; 1386 + trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 1387 + dwc3_ep_inc_deq(dep); 1388 + } 1389 + 1390 + if (r->unaligned) { 1391 + trb = r->trb + r->num_pending_sgs + 1; 1392 + trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 1393 + dwc3_ep_inc_deq(dep); 1394 + } 1395 + } else { 1396 + struct dwc3_trb *trb = r->trb; 1397 + 1398 + trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 1399 + dwc3_ep_inc_deq(dep); 1400 + 1401 + if (r->unaligned) { 1402 + trb = r->trb + 1; 1403 + trb->ctrl &= ~DWC3_TRB_CTRL_HWO; 1404 + dwc3_ep_inc_deq(dep); 1405 + } 1406 + } 1345 1407 goto out1; 1346 1408 } 1347 1409 dev_err(dwc->dev, "request %p was not queued to %s\n", ··· 1414 1352 1415 1353 out1: 1416 1354 /* giveback the request */ 1355 + dep->queued_requests--; 1417 1356 dwc3_gadget_giveback(dep, req, -ECONNRESET); 1418 1357 1419 1358 out0: ··· 2189 2126 return 1; 2190 2127 } 2191 2128 2192 - if ((trb->ctrl & DWC3_TRB_CTRL_HWO) && status != -ESHUTDOWN) 2193 - return 1; 2194 - 2195 2129 count = trb->size & DWC3_TRB_SIZE_MASK; 2196 2130 req->remaining += count; 2131 + 2132 + if ((trb->ctrl & DWC3_TRB_CTRL_HWO) && status != -ESHUTDOWN) 2133 + return 1; 2197 2134 2198 2135 if (dep->direction) { 2199 2136 if (count) { ··· 3291 3228 3292 3229 int dwc3_gadget_suspend(struct dwc3 *dwc) 3293 3230 { 3294 - int ret; 3295 - 3296 3231 if (!dwc->gadget_driver) 3297 3232 return 0; 3298 3233 3299 - ret = dwc3_gadget_run_stop(dwc, false, false); 3300 - if (ret < 0) 3301 - return ret; 3302 - 3234 + dwc3_gadget_run_stop(dwc, false, false); 3303 3235 dwc3_disconnect_gadget(dwc); 3304 3236 __dwc3_gadget_stop(dwc); 3305 3237
+7 -7
drivers/usb/dwc3/gadget.h
··· 28 28 #define gadget_to_dwc(g) (container_of(g, struct dwc3, gadget)) 29 29 30 30 /* DEPCFG parameter 1 */ 31 - #define DWC3_DEPCFG_INT_NUM(n) ((n) << 0) 31 + #define DWC3_DEPCFG_INT_NUM(n) (((n) & 0x1f) << 0) 32 32 #define DWC3_DEPCFG_XFER_COMPLETE_EN (1 << 8) 33 33 #define DWC3_DEPCFG_XFER_IN_PROGRESS_EN (1 << 9) 34 34 #define DWC3_DEPCFG_XFER_NOT_READY_EN (1 << 10) 35 35 #define DWC3_DEPCFG_FIFO_ERROR_EN (1 << 11) 36 36 #define DWC3_DEPCFG_STREAM_EVENT_EN (1 << 13) 37 - #define DWC3_DEPCFG_BINTERVAL_M1(n) ((n) << 16) 37 + #define DWC3_DEPCFG_BINTERVAL_M1(n) (((n) & 0xff) << 16) 38 38 #define DWC3_DEPCFG_STREAM_CAPABLE (1 << 24) 39 - #define DWC3_DEPCFG_EP_NUMBER(n) ((n) << 25) 39 + #define DWC3_DEPCFG_EP_NUMBER(n) (((n) & 0x1f) << 25) 40 40 #define DWC3_DEPCFG_BULK_BASED (1 << 30) 41 41 #define DWC3_DEPCFG_FIFO_BASED (1 << 31) 42 42 43 43 /* DEPCFG parameter 0 */ 44 - #define DWC3_DEPCFG_EP_TYPE(n) ((n) << 1) 45 - #define DWC3_DEPCFG_MAX_PACKET_SIZE(n) ((n) << 3) 46 - #define DWC3_DEPCFG_FIFO_NUMBER(n) ((n) << 17) 47 - #define DWC3_DEPCFG_BURST_SIZE(n) ((n) << 22) 44 + #define DWC3_DEPCFG_EP_TYPE(n) (((n) & 0x3) << 1) 45 + #define DWC3_DEPCFG_MAX_PACKET_SIZE(n) (((n) & 0x7ff) << 3) 46 + #define DWC3_DEPCFG_FIFO_NUMBER(n) (((n) & 0x1f) << 17) 47 + #define DWC3_DEPCFG_BURST_SIZE(n) (((n) & 0xf) << 22) 48 48 #define DWC3_DEPCFG_DATA_SEQ_NUM(n) ((n) << 26) 49 49 /* This applies for core versions earlier than 1.94a */ 50 50 #define DWC3_DEPCFG_IGN_SEQ_NUM (1 << 31)
+1
drivers/usb/gadget/configfs.c
··· 269 269 ret = unregister_gadget(gi); 270 270 if (ret) 271 271 goto err; 272 + kfree(name); 272 273 } else { 273 274 if (gi->composite.gadget_driver.udc_name) { 274 275 ret = -EBUSY;
+14 -3
drivers/usb/gadget/function/f_fs.c
··· 1834 1834 spin_lock_irqsave(&func->ffs->eps_lock, flags); 1835 1835 while(count--) { 1836 1836 struct usb_endpoint_descriptor *ds; 1837 + struct usb_ss_ep_comp_descriptor *comp_desc = NULL; 1838 + int needs_comp_desc = false; 1837 1839 int desc_idx; 1838 1840 1839 - if (ffs->gadget->speed == USB_SPEED_SUPER) 1841 + if (ffs->gadget->speed == USB_SPEED_SUPER) { 1840 1842 desc_idx = 2; 1841 - else if (ffs->gadget->speed == USB_SPEED_HIGH) 1843 + needs_comp_desc = true; 1844 + } else if (ffs->gadget->speed == USB_SPEED_HIGH) 1842 1845 desc_idx = 1; 1843 1846 else 1844 1847 desc_idx = 0; ··· 1858 1855 1859 1856 ep->ep->driver_data = ep; 1860 1857 ep->ep->desc = ds; 1858 + 1859 + comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds + 1860 + USB_DT_ENDPOINT_SIZE); 1861 + ep->ep->maxburst = comp_desc->bMaxBurst + 1; 1862 + 1863 + if (needs_comp_desc) 1864 + ep->ep->comp_desc = comp_desc; 1865 + 1861 1866 ret = usb_ep_enable(ep->ep); 1862 1867 if (likely(!ret)) { 1863 1868 epfile->ep = ep; ··· 2264 2253 2265 2254 if (len < sizeof(*d) || 2266 2255 d->bFirstInterfaceNumber >= ffs->interfaces_count || 2267 - d->Reserved1) 2256 + !d->Reserved1) 2268 2257 return -EINVAL; 2269 2258 for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i) 2270 2259 if (d->Reserved2[i])
-7
drivers/usb/gadget/function/f_uvc.c
··· 258 258 memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req)); 259 259 v4l2_event_queue(&uvc->vdev, &v4l2_event); 260 260 261 - /* Pass additional setup data to userspace */ 262 - if (uvc->event_setup_out && uvc->event_length) { 263 - uvc->control_req->length = uvc->event_length; 264 - return usb_ep_queue(uvc->func.config->cdev->gadget->ep0, 265 - uvc->control_req, GFP_ATOMIC); 266 - } 267 - 268 261 return 0; 269 262 } 270 263
+3 -1
drivers/usb/gadget/legacy/inode.c
··· 1781 1781 1782 1782 spin_lock_irq (&dev->lock); 1783 1783 value = -EINVAL; 1784 - if (dev->buf) 1784 + if (dev->buf) { 1785 + kfree(kbuf); 1785 1786 goto fail; 1787 + } 1786 1788 dev->buf = kbuf; 1787 1789 1788 1790 /* full or low speed config */
+2 -2
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 610 610 { 611 611 struct usba_ep *ep = to_usba_ep(_ep); 612 612 struct usba_udc *udc = ep->udc; 613 - unsigned long flags, ept_cfg, maxpacket; 613 + unsigned long flags, maxpacket; 614 614 unsigned int nr_trans; 615 615 616 616 DBG(DBG_GADGET, "%s: ep_enable: desc=%p\n", ep->ep.name, desc); ··· 630 630 ep->is_in = 0; 631 631 632 632 DBG(DBG_ERR, "%s: EPT_CFG = 0x%lx (maxpacket = %lu)\n", 633 - ep->ep.name, ept_cfg, maxpacket); 633 + ep->ep.name, ep->ept_cfg, maxpacket); 634 634 635 635 if (usb_endpoint_dir_in(desc)) { 636 636 ep->is_in = 1;
+2
drivers/usb/gadget/udc/dummy_hcd.c
··· 1031 1031 int rc; 1032 1032 1033 1033 dum = *((void **)dev_get_platdata(&pdev->dev)); 1034 + /* Clear usb_gadget region for new registration to udc-core */ 1035 + memzero_explicit(&dum->gadget, sizeof(struct usb_gadget)); 1034 1036 dum->gadget.name = gadget_name; 1035 1037 dum->gadget.ops = &dummy_ops; 1036 1038 dum->gadget.max_speed = USB_SPEED_SUPER;
+13 -12
drivers/usb/gadget/udc/net2280.c
··· 1146 1146 */ 1147 1147 while (!list_empty(&ep->queue)) { 1148 1148 struct net2280_request *req; 1149 - u32 tmp; 1149 + u32 req_dma_count; 1150 1150 1151 1151 req = list_entry(ep->queue.next, 1152 1152 struct net2280_request, queue); 1153 1153 if (!req->valid) 1154 1154 break; 1155 1155 rmb(); 1156 - tmp = le32_to_cpup(&req->td->dmacount); 1157 - if ((tmp & BIT(VALID_BIT)) != 0) 1156 + req_dma_count = le32_to_cpup(&req->td->dmacount); 1157 + if ((req_dma_count & BIT(VALID_BIT)) != 0) 1158 1158 break; 1159 1159 1160 1160 /* SHORT_PACKET_TRANSFERRED_INTERRUPT handles "usb-short" ··· 1163 1163 */ 1164 1164 if (unlikely(req->td->dmadesc == 0)) { 1165 1165 /* paranoia */ 1166 - tmp = readl(&ep->dma->dmacount); 1167 - if (tmp & DMA_BYTE_COUNT_MASK) 1166 + u32 const ep_dmacount = readl(&ep->dma->dmacount); 1167 + 1168 + if (ep_dmacount & DMA_BYTE_COUNT_MASK) 1168 1169 break; 1169 1170 /* single transfer mode */ 1170 - dma_done(ep, req, tmp, 0); 1171 + dma_done(ep, req, req_dma_count, 0); 1171 1172 num_completed++; 1172 1173 break; 1173 1174 } else if (!ep->is_in && 1174 1175 (req->req.length % ep->ep.maxpacket) && 1175 1176 !(ep->dev->quirks & PLX_PCIE)) { 1176 1177 1177 - tmp = readl(&ep->regs->ep_stat); 1178 + u32 const ep_stat = readl(&ep->regs->ep_stat); 1178 1179 /* AVOID TROUBLE HERE by not issuing short reads from 1179 1180 * your gadget driver. That helps avoids errata 0121, 1180 1181 * 0122, and 0124; not all cases trigger the warning. 1181 1182 */ 1182 - if ((tmp & BIT(NAK_OUT_PACKETS)) == 0) { 1183 + if ((ep_stat & BIT(NAK_OUT_PACKETS)) == 0) { 1183 1184 ep_warn(ep->dev, "%s lost packet sync!\n", 1184 1185 ep->ep.name); 1185 1186 req->req.status = -EOVERFLOW; 1186 1187 } else { 1187 - tmp = readl(&ep->regs->ep_avail); 1188 - if (tmp) { 1188 + u32 const ep_avail = readl(&ep->regs->ep_avail); 1189 + if (ep_avail) { 1189 1190 /* fifo gets flushed later */ 1190 1191 ep->out_overflow = 1; 1191 1192 ep_dbg(ep->dev, 1192 1193 "%s dma, discard %d len %d\n", 1193 - ep->ep.name, tmp, 1194 + ep->ep.name, ep_avail, 1194 1195 req->req.length); 1195 1196 req->req.status = -EOVERFLOW; 1196 1197 } 1197 1198 } 1198 1199 } 1199 - dma_done(ep, req, tmp, 0); 1200 + dma_done(ep, req, req_dma_count, 0); 1200 1201 num_completed++; 1201 1202 } 1202 1203
+3 -2
drivers/usb/gadget/udc/pxa27x_udc.c
··· 2534 2534 usb_del_gadget_udc(&udc->gadget); 2535 2535 pxa_cleanup_debugfs(udc); 2536 2536 2537 - if (!IS_ERR_OR_NULL(udc->transceiver)) 2537 + if (!IS_ERR_OR_NULL(udc->transceiver)) { 2538 2538 usb_unregister_notifier(udc->transceiver, &pxa27x_udc_phy); 2539 - usb_put_phy(udc->transceiver); 2539 + usb_put_phy(udc->transceiver); 2540 + } 2540 2541 2541 2542 udc->transceiver = NULL; 2542 2543 the_controller = NULL;
+2 -2
drivers/usb/host/ohci-at91.c
··· 350 350 351 351 case USB_PORT_FEAT_SUSPEND: 352 352 dev_dbg(hcd->self.controller, "SetPortFeat: SUSPEND\n"); 353 - if (valid_port(wIndex)) { 353 + if (valid_port(wIndex) && ohci_at91->sfr_regmap) { 354 354 ohci_at91_port_suspend(ohci_at91->sfr_regmap, 355 355 1); 356 356 return 0; ··· 393 393 394 394 case USB_PORT_FEAT_SUSPEND: 395 395 dev_dbg(hcd->self.controller, "ClearPortFeature: SUSPEND\n"); 396 - if (valid_port(wIndex)) { 396 + if (valid_port(wIndex) && ohci_at91->sfr_regmap) { 397 397 ohci_at91_port_suspend(ohci_at91->sfr_regmap, 398 398 0); 399 399 return 0;
+1 -1
drivers/usb/host/xhci-dbg.c
··· 109 109 xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK); 110 110 111 111 /* xhci 1.1 controllers have the HCCPARAMS2 register */ 112 - if (hci_version > 100) { 112 + if (hci_version > 0x100) { 113 113 temp = readl(&xhci->cap_regs->hcc_params2); 114 114 xhci_dbg(xhci, "HCC PARAMS2 0x%x:\n", (unsigned int) temp); 115 115 xhci_dbg(xhci, " HC %s Force save context capability",
+3 -4
drivers/usb/host/xhci-mtk.c
··· 382 382 383 383 static int xhci_mtk_setup(struct usb_hcd *hcd); 384 384 static const struct xhci_driver_overrides xhci_mtk_overrides __initconst = { 385 - .extra_priv_size = sizeof(struct xhci_hcd), 386 385 .reset = xhci_mtk_setup, 387 386 }; 388 387 ··· 677 678 goto power_off_phys; 678 679 } 679 680 680 - if (HCC_MAX_PSA(xhci->hcc_params) >= 4) 681 - xhci->shared_hcd->can_do_streams = 1; 682 - 683 681 ret = usb_add_hcd(hcd, irq, IRQF_SHARED); 684 682 if (ret) 685 683 goto put_usb3_hcd; 684 + 685 + if (HCC_MAX_PSA(xhci->hcc_params) >= 4) 686 + xhci->shared_hcd->can_do_streams = 1; 686 687 687 688 ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); 688 689 if (ret)
+2
drivers/usb/host/xhci-plat.c
··· 286 286 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 287 287 struct clk *clk = xhci->clk; 288 288 289 + xhci->xhc_state |= XHCI_STATE_REMOVING; 290 + 289 291 usb_remove_hcd(xhci->shared_hcd); 290 292 usb_phy_shutdown(hcd->usb_phy); 291 293
-1
drivers/usb/host/xhci-tegra.c
··· 1308 1308 } 1309 1309 1310 1310 static const struct xhci_driver_overrides tegra_xhci_overrides __initconst = { 1311 - .extra_priv_size = sizeof(struct xhci_hcd), 1312 1311 .reset = tegra_xhci_setup, 1313 1312 }; 1314 1313
+15 -6
drivers/usb/misc/iowarrior.c
··· 781 781 iface_desc = interface->cur_altsetting; 782 782 dev->product_id = le16_to_cpu(udev->descriptor.idProduct); 783 783 784 - if (iface_desc->desc.bNumEndpoints < 1) { 785 - dev_err(&interface->dev, "Invalid number of endpoints\n"); 786 - retval = -EINVAL; 787 - goto error; 788 - } 789 - 790 784 /* set up the endpoint information */ 791 785 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 792 786 endpoint = &iface_desc->endpoint[i].desc; ··· 791 797 /* this one will match for the IOWarrior56 only */ 792 798 dev->int_out_endpoint = endpoint; 793 799 } 800 + 801 + if (!dev->int_in_endpoint) { 802 + dev_err(&interface->dev, "no interrupt-in endpoint found\n"); 803 + retval = -ENODEV; 804 + goto error; 805 + } 806 + 807 + if (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) { 808 + if (!dev->int_out_endpoint) { 809 + dev_err(&interface->dev, "no interrupt-out endpoint found\n"); 810 + retval = -ENODEV; 811 + goto error; 812 + } 813 + } 814 + 794 815 /* we have to check the report_size often, so remember it in the endianness suitable for our machine */ 795 816 dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint); 796 817 if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&
+24 -35
drivers/usb/misc/usb251xb.c
··· 375 375 if (of_get_property(np, "dynamic-power-switching", NULL)) 376 376 hub->conf_data2 |= BIT(7); 377 377 378 - if (of_get_property(np, "oc-delay-100us", NULL)) { 379 - hub->conf_data2 &= ~BIT(5); 380 - hub->conf_data2 &= ~BIT(4); 381 - } else if (of_get_property(np, "oc-delay-4ms", NULL)) { 382 - hub->conf_data2 &= ~BIT(5); 383 - hub->conf_data2 |= BIT(4); 384 - } else if (of_get_property(np, "oc-delay-8ms", NULL)) { 385 - hub->conf_data2 |= BIT(5); 386 - hub->conf_data2 &= ~BIT(4); 387 - } else if (of_get_property(np, "oc-delay-16ms", NULL)) { 388 - hub->conf_data2 |= BIT(5); 389 - hub->conf_data2 |= BIT(4); 378 + if (!of_property_read_u32(np, "oc-delay-us", property_u32)) { 379 + if (*property_u32 == 100) { 380 + /* 100 us*/ 381 + hub->conf_data2 &= ~BIT(5); 382 + hub->conf_data2 &= ~BIT(4); 383 + } else if (*property_u32 == 4000) { 384 + /* 4 ms */ 385 + hub->conf_data2 &= ~BIT(5); 386 + hub->conf_data2 |= BIT(4); 387 + } else if (*property_u32 == 16000) { 388 + /* 16 ms */ 389 + hub->conf_data2 |= BIT(5); 390 + hub->conf_data2 |= BIT(4); 391 + } else { 392 + /* 8 ms (DEFAULT) */ 393 + hub->conf_data2 |= BIT(5); 394 + hub->conf_data2 &= ~BIT(4); 395 + } 390 396 } 391 397 392 398 if (of_get_property(np, "compound-device", NULL)) ··· 438 432 } 439 433 } 440 434 441 - hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; 442 - if (!of_property_read_u32(np, "max-sp-power", property_u32)) 443 - hub->max_power_sp = min_t(u8, be32_to_cpu(*property_u32) / 2, 444 - 250); 445 - 446 - hub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS; 447 - if (!of_property_read_u32(np, "max-bp-power", property_u32)) 448 - hub->max_power_bp = min_t(u8, be32_to_cpu(*property_u32) / 2, 449 - 250); 450 - 451 - hub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF; 452 - if (!of_property_read_u32(np, "max-sp-current", property_u32)) 453 - hub->max_current_sp = min_t(u8, be32_to_cpu(*property_u32) / 2, 454 - 250); 455 - 456 - hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; 457 - if (!of_property_read_u32(np, "max-bp-current", property_u32)) 458 - hub->max_current_bp = min_t(u8, be32_to_cpu(*property_u32) / 2, 459 - 250); 460 - 461 435 hub->power_on_time = USB251XB_DEF_POWER_ON_TIME; 462 - if (!of_property_read_u32(np, "power-on-time", property_u32)) 463 - hub->power_on_time = min_t(u8, be32_to_cpu(*property_u32) / 2, 464 - 255); 436 + if (!of_property_read_u32(np, "power-on-time-ms", property_u32)) 437 + hub->power_on_time = min_t(u8, *property_u32 / 2, 255); 465 438 466 439 if (of_property_read_u16_array(np, "language-id", &hub->lang_id, 1)) 467 440 hub->lang_id = USB251XB_DEF_LANGUAGE_ID; ··· 477 492 /* The following parameters are currently not exposed to devicetree, but 478 493 * may be as soon as needed. 479 494 */ 495 + hub->max_power_sp = USB251XB_DEF_MAX_POWER_SELF; 496 + hub->max_power_bp = USB251XB_DEF_MAX_POWER_BUS; 497 + hub->max_current_sp = USB251XB_DEF_MAX_CURRENT_SELF; 498 + hub->max_current_bp = USB251XB_DEF_MAX_CURRENT_BUS; 480 499 hub->bat_charge_en = USB251XB_DEF_BATTERY_CHARGING_ENABLE; 481 500 hub->boost_up = USB251XB_DEF_BOOST_UP; 482 501 hub->boost_x = USB251XB_DEF_BOOST_X;
+7
drivers/usb/phy/phy-isp1301.c
··· 33 33 }; 34 34 MODULE_DEVICE_TABLE(i2c, isp1301_id); 35 35 36 + static const struct of_device_id isp1301_of_match[] = { 37 + {.compatible = "nxp,isp1301" }, 38 + { }, 39 + }; 40 + MODULE_DEVICE_TABLE(of, isp1301_of_match); 41 + 36 42 static struct i2c_client *isp1301_i2c_client; 37 43 38 44 static int __isp1301_write(struct isp1301 *isp, u8 reg, u8 value, u8 clear) ··· 136 130 static struct i2c_driver isp1301_driver = { 137 131 .driver = { 138 132 .name = DRV_NAME, 133 + .of_match_table = of_match_ptr(isp1301_of_match), 139 134 }, 140 135 .probe = isp1301_probe, 141 136 .remove = isp1301_remove,
+1 -1
drivers/usb/serial/digi_acceleport.c
··· 1500 1500 return -1; 1501 1501 1502 1502 /* handle each oob command */ 1503 - for (i = 0; i < urb->actual_length - 4; i += 4) { 1503 + for (i = 0; i < urb->actual_length - 3; i += 4) { 1504 1504 opcode = buf[i]; 1505 1505 line = buf[i + 1]; 1506 1506 status = buf[i + 2];
+7 -1
drivers/usb/serial/io_ti.c
··· 1674 1674 function = TIUMP_GET_FUNC_FROM_CODE(data[0]); 1675 1675 dev_dbg(dev, "%s - port_number %d, function %d, info 0x%x\n", __func__, 1676 1676 port_number, function, data[1]); 1677 + 1678 + if (port_number >= edge_serial->serial->num_ports) { 1679 + dev_err(dev, "bad port number %d\n", port_number); 1680 + goto exit; 1681 + } 1682 + 1677 1683 port = edge_serial->serial->port[port_number]; 1678 1684 edge_port = usb_get_serial_port_data(port); 1679 1685 if (!edge_port) { ··· 1761 1755 1762 1756 port_number = edge_port->port->port_number; 1763 1757 1764 - if (edge_port->lsr_event) { 1758 + if (urb->actual_length > 0 && edge_port->lsr_event) { 1765 1759 edge_port->lsr_event = 0; 1766 1760 dev_dbg(dev, "%s ===== Port %u LSR Status = %02x, Data = %02x ======\n", 1767 1761 __func__, port_number, edge_port->lsr_mask, *data);
-13
drivers/usb/serial/omninet.c
··· 31 31 #define BT_IGNITIONPRO_ID 0x2000 32 32 33 33 /* function prototypes */ 34 - static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port); 35 34 static void omninet_process_read_urb(struct urb *urb); 36 35 static void omninet_write_bulk_callback(struct urb *urb); 37 36 static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port, ··· 59 60 .attach = omninet_attach, 60 61 .port_probe = omninet_port_probe, 61 62 .port_remove = omninet_port_remove, 62 - .open = omninet_open, 63 63 .write = omninet_write, 64 64 .write_room = omninet_write_room, 65 65 .write_bulk_callback = omninet_write_bulk_callback, ··· 136 138 kfree(od); 137 139 138 140 return 0; 139 - } 140 - 141 - static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port) 142 - { 143 - struct usb_serial *serial = port->serial; 144 - struct usb_serial_port *wport; 145 - 146 - wport = serial->port[1]; 147 - tty_port_tty_set(&wport->port, tty); 148 - 149 - return usb_serial_generic_open(tty, port); 150 141 } 151 142 152 143 #define OMNINET_HEADERLEN 4
+5
drivers/usb/serial/safe_serial.c
··· 200 200 if (!safe) 201 201 goto out; 202 202 203 + if (length < 2) { 204 + dev_err(&port->dev, "malformed packet\n"); 205 + return; 206 + } 207 + 203 208 fcs = fcs_compute10(data, length, CRC10_INITFCS); 204 209 if (fcs) { 205 210 dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs);
+14
drivers/usb/storage/unusual_devs.h
··· 2071 2071 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2072 2072 US_FL_IGNORE_RESIDUE ), 2073 2073 2074 + /* 2075 + * Reported by Tobias Jakobi <tjakobi@math.uni-bielefeld.de> 2076 + * The INIC-3619 bridge is used in the StarTech SLSODDU33B 2077 + * SATA-USB enclosure for slimline optical drives. 2078 + * 2079 + * The quirk enables MakeMKV to properly exchange keys with 2080 + * an installed BD drive. 2081 + */ 2082 + UNUSUAL_DEV( 0x13fd, 0x3609, 0x0209, 0x0209, 2083 + "Initio Corporation", 2084 + "INIC-3619", 2085 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2086 + US_FL_IGNORE_RESIDUE ), 2087 + 2074 2088 /* Reported by Qinglin Ye <yestyle@gmail.com> */ 2075 2089 UNUSUAL_DEV( 0x13fe, 0x3600, 0x0100, 0x0100, 2076 2090 "Kingston",