03 Mar, 2010

40 commits

  • This patch (as1329) converts the USB stack over to the PM core's
    runtime PM framework. This involves numerous changes throughout
    usbcore, especially to hub.c and driver.c. Perhaps the most notable
    change is that CONFIG_USB_SUSPEND now depends on CONFIG_PM_RUNTIME
    instead of CONFIG_PM.

    Several fields in the usb_device and usb_interface structures are no
    longer needed. Some code which used to depend on CONFIG_USB_PM now
    depends on CONFIG_USB_SUSPEND (requiring some rearrangement of header
    files).

    The only visible change in behavior should be that following a system
    sleep (resume from RAM or resume from hibernation), autosuspended USB
    devices will be resumed just like everything else. They won't remain
    suspended. But if they aren't in use then they will naturally
    autosuspend again in a few seconds.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1328) reorders the functions in drivers/usb/core/driver.c
    so as to put all the routines dependent on CONFIG_PM in one place.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1327) changes the way negative autosuspend delays
    prevent device from autosuspending. The current code checks for
    negative values explicitly in the autosuspend_check() routine. The
    updated code keeps things from getting that far by using
    usb_autoresume_device() to increment the usage counter when a negative
    delay is set, and by using usb_autosuspend_device() to decrement the
    usage counter when a non-negative delay is set.

    This complicates the set_autosuspend() attribute method code slightly,
    but it will reduce the overall power management overhead.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1326) adds usb_enable_autosuspend() and
    usb_disable_autosuspend() routines for use by drivers. If a driver
    knows that its device can handle suspends and resumes correctly, it
    can enable autosuspend all by itself. This is equivalent to the user
    writing "auto" to the device's power/level attribute.

    The implementation differs slightly from what it used to be. Now
    autosuspend is disabled simply by doing usb_autoresume_device() (to
    increment the usage counter) and enabled by doing
    usb_autosuspend_device() (to decrement the usage counter).

    The set_level() attribute method is updated to use the new routines,
    and the USB Power-Management documentation is updated.

    The patch adds a usb_enable_autosuspend() call to the hub driver's
    probe routine, allowing the special-case code for hubs in quirks.c to
    be removed.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1325) changes the locking for the persist_enabled flag
    in struct usb_device. Now it is protected by the device lock, along
    with all its neighboring bit flags, instead of the PM lock (which is
    about to vanish anyway).

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1324) makes a small change to the code used for remote
    wakeup of root hubs. hcd_resume_work() now calls the hub driver's
    remote-wakeup routine instead of implementing its own version.

    The patch is complicated by the need to rename remote_wakeup() to
    usb_remote_wakeup(), make it non-static, and declare it in a header
    file. There's also the additional complication required to make
    everything work when CONFIG_PM isn't set; the do-nothing inline
    routine had to be moved into the header file.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1323) changes the locking requirements for
    usb_autosuspend_device(), usb_autoresume_device(), and
    usb_try_autosuspend_device(). This isn't a very important change;
    mainly it's meant to make the locking more uniform.

    The most tricky part of the patch involves changes to usbdev_open().
    To avoid an ABBA locking problem, it was necessary to reduce the
    region protected by usbfs_mutex. Since that mutex now protects only
    against simultaneous open and remove, this posed no difficulty -- its
    scope was larger than necessary.

    And it turns out that usbfs_mutex is no longer needed in
    usbdev_release() at all. The list of usbfs "ps" structures is now
    protected by the device lock instead of by usbfs_mutex.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • This patch (as1322) reverses the two outcomes of an "if" statement in
    usb_probe_interface(), to avoid an unnecessary level of indentation.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • USB devices do not have to sort interfaces in their descriptors based on
    the interface number, and they may choose to skip interface numbers. The
    USB bandwidth allocation code for installing a new configuration assumes
    the for loop variable will match the interface number. Make it use the
    interface number (bInterfaceNumber) in the descriptor instead.

    Signed-off-by: Sarah Sharp
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • Enable the SD-Card interface on multiple Option 3G sticks.
    The unusual_devs.h entry is necessary because the device descriptor is
    vendor-specific. That prevents usb-storage from binding to it as an interface
    driver.

    Signed-off-by: Jan Dumon
    Signed-off-by: Phil Dibowitz
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Jan Dumon
     
  • trivial patch enabling g_nokia on rx51_defconfig.

    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • g_nokia is the gadget driver implementing
    WMCDC Wireless Handset Control Model for the N900
    device.

    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • Randy Dunlap reported this error when compiling the xHCI driver:

    linux-next-20100104/drivers/usb/host/xhci.h:1214:
    sorry, unimplemented: inlining failed in call to 'xhci_get_slot_state': function body not available

    The xhci_get_slot_state() function belongs in xhci-dbg.c, since it
    involves debugging internal xHCI structures. However, it is only used in
    xhci-hcd.c. Some toolchains may have issues since the inlined function
    body is not in the xhci.h header file. Remove the inline keyword to avoid
    this.

    Reported-by: Randy Dunlap
    Signed-off-by: Sarah Sharp
    Acked-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Sarah Sharp
     
  • Signed-off-by: Thiago Farina
    Signed-off-by: Greg Kroah-Hartman

    Thiago Farina
     
  • urb_priv->tds has type struct td **, not struct td *, so the
    elements of the array should have pointer type, not structure type.

    Convert kzalloc to kcalloc as well.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @disable sizeof_type_expr@
    type T;
    T **x;
    @@

    x =

    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     
  • Cc: Lonnie Mendez
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • The original code was passing a stack variable as a dma buffer, so I
    made it an allocated variable. Instead of adding a bunch of kfree()
    calls, I changed all the error return paths to gotos.

    Also I noticed that the error checking wasn't correct because
    usb_get_descriptor() can return negative values.

    While I was at it, I made an unrelated white space change by moving
    the unicode_to_ascii() on to one line.

    Signed-off-by: Dan Carpenter
    Cc: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • Kill string that is allocated and generated using speed and parity
    settings but is never used (and never has been).

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Change data-argument type from (void *) to (u8 *) to prevent endianess
    problems.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Cc: Oliver Neukum
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Cc: Lonnie Mendez
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Cc: Lonnie Mendez
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • OMAP3 has three HS USB ports so it can have three different regulator
    for each PHY connected to each port.

    Currently these regulators are assumed to be optional and driver doesn't
    fail but continue with the initialization if it doesn't get any regulators.

    Regulator supply names has to be mapped in board files as 'hsusbN' where
    'N' is port number and can be {0, 1 ,2}.

    Signed-off-by: Ajay Kumar Gupta
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Ajay Kumar Gupta
     
  • Added missing kfree() in ehci_hcd_omap_remove().

    Signed-off-by: Ajay Kumar Gupta
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Ajay Kumar Gupta
     
  • Some of the board might use external Vbus power supply on musb
    interface which would require to program ULPI_BUSCONTROL register.

    Adding 'extvbus' flag which can be set from such boards which will
    be checked at musb driver files before programming ULPI_BUSCONTROL.

    Signed-off-by: Ajay Kumar Gupta
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Ajay Kumar Gupta
     
  • Save dynamic FIFO read only information for later uses during
    musb_save/restore_context functions.

    Signed-off-by: Ajay Kumar Gupta
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Ajay Kumar Gupta
     
  • MUSB's programming guide dictates how we should handle its
    irqs and in which order. Follow that.

    Signed-off-by: Arnaud Mandy
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Arnaud Mandy
     
  • The version applied had a few comments which are now
    done.

    Thanks to Sergei for pointing out.

    Signed-off-by: Bryan Wu
    Signed-off-by: Cliff Cai
    Signed-off-by: Mike Frysinger
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Bryan Wu
     
  • This patch fixes the Tx abort/teardown logic. We now wait for the teardown
    completion interrupt and acknowledge the same by setting the tx_complete
    register to 0.

    This change is needed to ensure that abort processing works on DM365 platform.
    Without this change after completion of abort processing the system is
    overwhelmed with continuous stream of abort interrupts.

    This change has been tested on all CPPI3.x platforms (DM644x, DM646x, DM35x,
    DM36x).

    Signed-off-by: Swaminathan S
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Swaminathan S
     
  • This patch implements the work around for a Mentor controller related
    bug where it's observed a BULK Tx toggle error on the bus when a
    BULK IO gets scheduled on an endpoint that was earlier used for
    handling ISOC transaction and needed to start on 1 toggle. When such
    a situation arises even if the TXCSR toggle bits are programmed
    correctly by the musb driver the data gets transmitted with 0 toggle
    which leads to toggle error on the bus and the BULK transaction fails.
    In case of MSC write, the device gets reset by the Host.

    This Mentor bug is observed on almost all Mentor versions (1.3, 1.5,
    1.8). Confirmed on DM644x, DM355, DM365, OMAPL13x platforms.

    Signed-off-by: Swaminathan S
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Swaminathan S
     
  • MUSB DMA_INTR register may sometimes read zero when infact there
    was a pending interrupt. Workaround this by reading the DMA_COUNT
    values for all enabled channels when this condition occurs.
    Flag these channels as the ones needing to be serviced.

    Additionally, the absence of a debug print meant we would never
    catch a spurious DMA interrupt in MUSB. So this patch adds a
    debug print in the IRQ handler.

    Signed-off-by: Anand Gadiyar
    Cc: Ajay Kumar Gupta
    Cc: David Brownell
    Cc: Sergei Shtylyov
    Cc: Vikram Pandita
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Anand Gadiyar