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

Pull USB fixes from Greg KH:
"Here are a few USB fixes for 4.5-rc6

They fix a reported bug for some USB 3 devices by reverting the recent
patch, a MAINTAINERS change for some drivers, some new device ids, and
of course, the usual bunch of USB gadget driver fixes.

All have been in linux-next for a while with no reported issues"

* tag 'usb-4.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
MAINTAINERS: drop OMAP USB and MUSB maintainership
usb: musb: fix DMA for host mode
usb: phy: msm: Trigger USB state detection work in DRD mode
usb: gadget: net2280: fix endpoint max packet for super speed connections
usb: gadget: gadgetfs: unregister gadget only if it got successfully registered
usb: gadget: remove driver from pending list on probe error
Revert "usb: hub: do not clear BOS field during reset device"
usb: chipidea: fix return value check in ci_hdrc_pci_probe()
usb: chipidea: error on overflow for port_test_write
USB: option: add "4G LTE usb-modem U901"
USB: cp210x: add IDs for GE B650V3 and B850V3 boards
USB: option: add support for SIM7100E
usb: musb: Fix DMA desired mode for Mentor DMA engine
usb: gadget: fsl_qe_udc: fix IS_ERR_VALUE usage
usb: dwc2: USB_DWC2 should depend on HAS_DMA
usb: dwc2: host: fix the data toggle error in full speed descriptor dma
usb: dwc2: host: fix logical omissions in dwc2_process_non_isoc_desc
usb: dwc3: Fix assignment of EP transfer resources
usb: dwc2: Add extra delay when forcing dr_mode

