diff options
| -rw-r--r-- | MAINTAINERS | 7 | ||||
| -rw-r--r-- | drivers/usb/chipidea/ci_hdrc_pci.c | 4 | ||||
| -rw-r--r-- | drivers/usb/chipidea/debug.c | 3 | ||||
| -rw-r--r-- | drivers/usb/core/hub.c | 8 | ||||
| -rw-r--r-- | drivers/usb/dwc2/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/usb/dwc2/core.c | 6 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd_ddma.c | 23 | ||||
| -rw-r--r-- | drivers/usb/dwc2/hcd_intr.c | 8 | ||||
| -rw-r--r-- | drivers/usb/dwc3/core.h | 1 | ||||
| -rw-r--r-- | drivers/usb/dwc3/ep0.c | 5 | ||||
| -rw-r--r-- | drivers/usb/dwc3/gadget.c | 70 | ||||
| -rw-r--r-- | drivers/usb/gadget/legacy/inode.c | 7 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/fsl_qe_udc.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/net2280.h | 15 | ||||
| -rw-r--r-- | drivers/usb/gadget/udc/udc-core.c | 3 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_host.c | 8 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-msm-usb.c | 20 | ||||
| -rw-r--r-- | drivers/usb/serial/cp210x.c | 2 | ||||
| -rw-r--r-- | drivers/usb/serial/option.c | 9 |
19 files changed, 127 insertions, 75 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index d0f225613f41..da3e4d8016d0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3451,7 +3451,6 @@ F: drivers/usb/dwc2/ | |||
| 3451 | DESIGNWARE USB3 DRD IP DRIVER | 3451 | DESIGNWARE USB3 DRD IP DRIVER |
| 3452 | M: Felipe Balbi <balbi@kernel.org> | 3452 | M: Felipe Balbi <balbi@kernel.org> |
| 3453 | L: linux-usb@vger.kernel.org | 3453 | L: linux-usb@vger.kernel.org |
| 3454 | L: linux-omap@vger.kernel.org | ||
| 3455 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git | 3454 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git |
| 3456 | S: Maintained | 3455 | S: Maintained |
| 3457 | F: drivers/usb/dwc3/ | 3456 | F: drivers/usb/dwc3/ |
| @@ -7361,7 +7360,7 @@ F: drivers/tty/isicom.c | |||
| 7361 | F: include/linux/isicom.h | 7360 | F: include/linux/isicom.h |
| 7362 | 7361 | ||
| 7363 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER | 7362 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER |
| 7364 | M: Felipe Balbi <balbi@kernel.org> | 7363 | M: Bin Liu <b-liu@ti.com> |
| 7365 | L: linux-usb@vger.kernel.org | 7364 | L: linux-usb@vger.kernel.org |
| 7366 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git | 7365 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git |
| 7367 | S: Maintained | 7366 | S: Maintained |
| @@ -7930,11 +7929,9 @@ F: drivers/media/platform/omap3isp/ | |||
| 7930 | F: drivers/staging/media/omap4iss/ | 7929 | F: drivers/staging/media/omap4iss/ |
| 7931 | 7930 | ||
| 7932 | OMAP USB SUPPORT | 7931 | OMAP USB SUPPORT |
| 7933 | M: Felipe Balbi <balbi@kernel.org> | ||
| 7934 | L: linux-usb@vger.kernel.org | 7932 | L: linux-usb@vger.kernel.org |
| 7935 | L: linux-omap@vger.kernel.org | 7933 | L: linux-omap@vger.kernel.org |
| 7936 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git | 7934 | S: Orphan |
| 7937 | S: Maintained | ||
| 7938 | F: drivers/usb/*/*omap* | 7935 | F: drivers/usb/*/*omap* |
| 7939 | F: arch/arm/*omap*/usb* | 7936 | F: arch/arm/*omap*/usb* |
| 7940 | 7937 | ||
diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c index b59195edf636..b635ab67490d 100644 --- a/drivers/usb/chipidea/ci_hdrc_pci.c +++ b/drivers/usb/chipidea/ci_hdrc_pci.c | |||
| @@ -85,8 +85,8 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev, | |||
| 85 | 85 | ||
| 86 | /* register a nop PHY */ | 86 | /* register a nop PHY */ |
| 87 | ci->phy = usb_phy_generic_register(); | 87 | ci->phy = usb_phy_generic_register(); |
| 88 | if (!ci->phy) | 88 | if (IS_ERR(ci->phy)) |
| 89 | return -ENOMEM; | 89 | return PTR_ERR(ci->phy); |
| 90 | 90 | ||
| 91 | memset(res, 0, sizeof(res)); | 91 | memset(res, 0, sizeof(res)); |
| 92 | res[0].start = pci_resource_start(pdev, 0); | 92 | res[0].start = pci_resource_start(pdev, 0); |
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index a4f7db2e18dd..df47110bad2d 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c | |||
| @@ -100,6 +100,9 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf, | |||
| 100 | if (sscanf(buf, "%u", &mode) != 1) | 100 | if (sscanf(buf, "%u", &mode) != 1) |
| 101 | return -EINVAL; | 101 | return -EINVAL; |
| 102 | 102 | ||
| 103 | if (mode > 255) | ||
| 104 | return -EBADRQC; | ||
| 105 | |||
| 103 | pm_runtime_get_sync(ci->dev); | 106 | pm_runtime_get_sync(ci->dev); |
| 104 | spin_lock_irqsave(&ci->lock, flags); | 107 | spin_lock_irqsave(&ci->lock, flags); |
| 105 | ret = hw_port_test_set(ci, mode); | 108 | ret = hw_port_test_set(ci, mode); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 350dcd9af5d8..51b436918f78 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -5401,6 +5401,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev) | |||
| 5401 | } | 5401 | } |
| 5402 | 5402 | ||
| 5403 | bos = udev->bos; | 5403 | bos = udev->bos; |
| 5404 | udev->bos = NULL; | ||
| 5404 | 5405 | ||
| 5405 | for (i = 0; i < SET_CONFIG_TRIES; ++i) { | 5406 | for (i = 0; i < SET_CONFIG_TRIES; ++i) { |
| 5406 | 5407 | ||
| @@ -5493,11 +5494,8 @@ done: | |||
| 5493 | usb_set_usb2_hardware_lpm(udev, 1); | 5494 | usb_set_usb2_hardware_lpm(udev, 1); |
| 5494 | usb_unlocked_enable_lpm(udev); | 5495 | usb_unlocked_enable_lpm(udev); |
| 5495 | usb_enable_ltm(udev); | 5496 | usb_enable_ltm(udev); |
| 5496 | /* release the new BOS descriptor allocated by hub_port_init() */ | 5497 | usb_release_bos_descriptor(udev); |
| 5497 | if (udev->bos != bos) { | 5498 | udev->bos = bos; |
| 5498 | usb_release_bos_descriptor(udev); | ||
| 5499 | udev->bos = bos; | ||
| 5500 | } | ||
| 5501 | return 0; | 5499 | return 0; |
| 5502 | 5500 | ||
| 5503 | re_enumerate: | 5501 | re_enumerate: |
diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index fd95ba6ec317..f0decc0d69b5 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | config USB_DWC2 | 1 | config USB_DWC2 |
| 2 | tristate "DesignWare USB2 DRD Core Support" | 2 | tristate "DesignWare USB2 DRD Core Support" |
| 3 | depends on HAS_DMA | ||
| 3 | depends on USB || USB_GADGET | 4 | depends on USB || USB_GADGET |
| 4 | help | 5 | help |
| 5 | Say Y here if your system has a Dual Role Hi-Speed USB | 6 | Say Y here if your system has a Dual Role Hi-Speed USB |
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index e991d55914db..46c4ba75dc2a 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c | |||
| @@ -619,6 +619,12 @@ void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg) | |||
| 619 | __func__, hsotg->dr_mode); | 619 | __func__, hsotg->dr_mode); |
| 620 | break; | 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 | /* |
diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c index 36606fc33c0d..a41274aa52ad 100644 --- a/drivers/usb/dwc2/hcd_ddma.c +++ b/drivers/usb/dwc2/hcd_ddma.c | |||
| @@ -1174,14 +1174,11 @@ static int dwc2_process_non_isoc_desc(struct dwc2_hsotg *hsotg, | |||
| 1174 | failed = dwc2_update_non_isoc_urb_state_ddma(hsotg, chan, qtd, dma_desc, | 1174 | failed = dwc2_update_non_isoc_urb_state_ddma(hsotg, chan, qtd, dma_desc, |
| 1175 | halt_status, n_bytes, | 1175 | halt_status, n_bytes, |
| 1176 | xfer_done); | 1176 | xfer_done); |
| 1177 | if (*xfer_done && urb->status != -EINPROGRESS) | 1177 | if (failed || (*xfer_done && urb->status != -EINPROGRESS)) { |
| 1178 | failed = 1; | ||
| 1179 | |||
| 1180 | if (failed) { | ||
| 1181 | dwc2_host_complete(hsotg, qtd, urb->status); | 1178 | dwc2_host_complete(hsotg, qtd, urb->status); |
| 1182 | dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh); | 1179 | dwc2_hcd_qtd_unlink_and_free(hsotg, qtd, qh); |
| 1183 | dev_vdbg(hsotg->dev, "failed=%1x xfer_done=%1x status=%08x\n", | 1180 | dev_vdbg(hsotg->dev, "failed=%1x xfer_done=%1x\n", |
| 1184 | failed, *xfer_done, urb->status); | 1181 | failed, *xfer_done); |
| 1185 | return failed; | 1182 | return failed; |
| 1186 | } | 1183 | } |
| 1187 | 1184 | ||
| @@ -1236,21 +1233,23 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, | |||
| 1236 | 1233 | ||
| 1237 | list_for_each_safe(qtd_item, qtd_tmp, &qh->qtd_list) { | 1234 | list_for_each_safe(qtd_item, qtd_tmp, &qh->qtd_list) { |
| 1238 | int i; | 1235 | int i; |
| 1236 | int qtd_desc_count; | ||
| 1239 | 1237 | ||
| 1240 | qtd = list_entry(qtd_item, struct dwc2_qtd, qtd_list_entry); | 1238 | qtd = list_entry(qtd_item, struct dwc2_qtd, qtd_list_entry); |
| 1241 | xfer_done = 0; | 1239 | xfer_done = 0; |
| 1240 | qtd_desc_count = qtd->n_desc; | ||
| 1242 | 1241 | ||
| 1243 | for (i = 0; i < qtd->n_desc; i++) { | 1242 | for (i = 0; i < qtd_desc_count; i++) { |
| 1244 | if (dwc2_process_non_isoc_desc(hsotg, chan, chnum, qtd, | 1243 | if (dwc2_process_non_isoc_desc(hsotg, chan, chnum, qtd, |
| 1245 | desc_num, halt_status, | 1244 | desc_num, halt_status, |
| 1246 | &xfer_done)) { | 1245 | &xfer_done)) |
| 1247 | qtd = NULL; | 1246 | goto stop_scan; |
| 1248 | break; | 1247 | |
| 1249 | } | ||
| 1250 | desc_num++; | 1248 | desc_num++; |
| 1251 | } | 1249 | } |
| 1252 | } | 1250 | } |
| 1253 | 1251 | ||
| 1252 | stop_scan: | ||
| 1254 | if (qh->ep_type != USB_ENDPOINT_XFER_CONTROL) { | 1253 | if (qh->ep_type != USB_ENDPOINT_XFER_CONTROL) { |
| 1255 | /* | 1254 | /* |
| 1256 | * Resetting the data toggle for bulk and interrupt endpoints | 1255 | * Resetting the data toggle for bulk and interrupt endpoints |
| @@ -1258,7 +1257,7 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg, | |||
| 1258 | */ | 1257 | */ |
| 1259 | if (halt_status == DWC2_HC_XFER_STALL) | 1258 | if (halt_status == DWC2_HC_XFER_STALL) |
| 1260 | qh->data_toggle = DWC2_HC_PID_DATA0; | 1259 | qh->data_toggle = DWC2_HC_PID_DATA0; |
| 1261 | else if (qtd) | 1260 | else |
| 1262 | dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); | 1261 | dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); |
| 1263 | } | 1262 | } |
| 1264 | 1263 | ||
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index f8253803a050..cadba8b13c48 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c | |||
| @@ -525,11 +525,19 @@ void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, | |||
| 525 | u32 pid = (hctsiz & TSIZ_SC_MC_PID_MASK) >> TSIZ_SC_MC_PID_SHIFT; | 525 | u32 pid = (hctsiz & TSIZ_SC_MC_PID_MASK) >> TSIZ_SC_MC_PID_SHIFT; |
| 526 | 526 | ||
| 527 | if (chan->ep_type != USB_ENDPOINT_XFER_CONTROL) { | 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 | if (pid == TSIZ_SC_MC_PID_DATA0) | 532 | if (pid == TSIZ_SC_MC_PID_DATA0) |
| 529 | chan->qh->data_toggle = DWC2_HC_PID_DATA0; | 533 | chan->qh->data_toggle = DWC2_HC_PID_DATA0; |
| 530 | else | 534 | else |
| 531 | chan->qh->data_toggle = DWC2_HC_PID_DATA1; | 535 | chan->qh->data_toggle = DWC2_HC_PID_DATA1; |
| 532 | } else { | 536 | } else { |
| 537 | if (WARN(!qtd, | ||
| 538 | "qtd must be specified for control eps\n")) | ||
| 539 | return; | ||
| 540 | |||
| 533 | if (pid == TSIZ_SC_MC_PID_DATA0) | 541 | if (pid == TSIZ_SC_MC_PID_DATA0) |
| 534 | qtd->data_toggle = DWC2_HC_PID_DATA0; | 542 | qtd->data_toggle = DWC2_HC_PID_DATA0; |
| 535 | else | 543 | else |
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 29130682e547..e4f8b90d9627 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h | |||
| @@ -856,7 +856,6 @@ struct dwc3 { | |||
| 856 | unsigned pullups_connected:1; | 856 | unsigned pullups_connected:1; |
| 857 | unsigned resize_fifos:1; | 857 | unsigned resize_fifos:1; |
| 858 | unsigned setup_packet_pending:1; | 858 | unsigned setup_packet_pending:1; |
| 859 | unsigned start_config_issued:1; | ||
| 860 | unsigned three_stage_setup:1; | 859 | unsigned three_stage_setup:1; |
| 861 | unsigned usb3_lpm_capable:1; | 860 | unsigned usb3_lpm_capable:1; |
| 862 | 861 | ||
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 3a9354abcb68..8d6b75c2f53b 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
| @@ -555,7 +555,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) | |||
| 555 | int ret; | 555 | int ret; |
| 556 | u32 reg; | 556 | u32 reg; |
| 557 | 557 | ||
| 558 | dwc->start_config_issued = false; | ||
| 559 | cfg = le16_to_cpu(ctrl->wValue); | 558 | cfg = le16_to_cpu(ctrl->wValue); |
| 560 | 559 | ||
| 561 | switch (state) { | 560 | switch (state) { |
| @@ -737,10 +736,6 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) | |||
| 737 | dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_ISOCH_DELAY"); | 736 | dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_ISOCH_DELAY"); |
| 738 | ret = dwc3_ep0_set_isoch_delay(dwc, ctrl); | 737 | ret = dwc3_ep0_set_isoch_delay(dwc, ctrl); |
| 739 | break; | 738 | break; |
| 740 | case USB_REQ_SET_INTERFACE: | ||
| 741 | dwc3_trace(trace_dwc3_ep0, "USB_REQ_SET_INTERFACE"); | ||
| 742 | dwc->start_config_issued = false; | ||
| 743 | /* Fall through */ | ||
| 744 | default: | 739 | default: |
| 745 | dwc3_trace(trace_dwc3_ep0, "Forwarding to gadget driver"); | 740 | dwc3_trace(trace_dwc3_ep0, "Forwarding to gadget driver"); |
| 746 | ret = dwc3_ep0_delegate_req(dwc, ctrl); | 741 | ret = dwc3_ep0_delegate_req(dwc, ctrl); |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7d1dd82a95ac..2363bad45af8 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -385,24 +385,66 @@ static void dwc3_free_trb_pool(struct dwc3_ep *dep) | |||
| 385 | dep->trb_pool_dma = 0; | 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 | static int dwc3_gadget_start_config(struct dwc3 *dwc, struct dwc3_ep *dep) | 422 | static int dwc3_gadget_start_config(struct dwc3 *dwc, struct dwc3_ep *dep) |
| 389 | { | 423 | { |
| 390 | struct dwc3_gadget_ep_cmd_params params; | 424 | struct dwc3_gadget_ep_cmd_params params; |
| 391 | u32 cmd; | 425 | u32 cmd; |
| 426 | int i; | ||
| 427 | int ret; | ||
| 428 | |||
| 429 | if (dep->number) | ||
| 430 | return 0; | ||
| 392 | 431 | ||
| 393 | memset(¶ms, 0x00, sizeof(params)); | 432 | memset(¶ms, 0x00, sizeof(params)); |
| 433 | cmd = DWC3_DEPCMD_DEPSTARTCFG; | ||
| 394 | 434 | ||
| 395 | if (dep->number != 1) { | 435 | ret = dwc3_send_gadget_ep_cmd(dwc, 0, cmd, ¶ms); |
| 396 | cmd = DWC3_DEPCMD_DEPSTARTCFG; | 436 | if (ret) |
| 397 | /* XferRscIdx == 0 for ep0 and 2 for the remaining */ | 437 | return ret; |
| 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 | } | ||
| 404 | 438 | ||
| 405 | return dwc3_send_gadget_ep_cmd(dwc, 0, cmd, ¶ms); | 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 | return 0; | 450 | return 0; |
| @@ -516,10 +558,6 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, | |||
| 516 | struct dwc3_trb *trb_st_hw; | 558 | struct dwc3_trb *trb_st_hw; |
| 517 | struct dwc3_trb *trb_link; | 559 | struct dwc3_trb *trb_link; |
| 518 | 560 | ||
| 519 | ret = dwc3_gadget_set_xfer_resource(dwc, dep); | ||
| 520 | if (ret) | ||
| 521 | return ret; | ||
| 522 | |||
| 523 | dep->endpoint.desc = desc; | 561 | dep->endpoint.desc = desc; |
| 524 | dep->comp_desc = comp_desc; | 562 | dep->comp_desc = comp_desc; |
| 525 | dep->type = usb_endpoint_type(desc); | 563 | dep->type = usb_endpoint_type(desc); |
| @@ -1636,8 +1674,6 @@ static int dwc3_gadget_start(struct usb_gadget *g, | |||
| 1636 | } | 1674 | } |
| 1637 | dwc3_writel(dwc->regs, DWC3_DCFG, reg); | 1675 | dwc3_writel(dwc->regs, DWC3_DCFG, reg); |
| 1638 | 1676 | ||
| 1639 | dwc->start_config_issued = false; | ||
| 1640 | |||
| 1641 | /* Start with SuperSpeed Default */ | 1677 | /* Start with SuperSpeed Default */ |
| 1642 | dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); | 1678 | dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512); |
| 1643 | 1679 | ||
| @@ -2237,7 +2273,6 @@ static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc) | |||
| 2237 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); | 2273 | dwc3_writel(dwc->regs, DWC3_DCTL, reg); |
| 2238 | 2274 | ||
| 2239 | dwc3_disconnect_gadget(dwc); | 2275 | dwc3_disconnect_gadget(dwc); |
| 2240 | dwc->start_config_issued = false; | ||
| 2241 | 2276 | ||
| 2242 | dwc->gadget.speed = USB_SPEED_UNKNOWN; | 2277 | dwc->gadget.speed = USB_SPEED_UNKNOWN; |
| 2243 | dwc->setup_packet_pending = false; | 2278 | dwc->setup_packet_pending = false; |
| @@ -2288,7 +2323,6 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc) | |||
| 2288 | 2323 | ||
| 2289 | dwc3_stop_active_transfers(dwc); | 2324 | dwc3_stop_active_transfers(dwc); |
| 2290 | dwc3_clear_stall_all_ep(dwc); | 2325 | dwc3_clear_stall_all_ep(dwc); |
| 2291 | dwc->start_config_issued = false; | ||
| 2292 | 2326 | ||
| 2293 | /* Reset device address to zero */ | 2327 | /* Reset device address to zero */ |
| 2294 | reg = dwc3_readl(dwc->regs, DWC3_DCFG); | 2328 | reg = dwc3_readl(dwc->regs, DWC3_DCFG); |
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 7e179f81d05c..87fb0fd6aaab 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c | |||
| @@ -130,7 +130,8 @@ struct dev_data { | |||
| 130 | setup_can_stall : 1, | 130 | setup_can_stall : 1, |
| 131 | setup_out_ready : 1, | 131 | setup_out_ready : 1, |
| 132 | setup_out_error : 1, | 132 | setup_out_error : 1, |
| 133 | setup_abort : 1; | 133 | setup_abort : 1, |
| 134 | gadget_registered : 1; | ||
| 134 | unsigned setup_wLength; | 135 | unsigned setup_wLength; |
| 135 | 136 | ||
| 136 | /* the rest is basically write-once */ | 137 | /* the rest is basically write-once */ |
| @@ -1179,7 +1180,8 @@ dev_release (struct inode *inode, struct file *fd) | |||
| 1179 | 1180 | ||
| 1180 | /* closing ep0 === shutdown all */ | 1181 | /* closing ep0 === shutdown all */ |
| 1181 | 1182 | ||
| 1182 | usb_gadget_unregister_driver (&gadgetfs_driver); | 1183 | if (dev->gadget_registered) |
| 1184 | usb_gadget_unregister_driver (&gadgetfs_driver); | ||
| 1183 | 1185 | ||
| 1184 | /* at this point "good" hardware has disconnected the | 1186 | /* at this point "good" hardware has disconnected the |
| 1185 | * device from USB; the host won't see it any more. | 1187 | * device from USB; the host won't see it any more. |
| @@ -1847,6 +1849,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
| 1847 | * kick in after the ep0 descriptor is closed. | 1849 | * kick in after the ep0 descriptor is closed. |
| 1848 | */ | 1850 | */ |
| 1849 | value = len; | 1851 | value = len; |
| 1852 | dev->gadget_registered = true; | ||
| 1850 | } | 1853 | } |
| 1851 | return value; | 1854 | return value; |
| 1852 | 1855 | ||
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index 53c0692f1b09..93d28cb00b76 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c | |||
| @@ -2340,7 +2340,7 @@ static struct qe_udc *qe_udc_config(struct platform_device *ofdev) | |||
| 2340 | { | 2340 | { |
| 2341 | struct qe_udc *udc; | 2341 | struct qe_udc *udc; |
| 2342 | struct device_node *np = ofdev->dev.of_node; | 2342 | struct device_node *np = ofdev->dev.of_node; |
| 2343 | unsigned int tmp_addr = 0; | 2343 | unsigned long tmp_addr = 0; |
| 2344 | struct usb_device_para __iomem *usbpram; | 2344 | struct usb_device_para __iomem *usbpram; |
| 2345 | unsigned int i; | 2345 | unsigned int i; |
| 2346 | u64 size; | 2346 | u64 size; |
diff --git a/drivers/usb/gadget/udc/net2280.h b/drivers/usb/gadget/udc/net2280.h index 4dff60d34f73..0d32052bf16f 100644 --- a/drivers/usb/gadget/udc/net2280.h +++ b/drivers/usb/gadget/udc/net2280.h | |||
| @@ -369,9 +369,20 @@ static inline void set_max_speed(struct net2280_ep *ep, u32 max) | |||
| 369 | static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80, | 369 | static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80, |
| 370 | 0x50, 0x20, 0x70, 0x40, 0x90 }; | 370 | 0x50, 0x20, 0x70, 0x40, 0x90 }; |
| 371 | 371 | ||
| 372 | if (ep->dev->enhanced_mode) | 372 | if (ep->dev->enhanced_mode) { |
| 373 | reg = ep_enhanced[ep->num]; | 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 | reg = (ep->num + 1) * 0x10; | 386 | reg = (ep->num + 1) * 0x10; |
| 376 | if (ep->dev->gadget.speed != USB_SPEED_HIGH) | 387 | if (ep->dev->gadget.speed != USB_SPEED_HIGH) |
| 377 | reg += 1; | 388 | reg += 1; |
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c index fd73a3ea07c2..b86a6f03592e 100644 --- a/drivers/usb/gadget/udc/udc-core.c +++ b/drivers/usb/gadget/udc/udc-core.c | |||
| @@ -413,9 +413,10 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget, | |||
| 413 | if (!driver->udc_name || strcmp(driver->udc_name, | 413 | if (!driver->udc_name || strcmp(driver->udc_name, |
| 414 | dev_name(&udc->dev)) == 0) { | 414 | dev_name(&udc->dev)) == 0) { |
| 415 | ret = udc_bind_to_driver(udc, driver); | 415 | ret = udc_bind_to_driver(udc, driver); |
| 416 | if (ret != -EPROBE_DEFER) | ||
| 417 | list_del(&driver->pending); | ||
| 416 | if (ret) | 418 | if (ret) |
| 417 | goto err4; | 419 | goto err4; |
| 418 | list_del(&driver->pending); | ||
| 419 | break; | 420 | break; |
| 420 | } | 421 | } |
| 421 | } | 422 | } |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 795a45b1b25b..58487a473521 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -662,7 +662,7 @@ static int musb_tx_dma_set_mode_mentor(struct dma_controller *dma, | |||
| 662 | csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAMODE); | 662 | csr &= ~(MUSB_TXCSR_AUTOSET | MUSB_TXCSR_DMAMODE); |
| 663 | csr |= MUSB_TXCSR_DMAENAB; /* against programmer's guide */ | 663 | csr |= MUSB_TXCSR_DMAENAB; /* against programmer's guide */ |
| 664 | } | 664 | } |
| 665 | channel->desired_mode = mode; | 665 | channel->desired_mode = *mode; |
| 666 | musb_writew(epio, MUSB_TXCSR, csr); | 666 | musb_writew(epio, MUSB_TXCSR, csr); |
| 667 | 667 | ||
| 668 | return 0; | 668 | return 0; |
| @@ -2003,10 +2003,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
| 2003 | qh->offset, | 2003 | qh->offset, |
| 2004 | urb->transfer_buffer_length); | 2004 | urb->transfer_buffer_length); |
| 2005 | 2005 | ||
| 2006 | done = musb_rx_dma_in_inventra_cppi41(c, hw_ep, qh, | 2006 | if (musb_rx_dma_in_inventra_cppi41(c, hw_ep, qh, urb, |
| 2007 | urb, xfer_len, | 2007 | xfer_len, iso_err)) |
| 2008 | iso_err); | ||
| 2009 | if (done) | ||
| 2010 | goto finish; | 2008 | goto finish; |
| 2011 | else | 2009 | else |
| 2012 | dev_err(musb->controller, "error: rx_dma failed\n"); | 2010 | dev_err(musb->controller, "error: rx_dma failed\n"); |
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 970a30e155cb..72b387d592c2 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c | |||
| @@ -757,14 +757,8 @@ static int msm_otg_set_host(struct usb_otg *otg, struct usb_bus *host) | |||
| 757 | otg->host = host; | 757 | otg->host = host; |
| 758 | dev_dbg(otg->usb_phy->dev, "host driver registered w/ tranceiver\n"); | 758 | dev_dbg(otg->usb_phy->dev, "host driver registered w/ tranceiver\n"); |
| 759 | 759 | ||
| 760 | /* | 760 | pm_runtime_get_sync(otg->usb_phy->dev); |
| 761 | * Kick the state machine work, if peripheral is not supported | 761 | schedule_work(&motg->sm_work); |
| 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 | } | ||
| 768 | 762 | ||
| 769 | return 0; | 763 | return 0; |
| 770 | } | 764 | } |
| @@ -827,14 +821,8 @@ static int msm_otg_set_peripheral(struct usb_otg *otg, | |||
| 827 | dev_dbg(otg->usb_phy->dev, | 821 | dev_dbg(otg->usb_phy->dev, |
| 828 | "peripheral driver registered w/ tranceiver\n"); | 822 | "peripheral driver registered w/ tranceiver\n"); |
| 829 | 823 | ||
| 830 | /* | 824 | pm_runtime_get_sync(otg->usb_phy->dev); |
| 831 | * Kick the state machine work, if host is not supported | 825 | schedule_work(&motg->sm_work); |
| 832 | * or host is already registered with us. | ||
| 833 | */ | ||
| 834 | if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL || otg->host) { | ||
| 835 | pm_runtime_get_sync(otg->usb_phy->dev); | ||
| 836 | schedule_work(&motg->sm_work); | ||
| 837 | } | ||
| 838 | 826 | ||
| 839 | return 0; | 827 | return 0; |
| 840 | } | 828 | } |
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 987813b8a7f9..7c319e7edda2 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -163,6 +163,8 @@ static const struct usb_device_id id_table[] = { | |||
| 163 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | 163 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
| 164 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 164 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
| 165 | { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ | 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 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ | 168 | { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ |
| 167 | { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ | 169 | { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */ |
| 168 | { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */ | 170 | { USB_DEVICE(0x1BA4, 0x0002) }, /* Silicon Labs 358x factory default */ |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index db86e512e0fc..8849439a8f18 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -315,6 +315,7 @@ static void option_instat_callback(struct urb *urb); | |||
| 315 | #define TOSHIBA_PRODUCT_G450 0x0d45 | 315 | #define TOSHIBA_PRODUCT_G450 0x0d45 |
| 316 | 316 | ||
| 317 | #define ALINK_VENDOR_ID 0x1e0e | 317 | #define ALINK_VENDOR_ID 0x1e0e |
| 318 | #define SIMCOM_PRODUCT_SIM7100E 0x9001 /* Yes, ALINK_VENDOR_ID */ | ||
| 318 | #define ALINK_PRODUCT_PH300 0x9100 | 319 | #define ALINK_PRODUCT_PH300 0x9100 |
| 319 | #define ALINK_PRODUCT_3GU 0x9200 | 320 | #define ALINK_PRODUCT_3GU 0x9200 |
| 320 | 321 | ||
| @@ -607,6 +608,10 @@ static const struct option_blacklist_info zte_1255_blacklist = { | |||
| 607 | .reserved = BIT(3) | BIT(4), | 608 | .reserved = BIT(3) | BIT(4), |
| 608 | }; | 609 | }; |
| 609 | 610 | ||
| 611 | static const struct option_blacklist_info simcom_sim7100e_blacklist = { | ||
| 612 | .reserved = BIT(5) | BIT(6), | ||
| 613 | }; | ||
| 614 | |||
| 610 | static const struct option_blacklist_info telit_le910_blacklist = { | 615 | static const struct option_blacklist_info telit_le910_blacklist = { |
| 611 | .sendsetup = BIT(0), | 616 | .sendsetup = BIT(0), |
| 612 | .reserved = BIT(1) | BIT(2), | 617 | .reserved = BIT(1) | BIT(2), |
| @@ -1122,6 +1127,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1122 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, | 1127 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, |
| 1123 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 1128 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
| 1124 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | 1129 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ |
| 1130 | { USB_DEVICE_AND_INTERFACE_INFO(QUALCOMM_VENDOR_ID, 0x6001, 0xff, 0xff, 0xff), /* 4G LTE usb-modem U901 */ | ||
| 1131 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | ||
| 1125 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 1132 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
| 1126 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ | 1133 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ |
| 1127 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 1134 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
| @@ -1645,6 +1652,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1645 | { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, | 1652 | { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, |
| 1646 | { USB_DEVICE(ALINK_VENDOR_ID, ALINK_PRODUCT_PH300) }, | 1653 | { USB_DEVICE(ALINK_VENDOR_ID, ALINK_PRODUCT_PH300) }, |
| 1647 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, | 1654 | { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, |
| 1655 | { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E), | ||
| 1656 | .driver_info = (kernel_ulong_t)&simcom_sim7100e_blacklist }, | ||
| 1648 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), | 1657 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
| 1649 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist | 1658 | .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist |
| 1650 | }, | 1659 | }, |
