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

Pull USB fixes from Greg KH:
"Here are some USB driver fixes for 4.3-rc3.

There's the usual assortment of new device ids, combined with xhci and
gadget driver fixes. Full details in the shortlog. All of these have
been in linux-next with no reported problems"

* tag 'usb-4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (34 commits)
MAINTAINERS: remove amd5536udc USB gadget driver maintainer
USB: whiteheat: fix potential null-deref at probe
xhci: init command timeout timer earlier to avoid deleting it uninitialized
xhci: change xhci 1.0 only restrictions to support xhci 1.1
usb: xhci: exit early in xhci_setup_device() if we're halted or dying
usb: xhci: stop everything on the first call to xhci_stop
usb: xhci: Clear XHCI_STATE_DYING on start
usb: xhci: lock mutex on xhci_stop
xhci: Move xhci_pme_quirk() behind #ifdef CONFIG_PM
xhci: give command abortion one more chance before killing xhci
usb: Use the USB_SS_MULT() macro to get the burst multiplier.
usb: dwc3: gadget: Fix BUG in RT config
usb: musb: fix cppi channel teardown for isoch transfer
usb: phy: isp1301: Export I2C module alias information
usb: gadget: drop null test before destroy functions
usb: gadget: dummy_hcd: in transfer(), return data sent, not limit
usb: gadget: dummy_hcd: fix rescan logic for transfer
usb: gadget: dummy_hcd: fix unneeded else-if condition
usb: gadget: dummy_hcd: emulate sending zlp in packet logic
usb: musb: dsps: fix polling in device-only mode
...

