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

Pull USB fixes from Greg KH:
"Here are some small USB fixes for 5.8-rc3 to resolve some reported
issues.

Nothing major here:

- gadget driver fixes

- cdns3 driver fixes

- xhci fixes

- renesas_usbhs driver fixes

- some new device support with ids

- documentation update

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

* tag 'usb-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (27 commits)
usb: renesas_usbhs: getting residue from callback_result
Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk"
xhci: Poll for U0 after disabling USB2 LPM
xhci: Return if xHCI doesn't support LPM
usb: host: xhci-mtk: avoid runtime suspend when removing hcd
xhci: Fix enumeration issue when setting max packet size for FS devices.
xhci: Fix incorrect EP_STATE_MASK
usb: cdns3: ep0: add spinlock for cdns3_check_new_setup
usb: cdns3: trace: using correct dir value
usb: cdns3: ep0: fix the test mode set incorrectly
Revert "usb: dwc3: exynos: Add support for Exynos5422 suspend clk"
usb: gadget: udc: Potential Oops in error handling code
usb: phy: tegra: Fix unnecessary check in tegra_usb_phy_probe()
usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work
usb: cdns3: ep0: add spinlock for cdns3_check_new_setup
usb: cdns3: trace: using correct dir value
usb: cdns3: ep0: fix the test mode set incorrectly
usb: typec: tcpci_rt1711h: avoid screaming irq causing boot hangs
USB: ohci-sm501: Add missed iounmap() in remove
cdc-acm: Add DISABLE_ECHO quirk for Microchip/SMSC chip
...