+127 -75
+2 -5
MAINTAINERS
··· 3451 3451 DESIGNWARE USB3 DRD IP DRIVER 3452 3452 M: Felipe Balbi <balbi@kernel.org> 3453 3453 L: linux-usb@vger.kernel.org 3454 - L: linux-omap@vger.kernel.org 3455 3454 T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 3456 3455 S: Maintained 3457 3456 F: drivers/usb/dwc3/ ··· 7360 7361 F: include/linux/isicom.h 7361 7362 7362 7363 MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER 7363 - M: Felipe Balbi <balbi@kernel.org> 7364 + M: Bin Liu <b-liu@ti.com> 7364 7365 L: linux-usb@vger.kernel.org 7365 7366 T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 7366 7367 S: Maintained ··· 7929 7930 F: drivers/staging/media/omap4iss/ 7930 7931 7931 7932 OMAP USB SUPPORT 7932 - M: Felipe Balbi <balbi@kernel.org> 7933 7933 L: linux-usb@vger.kernel.org 7934 7934 L: linux-omap@vger.kernel.org 7935 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 7936 - S: Maintained 7935 + S: Orphan 7937 7936 F: drivers/usb/*/*omap* 7938 7937 F: arch/arm/*omap*/usb* 7939 7938
+2 -2
drivers/usb/chipidea/ci_hdrc_pci.c
··· 85 85 86 86 /* register a nop PHY */ 87 87 ci->phy = usb_phy_generic_register(); 88 - if (!ci->phy) 89 - return -ENOMEM; 88 + if (IS_ERR(ci->phy)) 89 + return PTR_ERR(ci->phy); 90 90 91 91 memset(res, 0, sizeof(res)); 92 92 res[0].start = pci_resource_start(pdev, 0);
+3
drivers/usb/chipidea/debug.c
··· 100 100 if (sscanf(buf, "%u", &mode) != 1) 101 101 return -EINVAL; 102 102 103 + if (mode > 255) 104 + return -EBADRQC; 105 + 103 106 pm_runtime_get_sync(ci->dev); 104 107 spin_lock_irqsave(&ci->lock, flags); 105 108 ret = hw_port_test_set(ci, mode);
+3 -5
drivers/usb/core/hub.c
··· 5401 5401 } 5402 5402 5403 5403 bos = udev->bos; 5404 + udev->bos = NULL; 5404 5405 5405 5406 for (i = 0; i < SET_CONFIG_TRIES; ++i) { 5406 5407 ··· 5494 5493 usb_set_usb2_hardware_lpm(udev, 1); 5495 5494 usb_unlocked_enable_lpm(udev); 5496 5495 usb_enable_ltm(udev); 5497 - /* release the new BOS descriptor allocated by hub_port_init() */ 5498 - if (udev->bos != bos) { 5499 - usb_release_bos_descriptor(udev); 5500 - udev->bos = bos; 5501 - } 5496 + usb_release_bos_descriptor(udev); 5497 + udev->bos = bos; 5502 5498 return 0; 5503 5499 5504 5500 re_enumerate:
+1
drivers/usb/dwc2/Kconfig
··· 1 1 config USB_DWC2 2 2 tristate "DesignWare USB2 DRD Core Support" 3 + depends on HAS_DMA 3 4 depends on USB || USB_GADGET 4 5 help 5 6 Say Y here if your system has a Dual Role Hi-Speed USB
+6
drivers/usb/dwc2/core.c
··· 619 619 __func__, hsotg->dr_mode); 620 620 break; 621 621 } 622 + 623 + /* 624 + * NOTE: This is required for some rockchip soc based 625 + * platforms. 626 + */ 627 + msleep(50); 622 628 } 623 629 624 630 /*
+11 -12
drivers/usb/dwc2/hcd_ddma.c
··· 1174 1174 failed = dwc2_update_non_isoc_urb_state_ddma(hsotg, chan, qtd, dma_desc, 1175 1175 halt_status, n_bytes, 1176 1176 xfer_done); 1177 - if (*xfer_done && urb->status != -EINPROGRESS) 1178 - failed = 1; 1179 - 1180 - if (failed) { 1177 + if (failed || (*xfer_done && urb->status != -EINPROGRESS)) { 1181 1178 dwc2_host_complete(hsotg, qtd, urb->status); 1182 1179 dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh); 1183 - dev_vdbg(hsotg->dev, "failed=%1x xfer_done=%1x status=%08x\n", 1184 - failed, *xfer_done, urb->status); 1180 + dev_vdbg(hsotg->dev, "failed=%1x xfer_done=%1x\n", 1181 + failed, *xfer_done); 1185 1182 return failed; 1186 1183 } 1187 1184 ··· 1233 1236 1234 1237 list_for_each_safe(qtd_item, qtd_tmp, &qh->qtd_list) { 1235 1238 int i; 1239 + int qtd_desc_count; 1236 1240 1237 1241 qtd = list_entry(qtd_item, struct dwc2_qtd, qtd_list_entry); 1238 1242 xfer_done = 0; 1243 + qtd_desc_count = qtd->n_desc; 1239 1244 1240 - for (i = 0; i < qtd->n_desc; i++) { 1245 + for (i = 0; i < qtd_desc_count; i++) { 1241 1246 if (dwc2_process_non_isoc_desc(hsotg, chan, chnum, qtd, 1242 1247 desc_num, halt_status, 1243 - &xfer_done)) { 1244 - qtd = NULL; 1245 - break; 1246 - } 1248 + &xfer_done)) 1249 + goto stop_scan; 1250 + 1247 1251 desc_num++; 1248 1252 } 1249 1253 } 1250 1254 1255 + stop_scan: 1251 1256 if (qh->ep_type != USB_ENDPOINT_XFER_CONTROL) { 1252 1257 /* 1253 1258 * Resetting the data toggle for bulk and interrupt endpoints ··· 1257 1258 */ 1258 1259 if (halt_status == DWC2_HC_XFER_STALL) 1259 1260 qh->data_toggle = DWC2_HC_PID_DATA0; 1260 - else if (qtd) 1261 + else 1261 1262 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); 1262 1263 } 1263 1264
+8
drivers/usb/dwc2/hcd_intr.c
··· 525 525 u32 pid = (hctsiz & TSIZ_SC_MC_PID_MASK) >> TSIZ_SC_MC_PID_SHIFT; 526 526 527 527 if (chan->ep_type != USB_ENDPOINT_XFER_CONTROL) { 528 + if (WARN(!chan || !chan->qh, 529 + "chan->qh must be specified for non-control eps\n")) 530 + return; 531 + 528 532 if (pid == TSIZ_SC_MC_PID_DATA0) 529 533 chan->qh->data_toggle = DWC2_HC_PID_DATA0; 530 534 else 531 535 chan->qh->data_toggle = DWC2_HC_PID_DATA1; 532 536 } else { 537 + if (WARN(!qtd, 538 + "qtd must be specified for control eps\n")) 539 + return; 540 + 533 541 if (pid == TSIZ_SC_MC_PID_DATA0) 534 542 qtd->data_toggle = DWC2_HC_PID_DATA0; 535 543 else
-1
drivers/usb/dwc3/core.h
··· 856 856 unsigned pullups_connected:1; 857 857 unsigned resize_fifos:1; 858 858 unsigned setup_packet_pending:1; 859 - unsigned start_config_issued:1; 860 859 unsigned three_stage_setup:1; 861 860 unsigned usb3_lpm_capable:1; 862 861
-5
drivers/usb/dwc3/ep0.c
··· 555 555 int ret; 556 556 u32 reg; 557 557 558 - dwc->start_config_issued = false; 559 558 cfg = le16_to_cpu(ctrl->wValue); 560 559 561 560 switch (state) { ··· 736 737 dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_ISOCH_DELAY"); 737 738 ret = dwc3_ep0_set_isoch_delay(dwc, ctrl); 738 739 break; 739 - case USB_REQ_SET_INTERFACE: 740 - dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_INTERFACE"); 741 - dwc->start_config_issued = false; 742 - /* Fall through */ 743 740 default: 744 741 dwc3_trace(trace_dwc3_ep0, "Forwarding to gadget driver"); 745 742 ret = dwc3_ep0_delegate_req(dwc, ctrl);
+52 -18
drivers/usb/dwc3/gadget.c
··· 385 385 dep->trb_pool_dma = 0; 386 386 } 387 387 388 + static int dwc3_gadget_set_xfer_resource(struct dwc3 *dwc, struct dwc3_ep *dep); 389 + 390 + /** 391 + * dwc3_gadget_start_config - Configure EP resources 392 + * @dwc: pointer to our controller context structure 393 + * @dep: endpoint that is being enabled 394 + * 395 + * The assignment of transfer resources cannot perfectly follow the 396 + * data book due to the fact that the controller driver does not have 397 + * all knowledge of the configuration in advance. It is given this 398 + * information piecemeal by the composite gadget framework after every 399 + * SET_CONFIGURATION and SET_INTERFACE. Trying to follow the databook 400 + * programming model in this scenario can cause errors. For two 401 + * reasons: 402 + * 403 + * 1) The databook says to do DEPSTARTCFG for every SET_CONFIGURATION 404 + * and SET_INTERFACE (8.1.5). This is incorrect in the scenario of 405 + * multiple interfaces. 406 + * 407 + * 2) The databook does not mention doing more DEPXFERCFG for new 408 + * endpoint on alt setting (8.1.6). 409 + * 410 + * The following simplified method is used instead: 411 + * 412 + * All hardware endpoints can be assigned a transfer resource and this 413 + * setting will stay persistent until either a core reset or 414 + * hibernation. So whenever we do a DEPSTARTCFG(0) we can go ahead and 415 + * do DEPXFERCFG for every hardware endpoint as well. We are 416 + * guaranteed that there are as many transfer resources as endpoints. 417 + * 418 + * This function is called for each endpoint when it is being enabled 419 + * but is triggered only when called for EP0-out, which always happens 420 + * first, and which should only happen in one of the above conditions. 421 + */ 388 422 static int dwc3_gadget_start_config(struct dwc3 *dwc, struct dwc3_ep *dep) 389 423 { 390 424 struct dwc3_gadget_ep_cmd_params params; 391 425 u32 cmd; 426 + int i; 427 + int ret; 428 + 429 + if (dep->number) 430 + return 0; 392 431 393 432 memset(&params, 0x00, sizeof(params)); 433 + cmd = DWC3_DEPCMD_DEPSTARTCFG; 394 434 395 - if (dep->number != 1) { 396 - cmd = DWC3_DEPCMD_DEPSTARTCFG; 397 - /* XferRscIdx == 0 for ep0 and 2 for the remaining */ 398 - if (dep->number > 1) { 399 - if (dwc->start_config_issued) 400 - return 0; 401 - dwc->start_config_issued = true; 402 - cmd |= DWC3_DEPCMD_PARAM(2); 403 - } 435 + ret = dwc3_send_gadget_ep_cmd(dwc, 0, cmd, &params); 436 + if (ret) 437 + return ret; 404 438 405 - return dwc3_send_gadget_ep_cmd(dwc, 0, cmd, &params); 439 + for (i = 0; i < DWC3_ENDPOINTS_NUM; i++) { 440 + struct dwc3_ep *dep = dwc->eps[i]; 441 + 442 + if (!dep) 443 + continue; 444 + 445 + ret = dwc3_gadget_set_xfer_resource(dwc, dep); 446 + if (ret) 447 + return ret; 406 448 } 407 449 408 450 return 0; ··· 557 515 if (!(dep->flags & DWC3_EP_ENABLED)) { 558 516 struct dwc3_trb *trb_st_hw; 559 517 struct dwc3_trb *trb_link; 560 - 561 - ret = dwc3_gadget_set_xfer_resource(dwc, dep); 562 - if (ret) 563 - return ret; 564 518 565 519 dep->endpoint.desc = desc; 566 520 dep->comp_desc = comp_desc; ··· 1674 1636 } 1675 1637 dwc3_writel(dwc->regs, DWC3_DCFG, reg); 1676 1638 1677 - dwc->start_config_issued = false; 1678 - 1679 1639 /* Start with SuperSpeed Default */ 1680 1640 dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); 1681 1641 ··· 2273 2237 dwc3_writel(dwc->regs, DWC3_DCTL, reg); 2274 2238 2275 2239 dwc3_disconnect_gadget(dwc); 2276 - dwc->start_config_issued = false; 2277 2240 2278 2241 dwc->gadget.speed = USB_SPEED_UNKNOWN; 2279 2242 dwc->setup_packet_pending = false; ··· 2323 2288 2324 2289 dwc3_stop_active_transfers(dwc); 2325 2290 dwc3_clear_stall_all_ep(dwc); 2326 - dwc->start_config_issued = false; 2327 2291 2328 2292 /* Reset device address to zero */ 2329 2293 reg = dwc3_readl(dwc->regs, DWC3_DCFG);
+5 -2
drivers/usb/gadget/legacy/inode.c
··· 130 130 setup_can_stall : 1, 131 131 setup_out_ready : 1, 132 132 setup_out_error : 1, 133 - setup_abort : 1; 133 + setup_abort : 1, 134 + gadget_registered : 1; 134 135 unsigned setup_wLength; 135 136 136 137 /* the rest is basically write-once */ ··· 1180 1179 1181 1180 /* closing ep0 === shutdown all */ 1182 1181 1183 - usb_gadget_unregister_driver (&gadgetfs_driver); 1182 + if (dev->gadget_registered) 1183 + usb_gadget_unregister_driver (&gadgetfs_driver); 1184 1184 1185 1185 /* at this point "good" hardware has disconnected the 1186 1186 * device from USB; the host won't see it any more. ··· 1849 1847 * kick in after the ep0 descriptor is closed. 1850 1848 */ 1851 1849 value = len; 1850 + dev->gadget_registered = true; 1852 1851 } 1853 1852 return value; 1854 1853
+1 -1
drivers/usb/gadget/udc/fsl_qe_udc.c
··· 2340 2340 { 2341 2341 struct qe_udc *udc; 2342 2342 struct device_node *np = ofdev->dev.of_node; 2343 - unsigned int tmp_addr = 0; 2343 + unsigned long tmp_addr = 0; 2344 2344 struct usb_device_para __iomem *usbpram; 2345 2345 unsigned int i; 2346 2346 u64 size;
+13 -2
drivers/usb/gadget/udc/net2280.h
··· 369 369 static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80, 370 370 0x50, 0x20, 0x70, 0x40, 0x90 }; 371 371 372 - if (ep->dev->enhanced_mode) 372 + if (ep->dev->enhanced_mode) { 373 373 reg = ep_enhanced[ep->num]; 374 - else{ 374 + switch (ep->dev->gadget.speed) { 375 + case USB_SPEED_SUPER: 376 + reg += 2; 377 + break; 378 + case USB_SPEED_FULL: 379 + reg += 1; 380 + break; 381 + case USB_SPEED_HIGH: 382 + default: 383 + break; 384 + } 385 + } else { 375 386 reg = (ep->num + 1) * 0x10; 376 387 if (ep->dev->gadget.speed != USB_SPEED_HIGH) 377 388 reg += 1;
+2 -1
drivers/usb/gadget/udc/udc-core.c
··· 413 413 if (!driver->udc_name || strcmp(driver->udc_name, 414 414 dev_name(&udc->dev)) == 0) { 415 415 ret = udc_bind_to_driver(udc, driver); 416 + if (ret != -EPROBE_DEFER) 417 + list_del(&driver->pending); 416 418 if (ret) 417 419 goto err4; 418 - list_del(&driver->pending); 419 420 break; 420 421 } 421 422 }
+3 -5
drivers/usb/musb/musb_host.c
··· 662 662 csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAMODE); 663 663 csr |= MUSB_TXCSR_DMAENAB; /* against programmer's guide */ 664 664 } 665 - channel->desired_mode = mode; 665 + channel->desired_mode = *mode; 666 666 musb_writew(epio, MUSB_TXCSR, csr); 667 667 668 668 return 0; ··· 2003 2003 qh->offset, 2004 2004 urb->transfer_buffer_length); 2005 2005 2006 - done = musb_rx_dma_in_inventra_cppi41(c, hw_ep, qh, 2007 - urb, xfer_len, 2008 - iso_err); 2009 - if (done) 2006 + if (musb_rx_dma_in_inventra_cppi41(c, hw_ep, qh, urb, 2007 + xfer_len, iso_err)) 2010 2008 goto finish; 2011 2009 else 2012 2010 dev_err(musb->controller, "error: rx_dma failed\n");
+4 -16
drivers/usb/phy/phy-msm-usb.c
··· 757 757 otg->host = host; 758 758 dev_dbg(otg->usb_phy->dev, "host driver registered w/ tranceiver\n"); 759 759 760 - /* 761 - * Kick the state machine work, if peripheral is not supported 762 - * or peripheral is already registered with us. 763 - */ 764 - if (motg->pdata->mode == USB_DR_MODE_HOST || otg->gadget) { 765 - pm_runtime_get_sync(otg->usb_phy->dev); 766 - schedule_work(&motg->sm_work); 767 - } 760 + pm_runtime_get_sync(otg->usb_phy->dev); 761 + schedule_work(&motg->sm_work); 768 762 769 763 return 0; 770 764 } ··· 821 827 dev_dbg(otg->usb_phy->dev, 822 828 "peripheral driver registered w/ tranceiver\n"); 823 829 824 - /* 825 - * Kick the state machine work, if host is not supported 826 - * or host is already registered with us. 827 - */ 828 - if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL || otg->host) { 829 - pm_runtime_get_sync(otg->usb_phy->dev); 830 - schedule_work(&motg->sm_work); 831 - } 830 + pm_runtime_get_sync(otg->usb_phy->dev); 831 + schedule_work(&motg->sm_work); 832 832 833 833 return 0; 834 834 }
+2
drivers/usb/serial/cp210x.c
··· 163 163 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ 164 164 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ 165 165 { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ 166 + { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ 167 + { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ 166 168 { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ 167 169 { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ 168 170 { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */
+9
drivers/usb/serial/option.c
··· 315 315 #define TOSHIBA_PRODUCT_G450 0x0d45 316 316 317 317 #define ALINK_VENDOR_ID 0x1e0e 318 + #define SIMCOM_PRODUCT_SIM7100E 0x9001 /* Yes, ALINK_VENDOR_ID */ 318 319 #define ALINK_PRODUCT_PH300 0x9100 319 320 #define ALINK_PRODUCT_3GU 0x9200 320 321 ··· 606 605 607 606 static const struct option_blacklist_info zte_1255_blacklist = { 608 607 .reserved = BIT(3) | BIT(4), 608 + }; 609 + 610 + static const struct option_blacklist_info simcom_sim7100e_blacklist = { 611 + .reserved = BIT(5) | BIT(6), 609 612 }; 610 613 611 614 static const struct option_blacklist_info telit_le910_blacklist = { ··· 1127 1122 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, 1128 1123 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, 1129 1124 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ 1125 + { USB_DEVICE_AND_INTERFACE_INFO(QUALCOMM_VENDOR_ID, 0x6001, 0xff, 0xff, 0xff), /* 4G LTE usb-modem U901 */ 1126 + .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 1130 1127 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ 1131 1128 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ 1132 1129 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ ··· 1652 1645 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, 1653 1646 { USB_DEVICE(ALINK_VENDOR_ID, ALINK_PRODUCT_PH300) }, 1654 1647 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, 1648 + { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E), 1649 + .driver_info = (kernel_ulong_t)&simcom_sim7100e_blacklist }, 1655 1650 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), 1656 1651 .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist 1657 1652 },