14 Mar, 2011

12 commits

  • Update the USB core to deal with USB 3.0 hubs. These hubs have a slightly
    different hub descriptor than USB 2.0 hubs, with a fixed (rather than
    variable length) size. Change the USB core's hub descriptor to have a
    union for the last fields that differ. Change the host controller drivers
    that access those last fields (DeviceRemovable and PortPowerCtrlMask) to
    use the union.

    Translate the new version of the hub port status field into the old
    version that khubd understands. (Note: we need to fix it to translate the
    roothub's port status once we stop converting it to USB 2.0 hub status
    internally.)

    Add new code to handle link state change status. Send out new control
    messages that are needed for USB 3.0 hubs, like Set Hub Depth.

    This patch is a modified version of the original patch submitted by John
    Youn. It's updated to reflect the removal of the "bitmap" #define, and
    change the hub descriptor accesses of a couple new host controller
    drivers.

    Signed-off-by: John Youn
    Signed-off-by: Sarah Sharp
    Cc: Nobuhiro Iwamatsu
    Cc: Inaky Perez-Gonzalez
    Cc: Tony Olech
    Cc: "Robert P. J. Day"
    Cc: Max Vozeler
    Cc: Tejun Heo
    Cc: Yoshihiro Shimoda
    Cc: Rodolfo Giometti
    Cc: Mike Frysinger
    Cc: Anton Vorontsov
    Cc: Sebastian Siewior
    Cc: Lothar Wassmann
    Cc: Olav Kongas
    Cc: Martin Fuzzey
    Cc: Alan Stern
    Cc: David Brownell

    John Youn
     
  • The USB core will set hcd->state to HC_STATE_RUNNING before calling
    xhci_run, so there's no point in setting it twice. The USB core also
    doesn't pay attention to HC_STATE_RUNNING on the resume path anymore; it
    uses HCD_RH_RUNNING(), which looks at hcd->flags & (1U <<
    HCD_FLAG_RH_RUNNING. Therefore, it's safe to remove the state set in
    xhci_bus_resume().

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • We would like to allow host controller drivers to stop using hcd->state.
    Unfortunately, some host controller drivers use hcd->state as an
    implicit way of telling the core that a controller has died. The
    roothub registration functions must assume the host died if hcd->state
    equals HC_STATE_HALT.

    To facilitate drivers that don't want to set hcd->state to
    HC_STATE_RUNNING in their initialization routines, we set the state to
    running before calling the host controller's start function.

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • The xHCI driver doesn't ever test hcd->state for HC_STATE_HALT. The USB
    core recently stopped using it internally, so there's no point in setting
    it in the driver. We still need to set HC_STATE_RUNNING in order to make
    it past the USB core's hcd->state check in register_roothub().

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • xHCI 1.0 spec specifies the xHC shall halt within 16ms after software clears
    Run/Stop bit. In xHCI 0.96 spec the time limit is 16 microframes (2ms), it's
    too short and often cause dmesg shows "Host controller not halted, aborting
    reset." message when rmmod xhci-hcd.

    Modify the time limit to comply with xHCI 1.0 specification and prevents the
    warning message showing when remove xhci-hcd.

    Signed-off-by: Andiry Xu
    Signed-off-by: Sarah Sharp

    Andiry Xu
     
  • Set hcd->state = HC_STATE_SUSPENDED if there is a power loss during system
    resume or the system is hibernated, otherwise leave it be. The variable
    old_state is redundant and made an unreachable code path, so remove it.

    Signed-off-by: Andiry Xu
    Signed-off-by: Sarah Sharp

    Andiry Xu
     
  • The xhci_bus_suspend() and xhci_bus_resume() functions are a bit hard to
    read, because they have an ambiguously named variable "port". Rename it
    to "port_index". Introduce a new temporary variable, "max_ports" that
    holds the maximum number of roothub ports the host controller supports.
    This will reduce the number of register reads, and make it easy to change
    the maximum number of ports when there are two roothubs.

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • The USB core only allows up to 31 (USB_MAXCHILDREN) ports under a roothub.
    The xHCI driver keeps track of which ports are suspended, which ports have
    a suspend change bit set, and what time the port will be done resuming.
    It keeps track of the first two by setting a bit in a u32 variable,
    suspended_ports or port_c_suspend. The xHCI driver currently assumes we
    can have up to 256 ports under a roothub, so it allocates an array of 8
    u32 variables for both suspended_ports and port_c_suspend. It also
    allocates a 256-element array to keep track of when the ports will be done
    resuming.

    Since we can only have 31 roothub ports, we only need to use one u32 for
    each of the suspend state and change variables. We simplify the bit math
    that's trying to index into those arrays and set the correct bit, if we
    assume wIndex never exceeds 30. (wIndex is zero-based after it's
    decremented from the value passed in from the USB core.) Finally, we
    change the resume_done array to only hold 31 elements.

    Signed-off-by: Sarah Sharp
    Cc: Andiry Xu

    Sarah Sharp
     
  • The irq enabling code is going to be refactored into a new function, so
    clean up some checkpatch errors before moving it.

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • Using a #define to redefine a common variable name is a bad thing,
    especially when the #define is in a header. include/linux/usb/hcd.h
    redefined bitmap to DeviceRemovable to avoid typing a long field in the
    hub descriptor. This has unintended side effects for files like
    drivers/usb/core/devio.c that include that file, since another header
    included after hcd.h has different variables named bitmap.

    Remove the bitmap #define and replace instances of it in the host
    controller code. Cleanup the spaces around function calls and square
    brackets while we're at it.

    Signed-off-by: Sarah Sharp
    Cc: Nobuhiro Iwamatsu
    Cc: Inaky Perez-Gonzalez
    Cc: Tony Olech
    Cc: "Robert P. J. Day"
    Cc: Max Vozeler
    Cc: Tejun Heo
    Cc: Yoshihiro Shimoda
    Cc: Rodolfo Giometti
    Cc: Mike Frysinger
    Cc: Anton Vorontsov
    Cc: Sebastian Siewior
    Cc: Lothar Wassmann
    Cc: Olav Kongas
    Cc: Martin Fuzzey
    Cc: Alan Stern
    Cc: David Brownell

    Sarah Sharp
     
  • The test of placing a number of command no-ops on the command ring and
    counting the number of no-op events that were generated was only used
    during the initial xHCI driver bring up. This test is no longer used, so
    delete it.

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     
  • The PM core reacts badly when the return code from usb_runtime_suspend()
    is not 0, -EAGAIN, or -EBUSY. The PM core regards this as a fatal error,
    and refuses to run anymore PM helper functions. In particular,
    usbfs_open() and other usbfs functions will fail because the PM core will
    return an error code when usb_autoresume_device() is called. This causes
    libusb and/or lsusb to either hang or segfault.

    If a USB device cannot suspend for some reason (e.g. a hub doesn't report
    it has remote wakeup capabilities), we still want lsusb and other
    userspace programs to work. So return -EBUSY, which will fill people's
    log files with failed tries, but will ensure userspace still works.

    Signed-off-by: Sarah Sharp

    Sarah Sharp
     

12 Mar, 2011

7 commits

  • The Tegra2 USB controller doesn't properly deal with misaligned DMA
    buffers, causing corruption. This is especially prevalent with USB
    network adapters, where skbuff alignment is often in the middle of a
    4-byte dword.

    To avoid this, allocate a temporary buffer for the DMA if the provided
    buffer isn't sufficiently aligned.

    Signed-off-by: Robert Morell
    Signed-off-by: Benoit Goby
    Signed-off-by: Greg Kroah-Hartman

    Robert Morell
     
  • The Tegra 2 SoC has 3 EHCI compatible USB controllers. This patch adds
    the necessary glue to allow the ehci-hcd driver to work on Tegra 2
    SoCs.

    The platform data is used to configure board-specific phy settings and
    to configure the operating mode, as one of the ports may be used as a otg
    port. For additional power saving, the driver supports powering down the
    phy on bus suspend when it is used, for example, to connect an internal
    device that use an out-of-band remote wakeup mechanism (e.g. a gpio).

    Signed-off-by: Benoit Goby
    Signed-off-by: Greg Kroah-Hartman

    Benoit Goby
     
  • Interface used by Tegra's gadget driver and ehci driver
    to power on and configure the USB PHYs.

    Signed-off-by: Benoit Goby
    Signed-off-by: Greg Kroah-Hartman

    Benoit Goby
     
  • Add generic access ops for controllers with a ulpi viewport register
    (e.g. Chipidea/ARC based controllers).

    Signed-off-by: Benoit Goby
    Signed-off-by: Greg Kroah-Hartman

    Benoit Goby
     
  • I picked up a new DAK-780EX(professional digitl reverb/mix system),
    which use CH341T chipset to communication with computer on 3/2011
    and the CH341T's vendor code is 1a86

    Looking up the CH341T's vendor and product id's I see:

    1a86 QinHeng Electronics
    5523 CH341 in serial mode, usb to serial port converter

    CH341T,CH341 are the products of the same company, maybe
    have some common hardware, and I test the ch341.c works
    well with CH341T

    Cc: Linus Torvalds
    Cc: stable

    Signed-off-by: Greg Kroah-Hartman

    wangyanqing
     
  • On a laptop I see these errors on (most) resumes:
    hub 3-0:1.0: over-current change on port 1
    hub 3-0:1.0: over-current change on port 2

    Since over-current conditions can disappear quite quickly it's better to
    downgrade that message to debug level, recheck for an over-current
    condition a little later and only print and over-current condition error
    if that condition (still) exists when it's rechecked.

    Add similar logic to hub over-current changes. (That code is untested,
    as those changes do not occur on this laptop.)

    Signed-off-by: Paul Bolle
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Paul Bolle
     
  • Fix the following section mismatch warning:

    WARNING: drivers/usb/built-in.o(.data+0x74c): Section mismatch in reference from the variable ehci_atmel_driver to the function .init.text:ehci_atmel_drv_probe()
    The variable ehci_atmel_driver references
    the function __init ehci_atmel_drv_probe()
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the variable:
    *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

    Signed-off-by: Hubert Feurstein
    Signed-off-by: Nicolas Ferre
    Signed-off-by: Greg Kroah-Hartman

    Hubert Feurstein
     

10 Mar, 2011

3 commits

  • Adding support for the OLIMEX ARM-USB-OCD-H JTAG device (id 15ba:002b)
    based on FTDI FT2232H

    Signed-off-by: JF Argentino
    Acked-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    JF Argentino
     
  • On https://bugs.launchpad.net/ubuntu/+source/linux/+bug/636091, one of
    the cases reported is a big timeout on option_send_setup, which causes
    some side effects as tty_lock is held. Looks like some of ZTE MF626
    devices also don't like the RTS/DTR setting in option_send_setup, like
    with 4G XS Stick W14. The reporter confirms which this it solves the
    long freezes in his system.

    Signed-off-by: Herton Ronaldo Krzesinski
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Herton Ronaldo Krzesinski
     
  • Direct access to PMIC register is not safe and will impact battery
    charging. New IPC command supported in SCU FW for VBus power control.
    USB OTG driver will switch to such commands instead of direct access
    to PMIC register for safety and SCU FW will handle the actual work
    after got the request(IPC command).

    Due to this change, usb driver should wait more time for sync OTGSC
    with USBCFG by SCU. Update wait time from 2ms to 5ms.

    Signed-off-by: Hao Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Hao Wu
     

08 Mar, 2011

7 commits

  • Currently all boards using the s3c2410_udc driver use a GPIO to control the
    state of the pullup, as a result the same code is reimplemented in each board
    This patch changes these boards to use the common implementation for GPIO
    controlled pullup in the UDC driver.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Vasily Khoruzhick
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • Currently all boards using the s3c2410_udc driver use a GPIO to control the
    state of the pullup, as a result the same code is reimplemented in each board
    file.
    This patch adds support for using a GPIO to control the pullup state to the udc
    driver, so the boards can use a common implementation.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Greg Kroah-Hartman

    Lars-Peter Clausen
     
  • Most revisions of the OMAP4 Blaze/SDP platform do not have
    the EHCI signals routed by default. The pads are routed
    for the alternate HSI functionality instead, and explicit
    board modifications are needed to route the signals to
    the USB PHY on the board.

    Also, turning on the PHY connected to the EHCI port causes
    a board reboot during bootup due to an unintended short
    on the rails - this affects many initial revisions of the
    board, and needs a minor board mod to fix (or as a
    workaround, one should not attempt to power on the
    USB PHY).

    Given that these boards need explicit board mods to even
    get EHCI working (separate from the accidental short above),
    we should not attempt to enable EHCI by default.

    So drop the EHCI support from the board files for the
    Blaze/SDP platforms.

    Signed-off-by: Anand Gadiyar
    Cc: Keshava Munegowda
    Cc: Tony Lindgren
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Anand Gadiyar
     
  • Commit ab1666c1364a209e6141d7c14e47a42b5f00eca2 (USB: quirk PLL power down mode)
    added code that reads the revision ID from the PCI configuration register while
    it's stored by PCI subsystem in the 'revision' field of 'struct pci_dev'...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Greg Kroah-Hartman

    Sergei Shtylyov
     
  • This driver is used across all MSM SoCs. Hence give a generic name.
    All Functions and strutures are also using "msm_otg" as prefix.

    Signed-off-by: Pavankumar Kondeti
    Signed-off-by: Greg Kroah-Hartman

    Pavankumar Kondeti
     
  • This fixes a problem with my previous patch series where there's a great
    risk that the kernel will crash when unplugging interrupt devices from
    the USB port. These lines must have got missing when I rebased the
    patches from the older kernel I was working with to 2.6.37 and 2.6-next:

    This fixes a bug where the kernel may crash if you unplug a USB device
    that has active interrupt transfers.

    Signed-off-by: Arvid Brodin
    Signed-off-by: Greg Kroah-Hartman

    Arvid Brodin
     
  • The hcd->state variable is a disaster. It's not clearly owned by
    either usbcore or the host controller drivers, and they both change it
    from time to time, potentially stepping on each other's toes. It's
    not protected by any locks. And there's no mechanism to prevent it
    from going through an invalid transition.

    This patch (as1451) takes a first step toward fixing these problems.
    As it turns out, usbcore uses hcd->state for essentially only two
    things: checking whether the controller's root hub is running and
    checking whether the controller has died. Therefore the patch adds
    two new atomic bitflags to the hcd structure, to store these pieces of
    information. The new flags are used only by usbcore, and a private
    spinlock prevents invalid combinations (a dead controller's root hub
    cannot be running).

    The patch does not change the places where usbcore sets hcd->state,
    since HCDs may depend on them. Furthermore, there is one place in
    usb_hcd_irq() where usbcore still must use hcd->state: An HCD's
    interrupt handler can implicitly indicate that the controller died by
    setting hcd->state to HC_STATE_HALT. Nevertheless, the new code is a
    big improvement over the current code.

    The patch makes one other change. The hcd_bus_suspend() and
    hcd_bus_resume() routines now check first whether the host controller
    has died; if it has then they return immediately without calling the
    HCD's bus_suspend or bus_resume methods.

    This fixes the major problem reported in Bugzilla #29902: The system
    fails to suspend after a host controller dies during system resume.

    Signed-off-by: Alan Stern
    Tested-by: Alex Terekhov
    CC:
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

03 Mar, 2011

5 commits


02 Mar, 2011

2 commits

  • The SH EHCI/OHCI driver hardcoded the CPU type in {ehci,ohci}-hcd.c.
    So if we will add the new CPU, we had to add to the hcd driver each time.
    The patch adds the CONFIG_USB_{EHCI,OHCI}_SH configuration. So if we
    want to use the SH EHCI/OHCI, we only enable the configuration.

    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Greg Kroah-Hartman

    Yoshihiro Shimoda
     
  • This patch moves the AMD PLL quirk code in OHCI/EHCI driver to pci-quirks.c,
    and exports the functions to be used by xHCI driver later.

    AMD PLL quirk disable the optional PM feature inside specific
    SB700/SB800/Hudson-2/3 platforms under the following conditions:

    1. If an isochronous device is connected to OHCI/EHCI/xHCI port and is active;
    2. Optional PM feature that powers down the internal Bus PLL when the link is
    in low power state is enabled.

    Without AMD PLL quirk, USB isochronous stream may stutter or have breaks
    occasionally, which greatly impair the performance of audio/video streams.

    Currently AMD PLL quirk is implemented in OHCI and EHCI driver, and will be
    added to xHCI driver too. They are doing similar things actually, so move
    the quirk code to pci-quirks.c, which has several advantages:

    1. Remove duplicate defines and functions in OHCI/EHCI (and xHCI) driver and
    make them cleaner;
    2. AMD chipset information will be probed only once and then stored.
    Currently they're probed during every OHCI/EHCI initialization, move
    the detect code to pci-quirks.c saves the repeat detect cost;
    3. Build up synchronization among OHCI/EHCI/xHCI driver. In current
    code, every host controller enable/disable PLL only according to
    its own status, and may enable PLL while there is still isoc transfer on
    other HCs. Move the quirk to pci-quirks.c prevents this issue.

    Signed-off-by: Andiry Xu
    Cc: David Brownell
    Cc: Alex He
    Signed-off-by: Greg Kroah-Hartman

    Andiry Xu
     

01 Mar, 2011

4 commits