+90 -73
+4 -4
Documentation/ABI/testing/sysfs-platform-chipidea-usb-otg
··· 1 1 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req 2 2 Date: Feb 2014 3 - Contact: Li Jun <b47624@freescale.com> 3 + Contact: Li Jun <jun.li@nxp.com> 4 4 Description: 5 5 Can be set and read. 6 6 Set a_bus_req(A-device bus request) input to be 1 if ··· 17 17 18 18 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop 19 19 Date: Feb 2014 20 - Contact: Li Jun <b47624@freescale.com> 20 + Contact: Li Jun <jun.li@nxp.com> 21 21 Description: 22 22 Can be set and read 23 23 The a_bus_drop(A-device bus drop) input is 1 when the ··· 32 32 33 33 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req 34 34 Date: Feb 2014 35 - Contact: Li Jun <b47624@freescale.com> 35 + Contact: Li Jun <jun.li@nxp.com> 36 36 Description: 37 37 Can be set and read. 38 38 The b_bus_req(B-device bus request) input is 1 during the time ··· 47 47 48 48 What: /sys/bus/platform/devices/ci_hdrc.0/inputs/a_clr_err 49 49 Date: Feb 2014 50 - Contact: Li Jun <b47624@freescale.com> 50 + Contact: Li Jun <jun.li@nxp.com> 51 51 Description: 52 52 Only can be set. 53 53 The a_clr_err(A-device Vbus error clear) input is used to clear
+6 -4
drivers/usb/cdns3/ep0.c
··· 327 327 if (!set || (tmode & 0xff) != 0) 328 328 return -EINVAL; 329 329 330 - switch (tmode >> 8) { 330 + tmode >>= 8; 331 + switch (tmode) { 331 332 case TEST_J: 332 333 case TEST_K: 333 334 case TEST_SE0_NAK: ··· 705 704 int ret = 0; 706 705 u8 zlp = 0; 707 706 707 + spin_lock_irqsave(&priv_dev->lock, flags); 708 708 trace_cdns3_ep0_queue(priv_dev, request); 709 709 710 710 /* cancel the request if controller receive new SETUP packet. */ 711 - if (cdns3_check_new_setup(priv_dev)) 711 + if (cdns3_check_new_setup(priv_dev)) { 712 + spin_unlock_irqrestore(&priv_dev->lock, flags); 712 713 return -ECONNRESET; 714 + } 713 715 714 716 /* send STATUS stage. Should be called only for SET_CONFIGURATION */ 715 717 if (priv_dev->ep0_stage == CDNS3_STATUS_STAGE) { 716 - spin_lock_irqsave(&priv_dev->lock, flags); 717 718 cdns3_select_ep(priv_dev, 0x00); 718 719 719 720 erdy_sent = !priv_dev->hw_configured_flag; ··· 740 737 return 0; 741 738 } 742 739 743 - spin_lock_irqsave(&priv_dev->lock, flags); 744 740 if (!list_empty(&priv_ep->pending_req_list)) { 745 741 dev_err(priv_dev->dev, 746 742 "can't handle multiple requests for ep0\n");
+1 -1
drivers/usb/cdns3/trace.h
··· 156 156 __dynamic_array(char, str, CDNS3_MSG_MAX) 157 157 ), 158 158 TP_fast_assign( 159 - __entry->ep_dir = priv_dev->ep0_data_dir; 159 + __entry->ep_dir = priv_dev->selected_ep; 160 160 __entry->ep_sts = ep_sts; 161 161 ), 162 162 TP_printk("%s", cdns3_decode_ep0_irq(__get_str(str),
+2
drivers/usb/class/cdc-acm.c
··· 1689 1689 1690 1690 static const struct usb_device_id acm_ids[] = { 1691 1691 /* quirky and broken devices */ 1692 + { USB_DEVICE(0x0424, 0x274e), /* Microchip Technology, Inc. (formerly SMSC) */ 1693 + .driver_info = DISABLE_ECHO, }, /* DISABLE ECHO in termios flag */ 1692 1694 { USB_DEVICE(0x076d, 0x0006), /* Denso Cradle CU-321 */ 1693 1695 .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */ 1694 1696 { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
+2 -1
drivers/usb/core/quirks.c
··· 218 218 /* Logitech HD Webcam C270 */ 219 219 { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME }, 220 220 221 - /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */ 221 + /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */ 222 222 { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT }, 223 223 { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT }, 224 224 { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT }, 225 225 { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT }, 226 + { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT }, 226 227 227 228 /* Logitech ConferenceCam CC3000e */ 228 229 { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
-6
drivers/usb/dwc2/gadget.c
··· 4920 4920 epnum, 0); 4921 4921 } 4922 4922 4923 - ret = usb_add_gadget_udc(dev, &hsotg->gadget); 4924 - if (ret) { 4925 - dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, 4926 - hsotg->ctrl_req); 4927 - return ret; 4928 - } 4929 4923 dwc2_hsotg_dump(hsotg); 4930 4924 4931 4925 return 0;
+11
drivers/usb/dwc2/platform.c
··· 575 575 if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) 576 576 dwc2_lowlevel_hw_disable(hsotg); 577 577 578 + #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \ 579 + IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE) 580 + /* Postponed adding a new gadget to the udc class driver list */ 581 + if (hsotg->gadget_enabled) { 582 + retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget); 583 + if (retval) { 584 + dwc2_hsotg_remove(hsotg); 585 + goto error_init; 586 + } 587 + } 588 + #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */ 578 589 return 0; 579 590 580 591 error_init:
-9
drivers/usb/dwc3/dwc3-exynos.c
··· 162 162 .suspend_clk_idx = -1, 163 163 }; 164 164 165 - static const struct dwc3_exynos_driverdata exynos5420_drvdata = { 166 - .clk_names = { "usbdrd30", "usbdrd30_susp_clk"}, 167 - .num_clks = 2, 168 - .suspend_clk_idx = 1, 169 - }; 170 - 171 165 static const struct dwc3_exynos_driverdata exynos5433_drvdata = { 172 166 .clk_names = { "aclk", "susp_clk", "pipe_pclk", "phyclk" }, 173 167 .num_clks = 4, ··· 178 184 { 179 185 .compatible = "samsung,exynos5250-dwusb3", 180 186 .data = &exynos5250_drvdata, 181 - }, { 182 - .compatible = "samsung,exynos5420-dwusb3", 183 - .data = &exynos5420_drvdata, 184 187 }, { 185 188 .compatible = "samsung,exynos5433-dwusb3", 186 189 .data = &exynos5433_drvdata,
+3 -1
drivers/usb/dwc3/dwc3-pci.c
··· 206 206 int ret; 207 207 208 208 ret = pm_runtime_get_sync(&dwc3->dev); 209 - if (ret) 209 + if (ret) { 210 + pm_runtime_put_sync_autosuspend(&dwc3->dev); 210 211 return; 212 + } 211 213 212 214 pm_runtime_mark_last_busy(&dwc3->dev); 213 215 pm_runtime_put_sync_autosuspend(&dwc3->dev);
+2 -1
drivers/usb/gadget/udc/mv_udc_core.c
··· 2313 2313 return 0; 2314 2314 2315 2315 err_create_workqueue: 2316 - destroy_workqueue(udc->qwork); 2316 + if (udc->qwork) 2317 + destroy_workqueue(udc->qwork); 2317 2318 err_destroy_dma: 2318 2319 dma_pool_destroy(udc->dtd_pool); 2319 2320 err_free_dma:
+2 -3
drivers/usb/host/ehci-exynos.c
··· 203 203 hcd->rsrc_len = resource_size(res); 204 204 205 205 irq = platform_get_irq(pdev, 0); 206 - if (!irq) { 207 - dev_err(&pdev->dev, "Failed to get IRQ\n"); 208 - err = -ENODEV; 206 + if (irq < 0) { 207 + err = irq; 209 208 goto fail_io; 210 209 } 211 210
+7
drivers/usb/host/ehci-pci.c
··· 216 216 ehci_info(ehci, "applying MosChip frame-index workaround\n"); 217 217 ehci->frame_index_bug = 1; 218 218 break; 219 + case PCI_VENDOR_ID_HUAWEI: 220 + /* Synopsys HC bug */ 221 + if (pdev->device == 0xa239) { 222 + ehci_info(ehci, "applying Synopsys HC workaround\n"); 223 + ehci->has_synopsys_hc_bug = 1; 224 + } 225 + break; 219 226 } 220 227 221 228 /* optional debug port, normally in the first BAR */
+1
drivers/usb/host/ohci-sm501.c
··· 191 191 struct resource *mem; 192 192 193 193 usb_remove_hcd(hcd); 194 + iounmap(hcd->regs); 194 195 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 195 196 usb_put_hcd(hcd); 196 197 mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+3 -2
drivers/usb/host/xhci-mtk.c
··· 587 587 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 588 588 struct usb_hcd *shared_hcd = xhci->shared_hcd; 589 589 590 + pm_runtime_put_noidle(&dev->dev); 591 + pm_runtime_disable(&dev->dev); 592 + 590 593 usb_remove_hcd(shared_hcd); 591 594 xhci->shared_hcd = NULL; 592 595 device_init_wakeup(&dev->dev, false); ··· 600 597 xhci_mtk_sch_exit(mtk); 601 598 xhci_mtk_clks_disable(mtk); 602 599 xhci_mtk_ldos_disable(mtk); 603 - pm_runtime_put_sync(&dev->dev); 604 - pm_runtime_disable(&dev->dev); 605 600 606 601 return 0; 607 602 }
+8 -1
drivers/usb/host/xhci.c
··· 1430 1430 xhci->devs[slot_id]->out_ctx, ep_index); 1431 1431 1432 1432 ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index); 1433 + ep_ctx->ep_info &= cpu_to_le32(~EP_STATE_MASK);/* must clear */ 1433 1434 ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK); 1434 1435 ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size)); 1435 1436 ··· 4391 4390 int hird, exit_latency; 4392 4391 int ret; 4393 4392 4393 + if (xhci->quirks & XHCI_HW_LPM_DISABLE) 4394 + return -EPERM; 4395 + 4394 4396 if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support || 4395 4397 !udev->lpm_capable) 4396 4398 return -EPERM; ··· 4416 4412 xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n", 4417 4413 enable ? "enable" : "disable", port_num + 1); 4418 4414 4419 - if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) { 4415 + if (enable) { 4420 4416 /* Host supports BESL timeout instead of HIRD */ 4421 4417 if (udev->usb2_hw_lpm_besl_capable) { 4422 4418 /* if device doesn't have a preferred BESL value use a ··· 4475 4471 mutex_lock(hcd->bandwidth_mutex); 4476 4472 xhci_change_max_exit_latency(xhci, udev, 0); 4477 4473 mutex_unlock(hcd->bandwidth_mutex); 4474 + readl_poll_timeout(ports[port_num]->addr, pm_val, 4475 + (pm_val & PORT_PLS_MASK) == XDEV_U0, 4476 + 100, 10000); 4478 4477 return 0; 4479 4478 } 4480 4479 }
+1 -1
drivers/usb/host/xhci.h
··· 716 716 * 4 - TRB error 717 717 * 5-7 - reserved 718 718 */ 719 - #define EP_STATE_MASK (0xf) 719 + #define EP_STATE_MASK (0x7) 720 720 #define EP_STATE_DISABLED 0 721 721 #define EP_STATE_RUNNING 1 722 722 #define EP_STATE_HALTED 2
+1
drivers/usb/misc/usbtest.c
··· 2873 2873 2874 2874 usb_set_intfdata(intf, NULL); 2875 2875 dev_dbg(&intf->dev, "disconnect\n"); 2876 + kfree(dev->buf); 2876 2877 kfree(dev); 2877 2878 } 2878 2879
+1 -5
drivers/usb/phy/phy-tegra-usb.c
··· 1199 1199 1200 1200 platform_set_drvdata(pdev, tegra_phy); 1201 1201 1202 - err = usb_add_phy_dev(&tegra_phy->u_phy); 1203 - if (err) 1204 - return err; 1205 - 1206 - return 0; 1202 + return usb_add_phy_dev(&tegra_phy->u_phy); 1207 1203 } 1208 1204 1209 1205 static int tegra_usb_phy_remove(struct platform_device *pdev)
+13 -10
drivers/usb/renesas_usbhs/fifo.c
··· 803 803 return info->dma_map_ctrl(chan->device->dev, pkt, map); 804 804 } 805 805 806 - static void usbhsf_dma_complete(void *arg); 806 + static void usbhsf_dma_complete(void *arg, 807 + const struct dmaengine_result *result); 807 808 static void usbhsf_dma_xfer_preparing(struct usbhs_pkt *pkt) 808 809 { 809 810 struct usbhs_pipe *pipe = pkt->pipe; ··· 814 813 struct dma_chan *chan; 815 814 struct device *dev = usbhs_priv_to_dev(priv); 816 815 enum dma_transfer_direction dir; 816 + dma_cookie_t cookie; 817 817 818 818 fifo = usbhs_pipe_to_fifo(pipe); 819 819 if (!fifo) ··· 829 827 if (!desc) 830 828 return; 831 829 832 - desc->callback = usbhsf_dma_complete; 833 - desc->callback_param = pipe; 830 + desc->callback_result = usbhsf_dma_complete; 831 + desc->callback_param = pkt; 834 832 835 - pkt->cookie = dmaengine_submit(desc); 836 - if (pkt->cookie < 0) { 833 + cookie = dmaengine_submit(desc); 834 + if (cookie < 0) { 837 835 dev_err(dev, "Failed to submit dma descriptor\n"); 838 836 return; 839 837 } ··· 1154 1152 struct dma_chan *chan, int dtln) 1155 1153 { 1156 1154 struct usbhs_pipe *pipe = pkt->pipe; 1157 - struct dma_tx_state state; 1158 1155 size_t received_size; 1159 1156 int maxp = usbhs_pipe_get_maxpacket(pipe); 1160 1157 1161 - dmaengine_tx_status(chan, pkt->cookie, &state); 1162 - received_size = pkt->length - state.residue; 1158 + received_size = pkt->length - pkt->dma_result->residue; 1163 1159 1164 1160 if (dtln) { 1165 1161 received_size -= USBHS_USB_DMAC_XFER_SIZE; ··· 1363 1363 return 0; 1364 1364 } 1365 1365 1366 - static void usbhsf_dma_complete(void *arg) 1366 + static void usbhsf_dma_complete(void *arg, 1367 + const struct dmaengine_result *result) 1367 1368 { 1368 - struct usbhs_pipe *pipe = arg; 1369 + struct usbhs_pkt *pkt = arg; 1370 + struct usbhs_pipe *pipe = pkt->pipe; 1369 1371 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); 1370 1372 struct device *dev = usbhs_priv_to_dev(priv); 1371 1373 int ret; 1372 1374 1375 + pkt->dma_result = result; 1373 1376 ret = usbhsf_pkt_handler(pipe, USBHSF_PKT_DMA_DONE); 1374 1377 if (ret < 0) 1375 1378 dev_err(dev, "dma_complete run_error %d : %d\n",
+1 -1
drivers/usb/renesas_usbhs/fifo.h
··· 50 50 struct usbhs_pkt *pkt); 51 51 struct work_struct work; 52 52 dma_addr_t dma; 53 - dma_cookie_t cookie; 53 + const struct dmaengine_result *dma_result; 54 54 void *buf; 55 55 int length; 56 56 int trans;
+11 -2
drivers/usb/typec/mux/intel_pmc_mux.c
··· 148 148 msg[0] = PMC_USB_DP_HPD; 149 149 msg[0] |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT; 150 150 151 - msg[1] = PMC_USB_DP_HPD_IRQ; 151 + if (data->status & DP_STATUS_IRQ_HPD) 152 + msg[1] = PMC_USB_DP_HPD_IRQ; 152 153 153 154 if (data->status & DP_STATUS_HPD_STATE) 154 155 msg[1] |= PMC_USB_DP_HPD_LVL; ··· 162 161 { 163 162 struct typec_displayport_data *data = state->data; 164 163 struct altmode_req req = { }; 164 + int ret; 165 165 166 166 if (data->status & DP_STATUS_IRQ_HPD) 167 167 return pmc_usb_mux_dp_hpd(port, state); ··· 183 181 if (data->status & DP_STATUS_HPD_STATE) 184 182 req.mode_data |= PMC_USB_ALTMODE_HPD_HIGH; 185 183 186 - return pmc_usb_command(port, (void *)&req, sizeof(req)); 184 + ret = pmc_usb_command(port, (void *)&req, sizeof(req)); 185 + if (ret) 186 + return ret; 187 + 188 + if (data->status & DP_STATUS_HPD_STATE) 189 + return pmc_usb_mux_dp_hpd(port, state); 190 + 191 + return 0; 187 192 } 188 193 189 194 static int
+10 -21
drivers/usb/typec/tcpm/tcpci_rt1711h.c
··· 179 179 return tcpci_irq(chip->tcpci); 180 180 } 181 181 182 - static int rt1711h_init_alert(struct rt1711h_chip *chip, 183 - struct i2c_client *client) 184 - { 185 - int ret; 186 - 187 - /* Disable chip interrupts before requesting irq */ 188 - ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0); 189 - if (ret < 0) 190 - return ret; 191 - 192 - ret = devm_request_threaded_irq(chip->dev, client->irq, NULL, 193 - rt1711h_irq, 194 - IRQF_ONESHOT | IRQF_TRIGGER_LOW, 195 - dev_name(chip->dev), chip); 196 - if (ret < 0) 197 - return ret; 198 - enable_irq_wake(client->irq); 199 - return 0; 200 - } 201 - 202 182 static int rt1711h_sw_reset(struct rt1711h_chip *chip) 203 183 { 204 184 int ret; ··· 240 260 if (ret < 0) 241 261 return ret; 242 262 243 - ret = rt1711h_init_alert(chip, client); 263 + /* Disable chip interrupts before requesting irq */ 264 + ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0); 244 265 if (ret < 0) 245 266 return ret; 246 267 ··· 251 270 chip->tcpci = tcpci_register_port(chip->dev, &chip->data); 252 271 if (IS_ERR_OR_NULL(chip->tcpci)) 253 272 return PTR_ERR(chip->tcpci); 273 + 274 + ret = devm_request_threaded_irq(chip->dev, client->irq, NULL, 275 + rt1711h_irq, 276 + IRQF_ONESHOT | IRQF_TRIGGER_LOW, 277 + dev_name(chip->dev), chip); 278 + if (ret < 0) 279 + return ret; 280 + enable_irq_wake(client->irq); 254 281 255 282 return 0; 256 283 }