+288 -177
+1
Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
··· 6 6 "lsi,zevio-usb" 7 7 "qcom,ci-hdrc" 8 8 "chipidea,usb2" 9 + "xlnx,zynq-usb-2.20a" 9 10 - reg: base address and length of the registers 10 11 - interrupts: interrupt for the USB controller 11 12
+1 -2
MAINTAINERS
··· 615 615 F: drivers/hwmon/fam15h_power.c 616 616 617 617 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER 618 - M: Thomas Dahlmann <dahlmann.thomas@arcor.de> 619 618 L: linux-geode@lists.infradead.org (moderated for non-subscribers) 620 - S: Supported 619 + S: Orphan 621 620 F: drivers/usb/gadget/udc/amd5536udc.* 622 621 623 622 AMD GEODE PROCESSOR/CHIPSET SUPPORT
+1 -1
drivers/usb/chipidea/ci_hdrc_imx.c
··· 61 61 { .compatible = "fsl,imx27-usb", .data = &imx27_usb_data}, 62 62 { .compatible = "fsl,imx6q-usb", .data = &imx6q_usb_data}, 63 63 { .compatible = "fsl,imx6sl-usb", .data = &imx6sl_usb_data}, 64 - { .compatible = "fsl,imx6sx-usb", .data = &imx6sl_usb_data}, 64 + { .compatible = "fsl,imx6sx-usb", .data = &imx6sx_usb_data}, 65 65 { /* sentinel */ } 66 66 }; 67 67 MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids);
+19 -6
drivers/usb/chipidea/ci_hdrc_usb2.c
··· 12 12 #include <linux/dma-mapping.h> 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 + #include <linux/of_platform.h> 15 16 #include <linux/phy/phy.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/usb/chipidea.h> ··· 31 30 .flags = CI_HDRC_DISABLE_STREAMING, 32 31 }; 33 32 33 + static struct ci_hdrc_platform_data ci_zynq_pdata = { 34 + .capoffset = DEF_CAPOFFSET, 35 + }; 36 + 37 + static const struct of_device_id ci_hdrc_usb2_of_match[] = { 38 + { .compatible = "chipidea,usb2"}, 39 + { .compatible = "xlnx,zynq-usb-2.20a", .data = &ci_zynq_pdata}, 40 + { } 41 + }; 42 + MODULE_DEVICE_TABLE(of, ci_hdrc_usb2_of_match); 43 + 34 44 static int ci_hdrc_usb2_probe(struct platform_device *pdev) 35 45 { 36 46 struct device *dev = &pdev->dev; 37 47 struct ci_hdrc_usb2_priv *priv; 38 48 struct ci_hdrc_platform_data *ci_pdata = dev_get_platdata(dev); 39 49 int ret; 50 + const struct of_device_id *match; 40 51 41 52 if (!ci_pdata) { 42 53 ci_pdata = devm_kmalloc(dev, sizeof(*ci_pdata), GFP_KERNEL); 43 54 *ci_pdata = ci_default_pdata; /* struct copy */ 55 + } 56 + 57 + match = of_match_device(ci_hdrc_usb2_of_match, &pdev->dev); 58 + if (match && match->data) { 59 + /* struct copy */ 60 + *ci_pdata = *(struct ci_hdrc_platform_data *)match->data; 44 61 } 45 62 46 63 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 114 95 115 96 return 0; 116 97 } 117 - 118 - static const struct of_device_id ci_hdrc_usb2_of_match[] = { 119 - { .compatible = "chipidea,usb2" }, 120 - { } 121 - }; 122 - MODULE_DEVICE_TABLE(of, ci_hdrc_usb2_of_match); 123 98 124 99 static struct platform_driver ci_hdrc_usb2_driver = { 125 100 .probe = ci_hdrc_usb2_probe,
+44 -40
drivers/usb/chipidea/udc.c
··· 656 656 return 0; 657 657 } 658 658 659 + static int _ep_set_halt(struct usb_ep *ep, int value, bool check_transfer) 660 + { 661 + struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); 662 + int direction, retval = 0; 663 + unsigned long flags; 664 + 665 + if (ep == NULL || hwep->ep.desc == NULL) 666 + return -EINVAL; 667 + 668 + if (usb_endpoint_xfer_isoc(hwep->ep.desc)) 669 + return -EOPNOTSUPP; 670 + 671 + spin_lock_irqsave(hwep->lock, flags); 672 + 673 + if (value && hwep->dir == TX && check_transfer && 674 + !list_empty(&hwep->qh.queue) && 675 + !usb_endpoint_xfer_control(hwep->ep.desc)) { 676 + spin_unlock_irqrestore(hwep->lock, flags); 677 + return -EAGAIN; 678 + } 679 + 680 + direction = hwep->dir; 681 + do { 682 + retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value); 683 + 684 + if (!value) 685 + hwep->wedge = 0; 686 + 687 + if (hwep->type == USB_ENDPOINT_XFER_CONTROL) 688 + hwep->dir = (hwep->dir == TX) ? RX : TX; 689 + 690 + } while (hwep->dir != direction); 691 + 692 + spin_unlock_irqrestore(hwep->lock, flags); 693 + return retval; 694 + } 695 + 696 + 659 697 /** 660 698 * _gadget_stop_activity: stops all USB activity, flushes & disables all endpts 661 699 * @gadget: gadget ··· 1089 1051 num += ci->hw_ep_max / 2; 1090 1052 1091 1053 spin_unlock(&ci->lock); 1092 - err = usb_ep_set_halt(&ci->ci_hw_ep[num].ep); 1054 + err = _ep_set_halt(&ci->ci_hw_ep[num].ep, 1, false); 1093 1055 spin_lock(&ci->lock); 1094 1056 if (!err) 1095 1057 isr_setup_status_phase(ci); ··· 1155 1117 1156 1118 if (err < 0) { 1157 1119 spin_unlock(&ci->lock); 1158 - if (usb_ep_set_halt(&hwep->ep)) 1159 - dev_err(ci->dev, "error: ep_set_halt\n"); 1120 + if (_ep_set_halt(&hwep->ep, 1, false)) 1121 + dev_err(ci->dev, "error: _ep_set_halt\n"); 1160 1122 spin_lock(&ci->lock); 1161 1123 } 1162 1124 } ··· 1187 1149 err = isr_setup_status_phase(ci); 1188 1150 if (err < 0) { 1189 1151 spin_unlock(&ci->lock); 1190 - if (usb_ep_set_halt(&hwep->ep)) 1152 + if (_ep_set_halt(&hwep->ep, 1, false)) 1191 1153 dev_err(ci->dev, 1192 - "error: ep_set_halt\n"); 1154 + "error: _ep_set_halt\n"); 1193 1155 spin_lock(&ci->lock); 1194 1156 } 1195 1157 } ··· 1435 1397 */ 1436 1398 static int ep_set_halt(struct usb_ep *ep, int value) 1437 1399 { 1438 - struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); 1439 - int direction, retval = 0; 1440 - unsigned long flags; 1441 - 1442 - if (ep == NULL || hwep->ep.desc == NULL) 1443 - return -EINVAL; 1444 - 1445 - if (usb_endpoint_xfer_isoc(hwep->ep.desc)) 1446 - return -EOPNOTSUPP; 1447 - 1448 - spin_lock_irqsave(hwep->lock, flags); 1449 - 1450 - #ifndef STALL_IN 1451 - /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */ 1452 - if (value && hwep->type == USB_ENDPOINT_XFER_BULK && hwep->dir == TX && 1453 - !list_empty(&hwep->qh.queue)) { 1454 - spin_unlock_irqrestore(hwep->lock, flags); 1455 - return -EAGAIN; 1456 - } 1457 - #endif 1458 - 1459 - direction = hwep->dir; 1460 - do { 1461 - retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value); 1462 - 1463 - if (!value) 1464 - hwep->wedge = 0; 1465 - 1466 - if (hwep->type == USB_ENDPOINT_XFER_CONTROL) 1467 - hwep->dir = (hwep->dir == TX) ? RX : TX; 1468 - 1469 - } while (hwep->dir != direction); 1470 - 1471 - spin_unlock_irqrestore(hwep->lock, flags); 1472 - return retval; 1400 + return _ep_set_halt(ep, value, true); 1473 1401 } 1474 1402 1475 1403 /**
+3 -2
drivers/usb/core/config.c
··· 112 112 cfgno, inum, asnum, ep->desc.bEndpointAddress); 113 113 ep->ss_ep_comp.bmAttributes = 16; 114 114 } else if (usb_endpoint_xfer_isoc(&ep->desc) && 115 - desc->bmAttributes > 2) { 115 + USB_SS_MULT(desc->bmAttributes) > 3) { 116 116 dev_warn(ddev, "Isoc endpoint has Mult of %d in " 117 117 "config %d interface %d altsetting %d ep %d: " 118 118 "setting to 3\n", desc->bmAttributes + 1, ··· 121 121 } 122 122 123 123 if (usb_endpoint_xfer_isoc(&ep->desc)) 124 - max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) * 124 + max_tx = (desc->bMaxBurst + 1) * 125 + (USB_SS_MULT(desc->bmAttributes)) * 125 126 usb_endpoint_maxp(&ep->desc); 126 127 else if (usb_endpoint_xfer_int(&ep->desc)) 127 128 max_tx = usb_endpoint_maxp(&ep->desc) *
+2 -2
drivers/usb/dwc3/dwc3-omap.c
··· 514 514 goto err1; 515 515 } 516 516 517 - dwc3_omap_enable_irqs(omap); 518 - 519 517 ret = dwc3_omap_extcon_register(omap); 520 518 if (ret < 0) 521 519 goto err2; ··· 523 525 dev_err(&pdev->dev, "failed to create dwc3 core\n"); 524 526 goto err3; 525 527 } 528 + 529 + dwc3_omap_enable_irqs(omap); 526 530 527 531 return 0; 528 532
-4
drivers/usb/dwc3/gadget.c
··· 2665 2665 int i; 2666 2666 irqreturn_t ret = IRQ_NONE; 2667 2667 2668 - spin_lock(&dwc->lock); 2669 - 2670 2668 for (i = 0; i < dwc->num_event_buffers; i++) { 2671 2669 irqreturn_t status; 2672 2670 ··· 2672 2674 if (status == IRQ_WAKE_THREAD) 2673 2675 ret = status; 2674 2676 } 2675 - 2676 - spin_unlock(&dwc->lock); 2677 2677 2678 2678 return ret; 2679 2679 }
+1
drivers/usb/gadget/epautoconf.c
··· 186 186 187 187 list_for_each_entry (ep, &gadget->ep_list, ep_list) { 188 188 ep->claimed = false; 189 + ep->driver_data = NULL; 189 190 } 190 191 gadget->in_epnum = 0; 191 192 gadget->out_epnum = 0;
+20 -23
drivers/usb/gadget/udc/amd5536udc.c
··· 3138 3138 writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg); 3139 3139 if (dev->irq_registered) 3140 3140 free_irq(pdev->irq, dev); 3141 - if (dev->regs) 3142 - iounmap(dev->regs); 3141 + if (dev->virt_addr) 3142 + iounmap(dev->virt_addr); 3143 3143 if (dev->mem_region) 3144 3144 release_mem_region(pci_resource_start(pdev, 0), 3145 3145 pci_resource_len(pdev, 0)); ··· 3226 3226 3227 3227 /* init */ 3228 3228 dev = kzalloc(sizeof(struct udc), GFP_KERNEL); 3229 - if (!dev) { 3230 - retval = -ENOMEM; 3231 - goto finished; 3232 - } 3229 + if (!dev) 3230 + return -ENOMEM; 3233 3231 3234 3232 /* pci setup */ 3235 3233 if (pci_enable_device(pdev) < 0) { 3236 - kfree(dev); 3237 - dev = NULL; 3238 3234 retval = -ENODEV; 3239 - goto finished; 3235 + goto err_pcidev; 3240 3236 } 3241 3237 dev->active = 1; 3242 3238 ··· 3242 3246 3243 3247 if (!request_mem_region(resource, len, name)) { 3244 3248 dev_dbg(&pdev->dev, "pci device used already\n"); 3245 - kfree(dev); 3246 - dev = NULL; 3247 3249 retval = -EBUSY; 3248 - goto finished; 3250 + goto err_memreg; 3249 3251 } 3250 3252 dev->mem_region = 1; 3251 3253 3252 3254 dev->virt_addr = ioremap_nocache(resource, len); 3253 3255 if (dev->virt_addr == NULL) { 3254 3256 dev_dbg(&pdev->dev, "start address cannot be mapped\n"); 3255 - kfree(dev); 3256 - dev = NULL; 3257 3257 retval = -EFAULT; 3258 - goto finished; 3258 + goto err_ioremap; 3259 3259 } 3260 3260 3261 3261 if (!pdev->irq) { 3262 3262 dev_err(&pdev->dev, "irq not set\n"); 3263 - kfree(dev); 3264 - dev = NULL; 3265 3263 retval = -ENODEV; 3266 - goto finished; 3264 + goto err_irq; 3267 3265 } 3268 3266 3269 3267 spin_lock_init(&dev->lock); ··· 3273 3283 3274 3284 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3275 3285 dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3276 - kfree(dev); 3277 - dev = NULL; 3278 3286 retval = -EBUSY; 3279 - goto finished; 3287 + goto err_irq; 3280 3288 } 3281 3289 dev->irq_registered = 1; 3282 3290 ··· 3302 3314 return 0; 3303 3315 3304 3316 finished: 3305 - if (dev) 3306 - udc_pci_remove(pdev); 3317 + udc_pci_remove(pdev); 3318 + return retval; 3319 + 3320 + err_irq: 3321 + iounmap(dev->virt_addr); 3322 + err_ioremap: 3323 + release_mem_region(resource, len); 3324 + err_memreg: 3325 + pci_disable_device(pdev); 3326 + err_pcidev: 3327 + kfree(dev); 3307 3328 return retval; 3308 3329 } 3309 3330
+11
drivers/usb/gadget/udc/atmel_usba_udc.c
··· 2002 2002 ep->udc = udc; 2003 2003 INIT_LIST_HEAD(&ep->queue); 2004 2004 2005 + if (ep->index == 0) { 2006 + ep->ep.caps.type_control = true; 2007 + } else { 2008 + ep->ep.caps.type_iso = ep->can_isoc; 2009 + ep->ep.caps.type_bulk = true; 2010 + ep->ep.caps.type_int = true; 2011 + } 2012 + 2013 + ep->ep.caps.dir_in = true; 2014 + ep->ep.caps.dir_out = true; 2015 + 2005 2016 if (i) 2006 2017 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); 2007 2018
+1 -2
drivers/usb/gadget/udc/bdc/bdc_core.c
··· 324 324 bdc->scratchpad.buff, bdc->scratchpad.sp_dma); 325 325 326 326 /* Destroy the dma pools */ 327 - if (bdc->bd_table_pool) 328 - dma_pool_destroy(bdc->bd_table_pool); 327 + dma_pool_destroy(bdc->bd_table_pool); 329 328 330 329 /* Free the bdc_ep array */ 331 330 kfree(bdc->bdc_ep_array);
+30 -16
drivers/usb/gadget/udc/dummy_hcd.c
··· 1348 1348 { 1349 1349 struct dummy *dum = dum_hcd->dum; 1350 1350 struct dummy_request *req; 1351 + int sent = 0; 1351 1352 1352 1353 top: 1353 1354 /* if there's no request queued, the device is NAKing; return */ ··· 1386 1385 if (len == 0) 1387 1386 break; 1388 1387 1389 - /* use an extra pass for the final short packet */ 1390 - if (len > ep->ep.maxpacket) { 1391 - rescan = 1; 1392 - len -= (len % ep->ep.maxpacket); 1388 + /* send multiple of maxpacket first, then remainder */ 1389 + if (len >= ep->ep.maxpacket) { 1390 + is_short = 0; 1391 + if (len % ep->ep.maxpacket) 1392 + rescan = 1; 1393 + len -= len % ep->ep.maxpacket; 1394 + } else { 1395 + is_short = 1; 1393 1396 } 1394 - is_short = (len % ep->ep.maxpacket) != 0; 1395 1397 1396 1398 len = dummy_perform_transfer(urb, req, len); 1397 1399 ··· 1403 1399 req->req.status = len; 1404 1400 } else { 1405 1401 limit -= len; 1402 + sent += len; 1406 1403 urb->actual_length += len; 1407 1404 req->req.actual += len; 1408 1405 } ··· 1426 1421 *status = -EOVERFLOW; 1427 1422 else 1428 1423 *status = 0; 1429 - } else if (!to_host) { 1424 + } else { 1430 1425 *status = 0; 1431 1426 if (host_len > dev_len) 1432 1427 req->req.status = -EOVERFLOW; ··· 1434 1429 req->req.status = 0; 1435 1430 } 1436 1431 1437 - /* many requests terminate without a short packet */ 1432 + /* 1433 + * many requests terminate without a short packet. 1434 + * send a zlp if demanded by flags. 1435 + */ 1438 1436 } else { 1439 - if (req->req.length == req->req.actual 1440 - && !req->req.zero) 1441 - req->req.status = 0; 1442 - if (urb->transfer_buffer_length == urb->actual_length 1443 - && !(urb->transfer_flags 1444 - & URB_ZERO_PACKET)) 1445 - *status = 0; 1437 + if (req->req.length == req->req.actual) { 1438 + if (req->req.zero && to_host) 1439 + rescan = 1; 1440 + else 1441 + req->req.status = 0; 1442 + } 1443 + if (urb->transfer_buffer_length == urb->actual_length) { 1444 + if (urb->transfer_flags & URB_ZERO_PACKET && 1445 + !to_host) 1446 + rescan = 1; 1447 + else 1448 + *status = 0; 1449 + } 1446 1450 } 1447 1451 1448 1452 /* device side completion --> continuable */ ··· 1474 1460 if (rescan) 1475 1461 goto top; 1476 1462 } 1477 - return limit; 1463 + return sent; 1478 1464 } 1479 1465 1480 1466 static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep) ··· 1904 1890 default: 1905 1891 treat_control_like_bulk: 1906 1892 ep->last_io = jiffies; 1907 - total = transfer(dum_hcd, urb, ep, limit, &status); 1893 + total -= transfer(dum_hcd, urb, ep, limit, &status); 1908 1894 break; 1909 1895 } 1910 1896
+1 -2
drivers/usb/gadget/udc/gr_udc.c
··· 2117 2117 return -EBUSY; 2118 2118 2119 2119 gr_dfs_delete(dev); 2120 - if (dev->desc_pool) 2121 - dma_pool_destroy(dev->desc_pool); 2120 + dma_pool_destroy(dev->desc_pool); 2122 2121 platform_set_drvdata(pdev, NULL); 2123 2122 2124 2123 gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);
+1 -2
drivers/usb/gadget/udc/mv_u3d_core.c
··· 1767 1767 usb_del_gadget_udc(&u3d->gadget); 1768 1768 1769 1769 /* free memory allocated in probe */ 1770 - if (u3d->trb_pool) 1771 - dma_pool_destroy(u3d->trb_pool); 1770 + dma_pool_destroy(u3d->trb_pool); 1772 1771 1773 1772 if (u3d->ep_context) 1774 1773 dma_free_coherent(&dev->dev, u3d->ep_context_size,
+1 -2
drivers/usb/gadget/udc/mv_udc_core.c
··· 2100 2100 } 2101 2101 2102 2102 /* free memory allocated in probe */ 2103 - if (udc->dtd_pool) 2104 - dma_pool_destroy(udc->dtd_pool); 2103 + dma_pool_destroy(udc->dtd_pool); 2105 2104 2106 2105 if (udc->ep_dqh) 2107 2106 dma_free_coherent(&pdev->dev, udc->ep_dqh_size,
+8 -9
drivers/usb/host/xhci-mem.c
··· 1498 1498 * use Event Data TRBs, and we don't chain in a link TRB on short 1499 1499 * transfers, we're basically dividing by 1. 1500 1500 * 1501 - * xHCI 1.0 specification indicates that the Average TRB Length should 1502 - * be set to 8 for control endpoints. 1501 + * xHCI 1.0 and 1.1 specification indicates that the Average TRB Length 1502 + * should be set to 8 for control endpoints. 1503 1503 */ 1504 - if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version == 0x100) 1504 + if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100) 1505 1505 ep_ctx->tx_info |= cpu_to_le32(AVG_TRB_LENGTH_FOR_EP(8)); 1506 1506 else 1507 1507 ep_ctx->tx_info |= ··· 1792 1792 int size; 1793 1793 int i, j, num_ports; 1794 1794 1795 - if (timer_pending(&xhci->cmd_timer)) 1796 - del_timer_sync(&xhci->cmd_timer); 1795 + del_timer_sync(&xhci->cmd_timer); 1797 1796 1798 1797 /* Free the Event Ring Segment Table and the actual Event Ring */ 1799 1798 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); ··· 2320 2321 2321 2322 INIT_LIST_HEAD(&xhci->cmd_list); 2322 2323 2324 + /* init command timeout timer */ 2325 + setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout, 2326 + (unsigned long)xhci); 2327 + 2323 2328 page_size = readl(&xhci->op_regs->page_size); 2324 2329 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2325 2330 "Supported page size register = 0x%x", page_size); ··· 2507 2504 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2508 2505 "Wrote ERST address to ir_set 0."); 2509 2506 xhci_print_ir_set(xhci, 0); 2510 - 2511 - /* init command timeout timer */ 2512 - setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout, 2513 - (unsigned long)xhci); 2514 2507 2515 2508 /* 2516 2509 * XXX: Might need to set the Interrupter Moderation Register to
+45 -45
drivers/usb/host/xhci-pci.c
··· 180 180 "QUIRK: Resetting on resume"); 181 181 } 182 182 183 - /* 184 - * In some Intel xHCI controllers, in order to get D3 working, 185 - * through a vendor specific SSIC CONFIG register at offset 0x883c, 186 - * SSIC PORT need to be marked as "unused" before putting xHCI 187 - * into D3. After D3 exit, the SSIC port need to be marked as "used". 188 - * Without this change, xHCI might not enter D3 state. 189 - * Make sure PME works on some Intel xHCI controllers by writing 1 to clear 190 - * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4 191 - */ 192 - static void xhci_pme_quirk(struct usb_hcd *hcd, bool suspend) 193 - { 194 - struct xhci_hcd *xhci = hcd_to_xhci(hcd); 195 - struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 196 - u32 val; 197 - void __iomem *reg; 198 - 199 - if (pdev->vendor == PCI_VENDOR_ID_INTEL && 200 - pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) { 201 - 202 - reg = (void __iomem *) xhci->cap_regs + PORT2_SSIC_CONFIG_REG2; 203 - 204 - /* Notify SSIC that SSIC profile programming is not done */ 205 - val = readl(reg) & ~PROG_DONE; 206 - writel(val, reg); 207 - 208 - /* Mark SSIC port as unused(suspend) or used(resume) */ 209 - val = readl(reg); 210 - if (suspend) 211 - val |= SSIC_PORT_UNUSED; 212 - else 213 - val &= ~SSIC_PORT_UNUSED; 214 - writel(val, reg); 215 - 216 - /* Notify SSIC that SSIC profile programming is done */ 217 - val = readl(reg) | PROG_DONE; 218 - writel(val, reg); 219 - readl(reg); 220 - } 221 - 222 - reg = (void __iomem *) xhci->cap_regs + 0x80a4; 223 - val = readl(reg); 224 - writel(val | BIT(28), reg); 225 - readl(reg); 226 - } 227 - 228 183 #ifdef CONFIG_ACPI 229 184 static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) 230 185 { ··· 300 345 } 301 346 302 347 #ifdef CONFIG_PM 348 + /* 349 + * In some Intel xHCI controllers, in order to get D3 working, 350 + * through a vendor specific SSIC CONFIG register at offset 0x883c, 351 + * SSIC PORT need to be marked as "unused" before putting xHCI 352 + * into D3. After D3 exit, the SSIC port need to be marked as "used". 353 + * Without this change, xHCI might not enter D3 state. 354 + * Make sure PME works on some Intel xHCI controllers by writing 1 to clear 355 + * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4 356 + */ 357 + static void xhci_pme_quirk(struct usb_hcd *hcd, bool suspend) 358 + { 359 + struct xhci_hcd *xhci = hcd_to_xhci(hcd); 360 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); 361 + u32 val; 362 + void __iomem *reg; 363 + 364 + if (pdev->vendor == PCI_VENDOR_ID_INTEL && 365 + pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) { 366 + 367 + reg = (void __iomem *) xhci->cap_regs + PORT2_SSIC_CONFIG_REG2; 368 + 369 + /* Notify SSIC that SSIC profile programming is not done */ 370 + val = readl(reg) & ~PROG_DONE; 371 + writel(val, reg); 372 + 373 + /* Mark SSIC port as unused(suspend) or used(resume) */ 374 + val = readl(reg); 375 + if (suspend) 376 + val |= SSIC_PORT_UNUSED; 377 + else 378 + val &= ~SSIC_PORT_UNUSED; 379 + writel(val, reg); 380 + 381 + /* Notify SSIC that SSIC profile programming is done */ 382 + val = readl(reg) | PROG_DONE; 383 + writel(val, reg); 384 + readl(reg); 385 + } 386 + 387 + reg = (void __iomem *) xhci->cap_regs + 0x80a4; 388 + val = readl(reg); 389 + writel(val | BIT(28), reg); 390 + readl(reg); 391 + } 392 + 303 393 static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) 304 394 { 305 395 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+11 -2
drivers/usb/host/xhci-ring.c
··· 302 302 ret = xhci_handshake(&xhci->op_regs->cmd_ring, 303 303 CMD_RING_RUNNING, 0, 5 * 1000 * 1000); 304 304 if (ret < 0) { 305 + /* we are about to kill xhci, give it one more chance */ 306 + xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, 307 + &xhci->op_regs->cmd_ring); 308 + udelay(1000); 309 + ret = xhci_handshake(&xhci->op_regs->cmd_ring, 310 + CMD_RING_RUNNING, 0, 3 * 1000 * 1000); 311 + if (ret == 0) 312 + return 0; 313 + 305 314 xhci_err(xhci, "Stopped the command ring failed, " 306 315 "maybe the host is dead\n"); 307 316 xhci->xhc_state |= XHCI_STATE_DYING; ··· 3470 3461 if (start_cycle == 0) 3471 3462 field |= 0x1; 3472 3463 3473 - /* xHCI 1.0 6.4.1.2.1: Transfer Type field */ 3474 - if (xhci->hci_version == 0x100) { 3464 + /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */ 3465 + if (xhci->hci_version >= 0x100) { 3475 3466 if (urb->transfer_buffer_length > 0) { 3476 3467 if (setup->bRequestType & USB_DIR_IN) 3477 3468 field |= TRB_TX_TYPE(TRB_DATA_IN);
+11 -13
drivers/usb/host/xhci.c
··· 146 146 "waited %u microseconds.\n", 147 147 XHCI_MAX_HALT_USEC); 148 148 if (!ret) 149 - xhci->xhc_state &= ~XHCI_STATE_HALTED; 149 + xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING); 150 + 150 151 return ret; 151 152 } 152 153 ··· 655 654 } 656 655 EXPORT_SYMBOL_GPL(xhci_run); 657 656 658 - static void xhci_only_stop_hcd(struct usb_hcd *hcd) 659 - { 660 - struct xhci_hcd *xhci = hcd_to_xhci(hcd); 661 - 662 - spin_lock_irq(&xhci->lock); 663 - xhci_halt(xhci); 664 - spin_unlock_irq(&xhci->lock); 665 - } 666 - 667 657 /* 668 658 * Stop xHCI driver. 669 659 * ··· 669 677 u32 temp; 670 678 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 671 679 672 - if (!usb_hcd_is_primary_hcd(hcd)) { 673 - xhci_only_stop_hcd(xhci->shared_hcd); 680 + if (xhci->xhc_state & XHCI_STATE_HALTED) 674 681 return; 675 - } 676 682 683 + mutex_lock(&xhci->mutex); 677 684 spin_lock_irq(&xhci->lock); 685 + xhci->xhc_state |= XHCI_STATE_HALTED; 686 + xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; 687 + 678 688 /* Make sure the xHC is halted for a USB3 roothub 679 689 * (xhci_stop() could be called as part of failed init). 680 690 */ ··· 711 717 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 712 718 "xhci_stop completed - status = %x", 713 719 readl(&xhci->op_regs->status)); 720 + mutex_unlock(&xhci->mutex); 714 721 } 715 722 716 723 /* ··· 3787 3792 struct xhci_command *command = NULL; 3788 3793 3789 3794 mutex_lock(&xhci->mutex); 3795 + 3796 + if (xhci->xhc_state) /* dying or halted */ 3797 + goto out; 3790 3798 3791 3799 if (!udev->slot_id) { 3792 3800 xhci_dbg_trace(xhci, trace_xhci_dbg_address,
+7
drivers/usb/musb/musb_core.c
··· 1051 1051 * (c) peripheral initiates, using SRP 1052 1052 */ 1053 1053 if (musb->port_mode != MUSB_PORT_MODE_HOST && 1054 + musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON && 1054 1055 (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) { 1055 1056 musb->is_active = 1; 1056 1057 } else { ··· 2449 2448 struct musb *musb = dev_to_musb(dev); 2450 2449 unsigned long flags; 2451 2450 2451 + musb_platform_disable(musb); 2452 + musb_generic_disable(musb); 2453 + 2452 2454 spin_lock_irqsave(&musb->lock, flags); 2453 2455 2454 2456 if (is_peripheral_active(musb)) { ··· 2505 2501 pm_runtime_disable(dev); 2506 2502 pm_runtime_set_active(dev); 2507 2503 pm_runtime_enable(dev); 2504 + 2505 + musb_start(musb); 2506 + 2508 2507 return 0; 2509 2508 } 2510 2509
+3
drivers/usb/musb/musb_cppi41.c
··· 551 551 } else { 552 552 cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE); 553 553 554 + /* delay to drain to cppi dma pipeline for isoch */ 555 + udelay(250); 556 + 554 557 csr = musb_readw(epio, MUSB_RXCSR); 555 558 csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB); 556 559 musb_writew(epio, MUSB_RXCSR, csr);
+5 -2
drivers/usb/musb/musb_dsps.c
··· 225 225 226 226 dsps_writel(reg_base, wrp->epintr_set, epmask); 227 227 dsps_writel(reg_base, wrp->coreintr_set, coremask); 228 - /* start polling for ID change. */ 229 - mod_timer(&glue->timer, jiffies + msecs_to_jiffies(wrp->poll_timeout)); 228 + /* start polling for ID change in dual-role idle mode */ 229 + if (musb->xceiv->otg->state == OTG_STATE_B_IDLE && 230 + musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE) 231 + mod_timer(&glue->timer, jiffies + 232 + msecs_to_jiffies(wrp->poll_timeout)); 230 233 dsps_musb_try_idle(musb, 0); 231 234 } 232 235
+2
drivers/usb/musb/ux500.c
··· 379 379 {} 380 380 }; 381 381 382 + MODULE_DEVICE_TABLE(of, ux500_match); 383 + 382 384 static struct platform_driver ux500_driver = { 383 385 .probe = ux500_probe, 384 386 .remove = ux500_remove,
+1 -1
drivers/usb/phy/Kconfig
··· 155 155 config USB_QCOM_8X16_PHY 156 156 tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support" 157 157 depends on ARCH_QCOM || COMPILE_TEST 158 - depends on RESET_CONTROLLER 158 + depends on RESET_CONTROLLER && EXTCON 159 159 select USB_PHY 160 160 select USB_ULPI_VIEWPORT 161 161 help
+2 -1
drivers/usb/phy/phy-generic.c
··· 232 232 clk_rate = pdata->clk_rate; 233 233 needs_vcc = pdata->needs_vcc; 234 234 if (gpio_is_valid(pdata->gpio_reset)) { 235 - err = devm_gpio_request_one(dev, pdata->gpio_reset, 0, 235 + err = devm_gpio_request_one(dev, pdata->gpio_reset, 236 + GPIOF_ACTIVE_LOW, 236 237 dev_name(dev)); 237 238 if (!err) 238 239 nop->gpiod_reset =
+1
drivers/usb/phy/phy-isp1301.c
··· 31 31 { "isp1301", 0 }, 32 32 { } 33 33 }; 34 + MODULE_DEVICE_TABLE(i2c, isp1301_id); 34 35 35 36 static struct i2c_client *isp1301_i2c_client; 36 37
+24
drivers/usb/serial/option.c
··· 278 278 #define ZTE_PRODUCT_MF622 0x0001 279 279 #define ZTE_PRODUCT_MF628 0x0015 280 280 #define ZTE_PRODUCT_MF626 0x0031 281 + #define ZTE_PRODUCT_ZM8620_X 0x0396 282 + #define ZTE_PRODUCT_ME3620_MBIM 0x0426 283 + #define ZTE_PRODUCT_ME3620_X 0x1432 284 + #define ZTE_PRODUCT_ME3620_L 0x1433 281 285 #define ZTE_PRODUCT_AC2726 0xfff1 282 286 #define ZTE_PRODUCT_MG880 0xfffd 283 287 #define ZTE_PRODUCT_CDMA_TECH 0xfffe ··· 546 542 547 543 static const struct option_blacklist_info zte_mc2716_z_blacklist = { 548 544 .sendsetup = BIT(1) | BIT(2) | BIT(3), 545 + }; 546 + 547 + static const struct option_blacklist_info zte_me3620_mbim_blacklist = { 548 + .reserved = BIT(2) | BIT(3) | BIT(4), 549 + }; 550 + 551 + static const struct option_blacklist_info zte_me3620_xl_blacklist = { 552 + .reserved = BIT(3) | BIT(4) | BIT(5), 553 + }; 554 + 555 + static const struct option_blacklist_info zte_zm8620_x_blacklist = { 556 + .reserved = BIT(3) | BIT(4) | BIT(5), 549 557 }; 550 558 551 559 static const struct option_blacklist_info huawei_cdc12_blacklist = { ··· 1607 1591 .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, 1608 1592 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), 1609 1593 .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, 1594 + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L), 1595 + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, 1596 + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM), 1597 + .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist }, 1598 + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X), 1599 + .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist }, 1600 + { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X), 1601 + .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist }, 1610 1602 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, 1611 1603 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, 1612 1604 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
+31
drivers/usb/serial/whiteheat.c
··· 80 80 static int whiteheat_firmware_attach(struct usb_serial *serial); 81 81 82 82 /* function prototypes for the Connect Tech WhiteHEAT serial converter */ 83 + static int whiteheat_probe(struct usb_serial *serial, 84 + const struct usb_device_id *id); 83 85 static int whiteheat_attach(struct usb_serial *serial); 84 86 static void whiteheat_release(struct usb_serial *serial); 85 87 static int whiteheat_port_probe(struct usb_serial_port *port); ··· 118 116 .description = "Connect Tech - WhiteHEAT", 119 117 .id_table = id_table_std, 120 118 .num_ports = 4, 119 + .probe = whiteheat_probe, 121 120 .attach = whiteheat_attach, 122 121 .release = whiteheat_release, 123 122 .port_probe = whiteheat_port_probe, ··· 220 217 /***************************************************************************** 221 218 * Connect Tech's White Heat serial driver functions 222 219 *****************************************************************************/ 220 + 221 + static int whiteheat_probe(struct usb_serial *serial, 222 + const struct usb_device_id *id) 223 + { 224 + struct usb_host_interface *iface_desc; 225 + struct usb_endpoint_descriptor *endpoint; 226 + size_t num_bulk_in = 0; 227 + size_t num_bulk_out = 0; 228 + size_t min_num_bulk; 229 + unsigned int i; 230 + 231 + iface_desc = serial->interface->cur_altsetting; 232 + 233 + for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) { 234 + endpoint = &iface_desc->endpoint[i].desc; 235 + if (usb_endpoint_is_bulk_in(endpoint)) 236 + ++num_bulk_in; 237 + if (usb_endpoint_is_bulk_out(endpoint)) 238 + ++num_bulk_out; 239 + } 240 + 241 + min_num_bulk = COMMAND_PORT + 1; 242 + if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk) 243 + return -ENODEV; 244 + 245 + return 0; 246 + } 247 + 223 248 static int whiteheat_attach(struct usb_serial *serial) 224 249 { 225 250 struct usb_serial_port *command_port;