Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'usb-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
"Here are a bunch of USB fixes for your 3.8-rc3 tree. They all either
fix problems that have been reported (like the xhci/hub changes) or
add new device ids to existing drivers.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (39 commits)
usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added
usb: host: ohci-tmio: fix compile warning
USB: Add device quirk for Microsoft VX700 webcam
USB: ehci-fsl: fix regression on mpc5121e
usb: chipidea: Allow disabling streaming not only in udc mode
USB: fsl-mph-dr-of: fix regression on mpc5121e
USB: select USB_ARCH_HAS_EHCI for MXS
USB: hub: handle claim of enabled remote wakeup after reset
USB: cdc-acm: Add support for "PSC Scanning, Magellan 800i"
USB: option: add Nexpring NP10T terminal id
USB: option: add Telekom Speedstick LTE II
USB: option: blacklist network interface on ZTE MF880
usb: imx21-hcd: Include missing linux/module.h
USB: option: Add new MEDIATEK PID support
USB: ehci: make debug port in-use detection functional again
USB: usbtest: fix test number in log message
xhci: Avoid "dead ports", add roothub port polling.
USB: Handle warm reset failure on empty port.
USB: Ignore port state until reset completes.
USB: Increase reset timeout.
...

+257 -89
+1
drivers/usb/Kconfig
··· 37 37 default y if ARCH_W90X900 38 38 default y if ARCH_AT91 39 39 default y if ARCH_MXC 40 + default y if ARCH_MXS 40 41 default y if ARCH_OMAP3 41 42 default y if ARCH_CNS3XXX 42 43 default y if ARCH_VT8500
+3
drivers/usb/chipidea/host.c
··· 70 70 else 71 71 ci->hcd = hcd; 72 72 73 + if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING) 74 + hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); 75 + 73 76 return ret; 74 77 } 75 78
+3
drivers/usb/class/cdc-acm.c
··· 1602 1602 { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */ 1603 1603 .driver_info = NO_UNION_NORMAL, 1604 1604 }, 1605 + { USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */ 1606 + .driver_info = NO_UNION_NORMAL, 1607 + }, 1605 1608 { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ 1606 1609 .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ 1607 1610 },
+96 -24
drivers/usb/core/hub.c
··· 877 877 return ret; 878 878 } 879 879 880 + static int hub_set_port_link_state(struct usb_hub *hub, int port1, 881 + unsigned int link_status) 882 + { 883 + return set_port_feature(hub->hdev, 884 + port1 | (link_status << 3), 885 + USB_PORT_FEAT_LINK_STATE); 886 + } 887 + 888 + /* 889 + * If USB 3.0 ports are placed into the Disabled state, they will no longer 890 + * detect any device connects or disconnects. This is generally not what the 891 + * USB core wants, since it expects a disabled port to produce a port status 892 + * change event when a new device connects. 893 + * 894 + * Instead, set the link state to Disabled, wait for the link to settle into 895 + * that state, clear any change bits, and then put the port into the RxDetect 896 + * state. 897 + */ 898 + static int hub_usb3_port_disable(struct usb_hub *hub, int port1) 899 + { 900 + int ret; 901 + int total_time; 902 + u16 portchange, portstatus; 903 + 904 + if (!hub_is_superspeed(hub->hdev)) 905 + return -EINVAL; 906 + 907 + ret = hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_SS_DISABLED); 908 + if (ret) { 909 + dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n", 910 + port1, ret); 911 + return ret; 912 + } 913 + 914 + /* Wait for the link to enter the disabled state. */ 915 + for (total_time = 0; ; total_time += HUB_DEBOUNCE_STEP) { 916 + ret = hub_port_status(hub, port1, &portstatus, &portchange); 917 + if (ret < 0) 918 + return ret; 919 + 920 + if ((portstatus & USB_PORT_STAT_LINK_STATE) == 921 + USB_SS_PORT_LS_SS_DISABLED) 922 + break; 923 + if (total_time >= HUB_DEBOUNCE_TIMEOUT) 924 + break; 925 + msleep(HUB_DEBOUNCE_STEP); 926 + } 927 + if (total_time >= HUB_DEBOUNCE_TIMEOUT) 928 + dev_warn(hub->intfdev, "Could not disable port %d after %d ms\n", 929 + port1, total_time); 930 + 931 + return hub_set_port_link_state(hub, port1, USB_SS_PORT_LS_RX_DETECT); 932 + } 933 + 880 934 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state) 881 935 { 882 936 struct usb_device *hdev = hub->hdev; ··· 939 885 if (hub->ports[port1 - 1]->child && set_state) 940 886 usb_set_device_state(hub->ports[port1 - 1]->child, 941 887 USB_STATE_NOTATTACHED); 942 - if (!hub->error && !hub_is_superspeed(hub->hdev)) 943 - ret = clear_port_feature(hdev, port1, USB_PORT_FEAT_ENABLE); 888 + if (!hub->error) { 889 + if (hub_is_superspeed(hub->hdev)) 890 + ret = hub_usb3_port_disable(hub, port1); 891 + else 892 + ret = clear_port_feature(hdev, port1, 893 + USB_PORT_FEAT_ENABLE); 894 + } 944 895 if (ret) 945 896 dev_err(hub->intfdev, "cannot disable port %d (err = %d)\n", 946 897 port1, ret); ··· 2499 2440 #define HUB_SHORT_RESET_TIME 10 2500 2441 #define HUB_BH_RESET_TIME 50 2501 2442 #define HUB_LONG_RESET_TIME 200 2502 - #define HUB_RESET_TIMEOUT 500 2443 + #define HUB_RESET_TIMEOUT 800 2503 2444 2504 2445 static int hub_port_reset(struct usb_hub *hub, int port1, 2505 2446 struct usb_device *udev, unsigned int delay, bool warm); ··· 2533 2474 ret = hub_port_status(hub, port1, &portstatus, &portchange); 2534 2475 if (ret < 0) 2535 2476 return ret; 2477 + 2478 + /* The port state is unknown until the reset completes. */ 2479 + if ((portstatus & USB_PORT_STAT_RESET)) 2480 + goto delay; 2536 2481 2537 2482 /* 2538 2483 * Some buggy devices require a warm reset to be issued even ··· 2583 2520 if ((portchange & USB_PORT_STAT_C_CONNECTION)) 2584 2521 return -ENOTCONN; 2585 2522 2586 - /* if we`ve finished resetting, then break out of 2587 - * the loop 2588 - */ 2589 - if (!(portstatus & USB_PORT_STAT_RESET) && 2590 - (portstatus & USB_PORT_STAT_ENABLE)) { 2523 + if ((portstatus & USB_PORT_STAT_ENABLE)) { 2591 2524 if (hub_is_wusb(hub)) 2592 2525 udev->speed = USB_SPEED_WIRELESS; 2593 2526 else if (hub_is_superspeed(hub->hdev)) ··· 2597 2538 return 0; 2598 2539 } 2599 2540 } else { 2600 - if (portchange & USB_PORT_STAT_C_BH_RESET) 2601 - return 0; 2541 + if (!(portstatus & USB_PORT_STAT_CONNECTION) || 2542 + hub_port_warm_reset_required(hub, 2543 + portstatus)) 2544 + return -ENOTCONN; 2545 + 2546 + return 0; 2602 2547 } 2603 2548 2549 + delay: 2604 2550 /* switch to the long delay after two short delay failures */ 2605 2551 if (delay_time >= 2 * HUB_SHORT_RESET_TIME) 2606 2552 delay = HUB_LONG_RESET_TIME; ··· 2629 2565 msleep(10 + 40); 2630 2566 update_devnum(udev, 0); 2631 2567 hcd = bus_to_hcd(udev->bus); 2632 - if (hcd->driver->reset_device) { 2633 - *status = hcd->driver->reset_device(hcd, udev); 2634 - if (*status < 0) { 2635 - dev_err(&udev->dev, "Cannot reset " 2636 - "HCD device state\n"); 2637 - break; 2638 - } 2639 - } 2568 + /* The xHC may think the device is already reset, 2569 + * so ignore the status. 2570 + */ 2571 + if (hcd->driver->reset_device) 2572 + hcd->driver->reset_device(hcd, udev); 2640 2573 } 2641 2574 /* FALL THROUGH */ 2642 2575 case -ENOTCONN: ··· 2641 2580 clear_port_feature(hub->hdev, 2642 2581 port1, USB_PORT_FEAT_C_RESET); 2643 2582 /* FIXME need disconnect() for NOTATTACHED device */ 2644 - if (warm) { 2583 + if (hub_is_superspeed(hub->hdev)) { 2645 2584 clear_port_feature(hub->hdev, port1, 2646 2585 USB_PORT_FEAT_C_BH_PORT_RESET); 2647 2586 clear_port_feature(hub->hdev, port1, 2648 2587 USB_PORT_FEAT_C_PORT_LINK_STATE); 2649 - } else { 2588 + } 2589 + if (!warm) 2650 2590 usb_set_device_state(udev, *status 2651 2591 ? USB_STATE_NOTATTACHED 2652 2592 : USB_STATE_DEFAULT); 2653 - } 2654 2593 break; 2655 2594 } 2656 2595 } ··· 3000 2939 static int finish_port_resume(struct usb_device *udev) 3001 2940 { 3002 2941 int status = 0; 3003 - u16 devstatus; 2942 + u16 devstatus = 0; 3004 2943 3005 2944 /* caller owns the udev device lock */ 3006 2945 dev_dbg(&udev->dev, "%s\n", ··· 3045 2984 if (status) { 3046 2985 dev_dbg(&udev->dev, "gone after usb resume? status %d\n", 3047 2986 status); 3048 - } else if (udev->actconfig) { 2987 + /* 2988 + * There are a few quirky devices which violate the standard 2989 + * by claiming to have remote wakeup enabled after a reset, 2990 + * which crash if the feature is cleared, hence check for 2991 + * udev->reset_resume 2992 + */ 2993 + } else if (udev->actconfig && !udev->reset_resume) { 3049 2994 le16_to_cpus(&devstatus); 3050 2995 if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) { 3051 2996 status = usb_control_msg(udev, ··· 4705 4638 * SS.Inactive state. 4706 4639 */ 4707 4640 if (hub_port_warm_reset_required(hub, portstatus)) { 4641 + int status; 4642 + 4708 4643 dev_dbg(hub_dev, "warm reset port %d\n", i); 4709 - hub_port_reset(hub, i, NULL, 4644 + status = hub_port_reset(hub, i, NULL, 4710 4645 HUB_BH_RESET_TIME, true); 4646 + if (status < 0) 4647 + hub_port_disable(hub, i, 1); 4648 + connect_change = 0; 4711 4649 } 4712 4650 4713 4651 if (connect_change)
+3
drivers/usb/core/quirks.c
··· 43 43 /* Creative SB Audigy 2 NX */ 44 44 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, 45 45 46 + /* Microsoft LifeCam-VX700 v2.0 */ 47 + { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME }, 48 + 46 49 /* Logitech Quickcam Fusion */ 47 50 { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME }, 48 51
+1 -1
drivers/usb/dwc3/debugfs.c
··· 56 56 #define dump_register(nm) \ 57 57 { \ 58 58 .name = __stringify(nm), \ 59 - .offset = DWC3_ ##nm, \ 59 + .offset = DWC3_ ##nm - DWC3_GLOBALS_REGS_START, \ 60 60 } 61 61 62 62 static const struct debugfs_reg32 dwc3_regs[] = {
+2 -2
drivers/usb/gadget/amd5536udc.c
··· 3231 3231 } 3232 3232 3233 3233 if (!pdev->irq) { 3234 - dev_err(&dev->pdev->dev, "irq not set\n"); 3234 + dev_err(&pdev->dev, "irq not set\n"); 3235 3235 kfree(dev); 3236 3236 dev = NULL; 3237 3237 retval = -ENODEV; ··· 3250 3250 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR); 3251 3251 3252 3252 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3253 - dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3253 + dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3254 3254 kfree(dev); 3255 3255 dev = NULL; 3256 3256 retval = -EBUSY;
+5 -4
drivers/usb/gadget/dummy_hcd.c
··· 130 130 static const char *const ep_name[] = { 131 131 ep0name, /* everyone has ep0 */ 132 132 133 - /* act like a net2280: high speed, six configurable endpoints */ 134 - "ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f", 135 - 136 - /* or like pxa250: fifteen fixed function endpoints */ 133 + /* act like a pxa250: fifteen fixed function endpoints */ 137 134 "ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int", 138 135 "ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int", 139 136 "ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso", ··· 138 141 139 142 /* or like sa1100: two fixed function endpoints */ 140 143 "ep1out-bulk", "ep2in-bulk", 144 + 145 + /* and now some generic EPs so we have enough in multi config */ 146 + "ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in", 147 + "ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out", 141 148 }; 142 149 #define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name) 143 150
+2 -2
drivers/usb/gadget/mv_udc_core.c
··· 1012 1012 unsigned int i; 1013 1013 1014 1014 for (i = 0; i < udc->clknum; i++) 1015 - clk_enable(udc->clk[i]); 1015 + clk_prepare_enable(udc->clk[i]); 1016 1016 } 1017 1017 1018 1018 static void udc_clock_disable(struct mv_udc *udc) ··· 1020 1020 unsigned int i; 1021 1021 1022 1022 for (i = 0; i < udc->clknum; i++) 1023 - clk_disable(udc->clk[i]); 1023 + clk_disable_unprepare(udc->clk[i]); 1024 1024 } 1025 1025 1026 1026 static void udc_stop(struct mv_udc *udc)
+2 -3
drivers/usb/gadget/s3c-hsotg.c
··· 3477 3477 /** 3478 3478 * s3c_hsotg_release - release callback for hsotg device 3479 3479 * @dev: Device to for which release is called 3480 + * 3481 + * Nothing to do as the resource is allocated using devm_ API. 3480 3482 */ 3481 3483 static void s3c_hsotg_release(struct device *dev) 3482 3484 { 3483 - struct s3c_hsotg *hsotg = dev_get_drvdata(dev); 3484 - 3485 - kfree(hsotg); 3486 3485 } 3487 3486 3488 3487 /**
+2 -1
drivers/usb/gadget/tcm_usb_gadget.c
··· 1794 1794 tpg->tpg_nexus = NULL; 1795 1795 1796 1796 kfree(tv_nexus); 1797 + ret = 0; 1797 1798 out: 1798 1799 mutex_unlock(&tpg->tpg_mutex); 1799 - return 0; 1800 + return ret; 1800 1801 } 1801 1802 1802 1803 static ssize_t tcm_usbg_tpg_store_nexus(
+1 -1
drivers/usb/gadget/u_serial.c
··· 887 887 pr_debug("gs_close: ttyGS%d (%p,%p) done!\n", 888 888 port->port_num, tty, file); 889 889 890 - wake_up_interruptible(&port->port.close_wait); 890 + wake_up(&port->port.close_wait); 891 891 exit: 892 892 spin_unlock_irq(&port->port_lock); 893 893 }
+5 -4
drivers/usb/host/ehci-fsl.c
··· 230 230 231 231 switch (phy_mode) { 232 232 case FSL_USB2_PHY_ULPI: 233 - if (pdata->controller_ver) { 233 + if (pdata->have_sysif_regs && pdata->controller_ver) { 234 234 /* controller version 1.6 or above */ 235 235 setbits32(non_ehci + FSL_SOC_USB_CTRL, 236 236 ULPI_PHY_CLK_SEL); ··· 251 251 portsc |= PORT_PTS_PTW; 252 252 /* fall through */ 253 253 case FSL_USB2_PHY_UTMI: 254 - if (pdata->controller_ver) { 254 + if (pdata->have_sysif_regs && pdata->controller_ver) { 255 255 /* controller version 1.6 or above */ 256 256 setbits32(non_ehci + FSL_SOC_USB_CTRL, UTMI_PHY_EN); 257 257 mdelay(FSL_UTMI_PHY_DLY); /* Delay for UTMI PHY CLK to ··· 267 267 break; 268 268 } 269 269 270 - if (pdata->controller_ver && (phy_mode == FSL_USB2_PHY_ULPI)) { 270 + if (pdata->have_sysif_regs && pdata->controller_ver && 271 + (phy_mode == FSL_USB2_PHY_ULPI)) { 271 272 /* check PHY_CLK_VALID to get phy clk valid */ 272 273 if (!spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) & 273 274 PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0)) { ··· 279 278 280 279 ehci_writel(ehci, portsc, &ehci->regs->port_status[port_offset]); 281 280 282 - if (phy_mode != FSL_USB2_PHY_ULPI) 281 + if (phy_mode != FSL_USB2_PHY_ULPI && pdata->have_sysif_regs) 283 282 setbits32(non_ehci + FSL_SOC_USB_CTRL, USB_CTRL_USB_EN); 284 283 285 284 return 0;
+2 -2
drivers/usb/host/ehci-mv.c
··· 43 43 unsigned int i; 44 44 45 45 for (i = 0; i < ehci_mv->clknum; i++) 46 - clk_enable(ehci_mv->clk[i]); 46 + clk_prepare_enable(ehci_mv->clk[i]); 47 47 } 48 48 49 49 static void ehci_clock_disable(struct ehci_hcd_mv *ehci_mv) ··· 51 51 unsigned int i; 52 52 53 53 for (i = 0; i < ehci_mv->clknum; i++) 54 - clk_disable(ehci_mv->clk[i]); 54 + clk_disable_unprepare(ehci_mv->clk[i]); 55 55 } 56 56 57 57 static int mv_ehci_enable(struct ehci_hcd_mv *ehci_mv)
+20 -19
drivers/usb/host/ehci-pci.c
··· 200 200 break; 201 201 } 202 202 203 + /* optional debug port, normally in the first BAR */ 204 + temp = pci_find_capability(pdev, PCI_CAP_ID_DBG); 205 + if (temp) { 206 + pci_read_config_dword(pdev, temp, &temp); 207 + temp >>= 16; 208 + if (((temp >> 13) & 7) == 1) { 209 + u32 hcs_params = ehci_readl(ehci, 210 + &ehci->caps->hcs_params); 211 + 212 + temp &= 0x1fff; 213 + ehci->debug = hcd->regs + temp; 214 + temp = ehci_readl(ehci, &ehci->debug->control); 215 + ehci_info(ehci, "debug port %d%s\n", 216 + HCS_DEBUG_PORT(hcs_params), 217 + (temp & DBGP_ENABLED) ? " IN USE" : ""); 218 + if (!(temp & DBGP_ENABLED)) 219 + ehci->debug = NULL; 220 + } 221 + } 222 + 203 223 retval = ehci_setup(hcd); 204 224 if (retval) 205 225 return retval; ··· 246 226 break; 247 227 } 248 228 break; 249 - } 250 - 251 - /* optional debug port, normally in the first BAR */ 252 - temp = pci_find_capability(pdev, 0x0a); 253 - if (temp) { 254 - pci_read_config_dword(pdev, temp, &temp); 255 - temp >>= 16; 256 - if ((temp & (3 << 13)) == (1 << 13)) { 257 - temp &= 0x1fff; 258 - ehci->debug = hcd->regs + temp; 259 - temp = ehci_readl(ehci, &ehci->debug->control); 260 - ehci_info(ehci, "debug port %d%s\n", 261 - HCS_DEBUG_PORT(ehci->hcs_params), 262 - (temp & DBGP_ENABLED) 263 - ? " IN USE" 264 - : ""); 265 - if (!(temp & DBGP_ENABLED)) 266 - ehci->debug = NULL; 267 - } 268 229 } 269 230 270 231 /* at least the Genesys GL880S needs fixup here */
+3
drivers/usb/host/fsl-mph-dr-of.c
··· 142 142 return ver; 143 143 } 144 144 145 + if (of_device_is_compatible(np, "fsl,mpc5121-usb2-dr")) 146 + return FSL_USB_VER_OLD; 147 + 145 148 if (of_device_is_compatible(np, "fsl-usb2-mph")) { 146 149 if (of_device_is_compatible(np, "fsl-usb2-mph-v1.6")) 147 150 ver = FSL_USB_VER_1_6;
+1
drivers/usb/host/imx21-hcd.c
··· 58 58 #include <linux/usb.h> 59 59 #include <linux/usb/hcd.h> 60 60 #include <linux/dma-mapping.h> 61 + #include <linux/module.h> 61 62 62 63 #include "imx21-hcd.h" 63 64
+2 -1
drivers/usb/host/ohci-tmio.c
··· 128 128 tmio_iowrite8(2, tmio->ccr + CCR_INTC); 129 129 130 130 dev_info(&dev->dev, "revision %d @ 0x%08llx, irq %d\n", 131 - tmio_ioread8(tmio->ccr + CCR_REVID), hcd->rsrc_start, hcd->irq); 131 + tmio_ioread8(tmio->ccr + CCR_REVID), 132 + (u64) hcd->rsrc_start, hcd->irq); 132 133 } 133 134 134 135 static int ohci_tmio_start(struct usb_hcd *hcd)
+36 -2
drivers/usb/host/xhci-hub.c
··· 761 761 break; 762 762 case USB_PORT_FEAT_LINK_STATE: 763 763 temp = xhci_readl(xhci, port_array[wIndex]); 764 + 765 + /* Disable port */ 766 + if (link_state == USB_SS_PORT_LS_SS_DISABLED) { 767 + xhci_dbg(xhci, "Disable port %d\n", wIndex); 768 + temp = xhci_port_state_to_neutral(temp); 769 + /* 770 + * Clear all change bits, so that we get a new 771 + * connection event. 772 + */ 773 + temp |= PORT_CSC | PORT_PEC | PORT_WRC | 774 + PORT_OCC | PORT_RC | PORT_PLC | 775 + PORT_CEC; 776 + xhci_writel(xhci, temp | PORT_PE, 777 + port_array[wIndex]); 778 + temp = xhci_readl(xhci, port_array[wIndex]); 779 + break; 780 + } 781 + 782 + /* Put link in RxDetect (enable port) */ 783 + if (link_state == USB_SS_PORT_LS_RX_DETECT) { 784 + xhci_dbg(xhci, "Enable port %d\n", wIndex); 785 + xhci_set_link_state(xhci, port_array, wIndex, 786 + link_state); 787 + temp = xhci_readl(xhci, port_array[wIndex]); 788 + break; 789 + } 790 + 764 791 /* Software should not attempt to set 765 - * port link state above '5' (Rx.Detect) and the port 792 + * port link state above '3' (U3) and the port 766 793 * must be enabled. 767 794 */ 768 795 if ((temp & PORT_PE) == 0 || 769 - (link_state > USB_SS_PORT_LS_RX_DETECT)) { 796 + (link_state > USB_SS_PORT_LS_U3)) { 770 797 xhci_warn(xhci, "Cannot set link state.\n"); 771 798 goto error; 772 799 } ··· 984 957 int max_ports; 985 958 __le32 __iomem **port_array; 986 959 struct xhci_bus_state *bus_state; 960 + bool reset_change = false; 987 961 988 962 max_ports = xhci_get_ports(hcd, &port_array); 989 963 bus_state = &xhci->bus_state[hcd_index(hcd)]; ··· 1016 988 buf[(i + 1) / 8] |= 1 << (i + 1) % 8; 1017 989 status = 1; 1018 990 } 991 + if ((temp & PORT_RC)) 992 + reset_change = true; 993 + } 994 + if (!status && !reset_change) { 995 + xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); 996 + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); 1019 997 } 1020 998 spin_unlock_irqrestore(&xhci->lock, flags); 1021 999 return status ? retval : 0;
+2
drivers/usb/host/xhci-mem.c
··· 1250 1250 static unsigned int xhci_parse_microframe_interval(struct usb_device *udev, 1251 1251 struct usb_host_endpoint *ep) 1252 1252 { 1253 + if (ep->desc.bInterval == 0) 1254 + return 0; 1253 1255 return xhci_microframes_to_exponent(udev, ep, 1254 1256 ep->desc.bInterval, 0, 15); 1255 1257 }
+9
drivers/usb/host/xhci-ring.c
··· 1725 1725 if (bogus_port_status) 1726 1726 return; 1727 1727 1728 + /* 1729 + * xHCI port-status-change events occur when the "or" of all the 1730 + * status-change bits in the portsc register changes from 0 to 1. 1731 + * New status changes won't cause an event if any other change 1732 + * bits are still set. When an event occurs, switch over to 1733 + * polling to avoid losing status changes. 1734 + */ 1735 + xhci_dbg(xhci, "%s: starting port polling.\n", __func__); 1736 + set_bit(HCD_FLAG_POLL_RH, &hcd->flags); 1728 1737 spin_unlock(&xhci->lock); 1729 1738 /* Pass this up to the core */ 1730 1739 usb_hcd_poll_rh_status(hcd);
+10
drivers/usb/host/xhci.c
··· 884 884 xhci->shared_hcd->state != HC_STATE_SUSPENDED) 885 885 return -EINVAL; 886 886 887 + /* Don't poll the roothubs on bus suspend. */ 888 + xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); 889 + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); 890 + del_timer_sync(&hcd->rh_timer); 891 + 887 892 spin_lock_irq(&xhci->lock); 888 893 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 889 894 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); ··· 1073 1068 */ 1074 1069 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 1075 1070 compliance_mode_recovery_timer_init(xhci); 1071 + 1072 + /* Re-enable port polling. */ 1073 + xhci_dbg(xhci, "%s: starting port polling.\n", __func__); 1074 + set_bit(HCD_FLAG_POLL_RH, &hcd->flags); 1075 + usb_hcd_poll_rh_status(hcd); 1076 1076 1077 1077 return retval; 1078 1078 }
+1 -1
drivers/usb/misc/usbtest.c
··· 2179 2179 if (dev->out_pipe == 0 || !param->length || param->sglen < 4) 2180 2180 break; 2181 2181 retval = 0; 2182 - dev_info(&intf->dev, "TEST 17: unlink from %d queues of " 2182 + dev_info(&intf->dev, "TEST 24: unlink from %d queues of " 2183 2183 "%d %d-byte writes\n", 2184 2184 param->iterations, param->sglen, param->length); 2185 2185 for (i = param->iterations; retval == 0 && i > 0; --i) {
+1 -4
drivers/usb/musb/musb_core.c
··· 2298 2298 if (usb_disabled()) 2299 2299 return 0; 2300 2300 2301 - pr_info("%s: version " MUSB_VERSION ", " 2302 - "?dma?" 2303 - ", " 2304 - "otg (peripheral+host)", 2301 + pr_info("%s: version " MUSB_VERSION ", ?dma?, otg (peripheral+host)\n", 2305 2302 musb_driver_name); 2306 2303 return platform_driver_register(&musb_driver); 2307 2304 }
+5
drivers/usb/musb/musb_dsps.c
··· 134 134 DSPS_AM33XX_CONTROL_MODULE_PHYS_1, 135 135 }; 136 136 137 + #define USBPHY_CM_PWRDN (1 << 0) 138 + #define USBPHY_OTG_PWRDN (1 << 1) 139 + #define USBPHY_OTGVDET_EN (1 << 19) 140 + #define USBPHY_OTGSESSEND_EN (1 << 20) 141 + 137 142 /** 138 143 * musb_dsps_phy_control - phy on/off 139 144 * @glue: struct dsps_glue *
+1 -1
drivers/usb/otg/Kconfig
··· 110 110 111 111 config FSL_USB2_OTG 112 112 bool "Freescale USB OTG Transceiver Driver" 113 - depends on USB_EHCI_FSL && USB_GADGET_FSL_USB2 && USB_SUSPEND 113 + depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND 114 114 select USB_OTG 115 115 select USB_OTG_UTILS 116 116 help
+2 -2
drivers/usb/otg/mv_otg.c
··· 240 240 unsigned int i; 241 241 242 242 for (i = 0; i < mvotg->clknum; i++) 243 - clk_enable(mvotg->clk[i]); 243 + clk_prepare_enable(mvotg->clk[i]); 244 244 } 245 245 246 246 static void otg_clock_disable(struct mv_otg *mvotg) ··· 248 248 unsigned int i; 249 249 250 250 for (i = 0; i < mvotg->clknum; i++) 251 - clk_disable(mvotg->clk[i]); 251 + clk_disable_unprepare(mvotg->clk[i]); 252 252 } 253 253 254 254 static int mv_otg_enable_internal(struct mv_otg *mvotg)
+9 -13
drivers/usb/renesas_usbhs/mod_gadget.c
··· 545 545 return 0; 546 546 } 547 547 548 - static void usbhsg_uep_init(struct usbhsg_gpriv *gpriv) 549 - { 550 - int i; 551 - struct usbhsg_uep *uep; 552 - 553 - usbhsg_for_each_uep_with_dcp(uep, gpriv, i) 554 - uep->pipe = NULL; 555 - } 556 - 557 548 /* 558 549 * 559 550 * usb_ep_ops ··· 601 610 { 602 611 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); 603 612 604 - return usbhsg_pipe_disable(uep); 613 + usbhsg_pipe_disable(uep); 614 + 615 + uep->pipe->mod_private = NULL; 616 + uep->pipe = NULL; 617 + 618 + return 0; 605 619 } 606 620 607 621 static struct usb_request *usbhsg_ep_alloc_request(struct usb_ep *ep, ··· 757 761 usbhs_pipe_init(priv, 758 762 usbhsg_dma_map_ctrl); 759 763 usbhs_fifo_init(priv); 760 - usbhsg_uep_init(gpriv); 761 764 762 - /* dcp init */ 765 + /* dcp init instead of usbhsg_ep_enable() */ 763 766 dcp->pipe = usbhs_dcp_malloc(priv); 764 767 dcp->pipe->mod_private = dcp; 765 768 usbhs_pipe_config_update(dcp->pipe, 0, 0, 64); ··· 820 825 usbhs_sys_set_test_mode(priv, 0); 821 826 usbhs_sys_function_ctrl(priv, 0); 822 827 823 - usbhsg_pipe_disable(dcp); 828 + usbhsg_ep_disable(&dcp->ep); 824 829 825 830 dev_dbg(dev, "stop gadget\n"); 826 831 ··· 993 998 */ 994 999 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) { 995 1000 uep->gpriv = gpriv; 1001 + uep->pipe = NULL; 996 1002 snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i); 997 1003 998 1004 uep->ep.name = uep->ep_name;
+2 -1
drivers/usb/renesas_usbhs/mod_host.c
··· 661 661 status = -ESHUTDOWN; 662 662 663 663 urb->actual_length = pkt->actual; 664 - usbhsh_ureq_free(hpriv, ureq); 665 664 666 665 usbhsh_endpoint_sequence_save(hpriv, urb, pkt); 666 + usbhsh_ureq_free(hpriv, ureq); 667 + 667 668 usbhsh_pipe_detach(hpriv, usbhsh_ep_to_uep(urb->ep)); 668 669 669 670 usb_hcd_unlink_urb_from_ep(hcd, urb);
+2
drivers/usb/serial/ftdi_sio.c
··· 875 875 { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID), 876 876 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 877 877 { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) }, 878 + /* Crucible Devices */ 879 + { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) }, 878 880 { }, /* Optional parameter entry */ 879 881 { } /* Terminating entry */ 880 882 };
+6
drivers/usb/serial/ftdi_sio_ids.h
··· 1259 1259 * ATI command output: Cinterion MC55i 1260 1260 */ 1261 1261 #define FTDI_CINTERION_MC55I_PID 0xA951 1262 + 1263 + /* 1264 + * Product: Comet Caller ID decoder 1265 + * Manufacturer: Crucible Technologies 1266 + */ 1267 + #define FTDI_CT_COMET_PID 0x8e08
+17 -1
drivers/usb/serial/option.c
··· 288 288 #define ALCATEL_VENDOR_ID 0x1bbb 289 289 #define ALCATEL_PRODUCT_X060S_X200 0x0000 290 290 #define ALCATEL_PRODUCT_X220_X500D 0x0017 291 + #define ALCATEL_PRODUCT_L100V 0x011e 291 292 292 293 #define PIRELLI_VENDOR_ID 0x1266 293 294 #define PIRELLI_PRODUCT_C100_1 0x1002 ··· 430 429 #define MEDIATEK_VENDOR_ID 0x0e8d 431 430 #define MEDIATEK_PRODUCT_DC_1COM 0x00a0 432 431 #define MEDIATEK_PRODUCT_DC_4COM 0x00a5 432 + #define MEDIATEK_PRODUCT_DC_4COM2 0x00a7 433 433 #define MEDIATEK_PRODUCT_DC_5COM 0x00a4 434 434 #define MEDIATEK_PRODUCT_7208_1COM 0x7101 435 435 #define MEDIATEK_PRODUCT_7208_2COM 0x7102 436 + #define MEDIATEK_PRODUCT_7103_2COM 0x7103 437 + #define MEDIATEK_PRODUCT_7106_2COM 0x7106 436 438 #define MEDIATEK_PRODUCT_FP_1COM 0x0003 437 439 #define MEDIATEK_PRODUCT_FP_2COM 0x0023 438 440 #define MEDIATEK_PRODUCT_FPDC_1COM 0x0043 ··· 444 440 /* Cellient products */ 445 441 #define CELLIENT_VENDOR_ID 0x2692 446 442 #define CELLIENT_PRODUCT_MEN200 0x9005 443 + 444 + /* Hyundai Petatel Inc. products */ 445 + #define PETATEL_VENDOR_ID 0x1ff4 446 + #define PETATEL_PRODUCT_NP10T 0x600e 447 447 448 448 /* some devices interfaces need special handling due to a number of reasons */ 449 449 enum option_blacklist_reason { ··· 931 923 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ 932 924 .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 933 925 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) }, 934 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) }, 926 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */ 927 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 935 928 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) }, 936 929 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff), 937 930 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ··· 1199 1190 .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist 1200 1191 }, 1201 1192 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) }, 1193 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V), 1194 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1202 1195 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 1203 1196 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 1204 1197 { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), ··· 1305 1294 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) }, 1306 1295 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) }, 1307 1296 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) }, 1297 + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7103_2COM, 0xff, 0x00, 0x00) }, 1298 + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) }, 1299 + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, 1300 + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, 1308 1301 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, 1302 + { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) }, 1309 1303 { } /* Terminating entry */ 1310 1304 }; 1311 1305 MODULE_DEVICE_TABLE(usb, option_ids);