31 Aug, 2013

7 commits


29 Aug, 2013

4 commits

  • The test here should be ">=" instead of ">". The cdd->chan_busy[] array
    has "ALLOC_DECS_NUM" elements.

    Signed-off-by: Dan Carpenter
    Acked-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • …kernel/git/sarah/xhci into usb-next

    Sarah writes:

    xhci: Fix build breakage and new warnings.

    Hi Greg,

    This first patch should fix the build breakage Sedat Dilek reported.
    Apologizes for not including this patch before commit
    0730d52a86919300a39a2be37f6c140997dfb82f "xhci:prevent "callbacks suppressed"
    when debug is not enabled"

    The second patch fixes a new build warning introduced by commit
    c8476fb855434c733099079063990e5bfa7ecad6 "usb: xhci: Disable runtime PM suspend
    for quirky controllers", which was caught by the 0day build system.

    Sarah Sharp

    Greg Kroah-Hartman
     
  • The 0day build server caught a new build warning that is triggered when
    CONFIG_USB_DEFAULT_PERSIST is turned on:

    tree: git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git for-usb-next
    head: 0730d52a86919300a39a2be37f6c140997dfb82f
    commit: c8476fb855434c733099079063990e5bfa7ecad6 [1/3] usb: xhci: Disable runtime PM suspend for quirky controllers
    config: i386-randconfig-r6-0826 (attached as .config)

    All warnings:

    drivers/usb/host/xhci.c: In function 'xhci_free_dev':
    >> drivers/usb/host/xhci.c:3560:17: warning: unused variable 'dev' [-Wunused-variable]
    struct device *dev = hcd->self.controller;
    ^
    drivers/usb/host/xhci.c: In function 'xhci_alloc_dev':
    >> drivers/usb/host/xhci.c:3648:17: warning: unused variable 'dev' [-Wunused-variable]
    struct device *dev = hcd->self.controller;
    ^

    vim +/dev +3560 drivers/usb/host/xhci.c

    3554 * disabled. Free any HC data structures associated with that device.
    3555 */
    3556 void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
    3557 {
    3558 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
    3559 struct xhci_virt_device *virt_dev;
    > 3560 struct device *dev = hcd->self.controller;
    3561 unsigned long flags;
    3562 u32 state;
    3563 int i, ret;
    3564
    3565 #ifndef CONFIG_USB_DEFAULT_PERSIST
    3566 /*
    3567 * We called pm_runtime_get_noresume when the device was attached.
    3568 * Decrement the counter here to allow controller to runtime suspend
    3569 * if no devices remain.
    3570 */
    3571 if (xhci->quirks & XHCI_RESET_ON_RESUME)
    3572 pm_runtime_put_noidle(dev);
    3573 #endif
    3574
    ...
    3641 /*
    3642 * Returns 0 if the xHC ran out of device slots, the Enable Slot command
    3643 * timed out, or allocating memory failed. Returns 1 on success.
    3644 */
    3645 int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
    3646 {
    3647 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
    > 3648 struct device *dev = hcd->self.controller;
    3649 unsigned long flags;
    3650 int timeleft;
    3651 int ret;

    Fix this.

    Signed-off-by: Sarah Sharp
    Cc: Shawn Nematbakhsh

    Sarah Sharp
     
  • When DEBUG is defined, dev_dbg_ratelimited uses dynamic debug data
    structures even when CONFIG_DYNAMIC_DEBUG is not defined.
    It leads to build break.
    For example, when I try to use dev_dbg_ratelimited in USB code and
    CONFIG_USB_DEBUG is enabled, but CONFIG_DYNAMIC_DEBUG is not, I get:

    CC [M] drivers/usb/host/xhci-ring.o
    drivers/usb/host/xhci-ring.c: In function ‘xhci_queue_intr_tx’:
    drivers/usb/host/xhci-ring.c:3059:3: error: implicit declaration of function ‘DEFINE_DYNAMIC_DEBUG_METADATA’ [-Werror=implicit-function-declaration]
    drivers/usb/host/xhci-ring.c:3059:3: error: ‘descriptor’ undeclared (first use in this function)
    drivers/usb/host/xhci-ring.c:3059:3: note: each undeclared identifier is reported only once for each function it appears in
    drivers/usb/host/xhci-ring.c:3059:3: error: implicit declaration of function ‘__dynamic_pr_debug’ [-Werror=implicit-function-declaration]
    drivers/usb/host/xhci-ring.c: In function ‘xhci_queue_isoc_tx_prepare’:
    drivers/usb/host/xhci-ring.c:3847:3: error: ‘descriptor’ undeclared (first use in this function)
    cc1: some warnings being treated as errors
    make[2]: *** [drivers/usb/host/xhci-ring.o] Error 1
    make[1]: *** [drivers/usb/host] Error 2
    make: *** [drivers/usb/] Error 2

    This patch separates definition for CONFIG_DYNAMIC_DEBUG and DEBUG cases.

    [Note, Sarah moved the comment above the macro to avoid checkpatch
    warnings.]

    Signed-off-by: Dmitry Kasatkin
    Signed-off-by: Sarah Sharp
    Acked-by: Greg Kroah-Hartman

    Dmitry Kasatkin
     

28 Aug, 2013

29 commits

  • Since ohci-hcd supports runtime PM, the .pm field in its pci_driver
    structure should be protected by CONFIG_PM rather than
    CONFIG_PM_SLEEP.

    Without this change, OHCI controllers won't do runtime suspend if
    system suspend or hibernation isn't enabled.

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

    Alan Stern
     
  • Unnecessary dev_set_drvdata() is removed, because the driver core
    clears the driver data to NULL after device_release or on probe failure.

    Signed-off-by: Libo Chen
    Signed-off-by: Greg Kroah-Hartman

    Libo Chen
     
  • Use the wrapper functions for getting and setting the driver data using
    platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
    so we can directly pass a struct platform_device.

    Signed-off-by: Libo Chen
    Signed-off-by: Greg Kroah-Hartman

    Libo Chen
     
  • Use the wrapper functions for getting and setting the driver data using
    platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
    so we can directly pass a struct platform_device.

    Signed-off-by: Libo Chen
    Signed-off-by: Greg Kroah-Hartman

    Libo Chen
     
  • …/balbi/usb into usb-next

    Felipe writes:

    usb: patches for v3.12 merge window (part 2)

    Here's a set of important fixes for v3.12 merge
    window which have been pending in the mailing list
    for quite some time.

    We have use-after-free fixes, signedness fixes,
    more of HAS_DMA dependencies, fixes for NULL pointer
    deferences, build fixes and some other fixes to
    the musb driver caused by recent patches.

    Patches are quite small and contain valuable fixes
    which will give us a much better -rc1 release.

    Please consider merging

    Signed-of-by: Felipe Balbi <balbi@ti.com>

    Greg Kroah-Hartman
     
  • Convert the usbsorage sysfs attribute to use the _RW macro to make it
    easier to determine the permissions for the file.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Dan Carpenter's automatic Smatch checker found an anomaly in the ux500
    MUSB driver, whereby board data was checked before use in all but one
    occasion. It is believed that it needs to be checked every time.

    Smatch complaint:
    drivers/usb/musb/ux500_dma.c:335 ux500_dma_controller_start()
    error: we previously assumed 'data' could be null (see line 313)

    Cc: Felipe Balbi
    Cc: Greg Kroah-Hartman
    Cc: linux-usb@vger.kernel.org
    Cc: Dan Carpenter
    Signed-off-by: Lee Jones
    Signed-off-by: Felipe Balbi

    Lee Jones
     
  • The "goto out" statements were wrong. We aren't holding any locks at
    that point so we should return directly.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Felipe Balbi

    Dan Carpenter
     
  • "ret" needs to be signed for the error handling to work.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Felipe Balbi

    Dan Carpenter
     
  • ffs_data_put() can sometimes free "ffs" so I have moved the call down
    a line below the dereference.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Felipe Balbi

    Dan Carpenter
     
  • The call to put_dev() releases "dev". Hopefully, we don't need to set
    the state to STATE_DEV_DISABLED anyway so I have removed those lines.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Felipe Balbi

    Dan Carpenter
     
  • …/git/sarah/xhci into usb-next

    Sarah writes:

    xhci: Bug fixes for 3.12.

    Hi Greg,

    Here's three low-priority bug fixes that should be queued for 3.12.
    They disable runtime PM for hosts that need the XHCI_RESET_ON_RESUME
    quirk, fix USB 2.0 Link PM on hosts that don't have BESL support, and
    prevent a bunch of log spam.

    Please pull into usb-next for 3.12.

    Sarah Sharp

    Greg Kroah-Hartman
     
  • otg.h header file was included twice.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Felipe Balbi

    Sachin Kamat
     
  • Commit 94ae9843 (usb: phy: rename all phy drivers to phy-$name-usb.c)
    renamed drivers/usb/phy/otg_fsm.h to drivers/usb/phy/phy-fsm-usb.h
    but changed drivers/usb/phy/phy-fsm-usb.c to include not existing
    "phy-otg-fsm.h" instead of new "phy-fsm-usb.h". This breaks building:
    ...
    drivers/usb/phy/phy-fsm-usb.c:32:25: fatal error: phy-otg-fsm.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/usb/phy/phy-fsm-usb.o] Error 1

    This commit also missed to modify drivers/usb/phy/phy-fsl-usb.h
    to include new "phy-fsm-usb.h" instead of "otg_fsm.h" resulting
    in another build breakage:
    ...
    In file included from drivers/usb/phy/phy-fsl-usb.c:46:0:
    drivers/usb/phy/phy-fsl-usb.h:18:21: fatal error: otg_fsm.h: No such file or directory
    compilation terminated.
    make[3]: *** [drivers/usb/phy/phy-fsl-usb.o] Error 1

    Fix both issues.

    Signed-off-by: Anatolij Gustschin
    Cc: stable@vger.kernel.org
    Signed-off-by: Felipe Balbi

    Anatolij Gustschin
     
  • Convert all USB gadget sysfs attributes to use the _RO or _RW variants,
    to make them easier to audit and ensure that the permissions are
    correct.

    Note, two are left using the DEVICE_ATTR() macro, as there is no
    DEVICE_ATTR_WO() in Linus's tree, that will happen after 3.12-rc1 is
    out, a follow-on patch will be sent then.

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

    --
    drivers/usb/gadget/composite.c | 8 +++-----
    drivers/usb/gadget/dummy_hcd.c | 8 ++++----
    drivers/usb/gadget/f_mass_storage.c | 14 ++++++--------
    drivers/usb/gadget/net2272.c | 4 ++--
    drivers/usb/gadget/net2280.c | 18 +++++++++---------
    drivers/usb/gadget/storage_common.c | 25 ++++++++++++-------------
    drivers/usb/gadget/udc-core.c | 14 +++++++-------
    7 files changed, 43 insertions(+), 48 deletions(-)

    Greg Kroah-Hartman
     
  • With enabled pm_runtime in the kernel the device won't work because it
    is not "on" during the probe function. This patch enables the device via
    pm_runtime on probe so it remains activated.

    Acked-by: Vinod Koul
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • So I assumed that Beagle bone has only one USB port in host mode because
    the micro USB connector had an USB-UART there. I was wrong a little. The
    second port runs on host mode, but the micro USB plug is connected to an
    internal HUB with two ports: one to the USB-UART and one to musb
    instance one.
    For that reason, this patch enables both ports: the primary in device
    mode only and the second in host mode only.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • This is what I observe:
    On the first connect, the musb starts with DEVCTL.Session set. On
    disconnect, musb_core calls try_idle. That functions removes the Session
    bit signalizing that the session is over (something that only in OTG is
    required). A new device, that is plugged, is no longer recognized.
    I've setup a timer and checked the DEVCTL register and I haven't seen a
    change in VBus and I saw the B-Device bit set. After setting the IDDIG
    into A mode and forcing the device to behave like a A device, I didn't
    see a change.
    Neither VBUS goes to 0b11 nor does a session start request comes.
    In the TI-v3.2 kernel they skip to call musb_platform_try_idle() in the
    OTG_STATE_A_WAIT_BCON state while not in OTG mode.
    Since the second port hast a standard A plug the patch changes the port
    to run in host mode only and skips the timer which would remove
    DEVCTL.Session so we can reconnect to another device later.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • Quite early on init there is an vbus / drvvbus interrupt comming and the
    dsps code sets is_active to one. As a result we see a lot of

    |musb_bus_suspend 2459: trying to suspend as a_wait_bcon while active

    until a device is plugged in with pm_runtime enabled in the kernel.
    After checking davinci, am35, da8xx I noticed that dsps is actually the
    only one doing this.
    So remove it and we won't flooded with mesages and the idle port can be
    suspended.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • This relfects the code and dts requires changes due to recent .dts
    binding updates:
    - use mg prefix for the Metor Graphics specific attributes
    - use power in mA not in mA/2 as specifed in the USB2.0 specification
    - remove the child node for USB. This is driver specific on won't be
    reflected in the device tree
    - use the "mentor" prefix instead of "mg".
    - use "dr_mode" istead of "mg,port-mode" for the port mode. The former
    is used by a few other drivers.

    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Stephen Warren
    Cc: Ian Campbell
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • The support for both am335x-USB instances required changes to the device
    tree bindings. This patch reflects these changes in the bindings
    document.

    v3…v4:
    - remove the child node for USB. This is driver specific on won't be
    reflected in the device tree
    - use the "mentor" prefix instead of "mg".
    - use "dr_mode" istead of "mg,port-mode" for the port mode. The former
    is used by a few other drivers.

    v2…v3:
    - use proper usb-phy nodes in evm, bone and evmsk device tree.

    v1…v2:
    - use mg prefix for the Metor Graphics specific attributes
    - use power in mA not in mA/2 as specifed in the USB2.0 specification
    - use usbX-phy instead of usbX_phy
    - use dma-controller instead of dma

    Cc: Rob Herring
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Stephen Warren
    Cc: Ian Campbell
    Cc: devicetree@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • I forgot to separete the different names in the reg-names property. This
    didn't cause anything to fail because the driver does not use the names
    and simply relies on the order of the memory offsets in reg.
    This patch fixes this in case it is used later.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • musb_shutdown() removes always USB host and device.
    musb_init_controller() adds host and device depending on port_mode. If
    port mode is set to HOST then the removal of UDC leads only to:
    |(NULL device *): gadget not registered.
    and nothing else happens. If port mode is set to DEVICE and we remove
    the host then we oops in usb_remove_hcd().
    This patch ensures that we only remove host in OTG/host mode and device
    only in OTG/device mode to avoid any trouble.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
    Furthermore, the value returned by devm_ioremap_resource should be tested.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression e,e1;
    statement S;
    @@

    *e = devm_ioremap_resource(...);
    if (!e1) S

    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Felipe Balbi

    Julia Lawall
     
  • If NO_DMA=y:

    drivers/built-in.o: In function `net2272_done':
    drivers/usb/gadget/net2272.c:386: undefined reference to `usb_gadget_unmap_request'
    drivers/built-in.o: In function `net2272_queue':
    drivers/usb/gadget/net2272.c:848: undefined reference to `usb_gadget_map_request'

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Felipe Balbi

    Geert Uytterhoeven
     
  • If NO_DMA=y:

    drivers/built-in.o: In function `sudmac_free_channel':
    drivers/usb/gadget/r8a66597-udc.c:676: undefined reference to `usb_gadget_unmap_request'
    drivers/built-in.o: In function `sudmac_alloc_channel':
    drivers/usb/gadget/r8a66597-udc.c:666: undefined reference to `usb_gadget_map_request'

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Felipe Balbi

    Geert Uytterhoeven
     
  • If NO_DMA=y:

    drivers/built-in.o: In function `fusb300_set_idma':
    drivers/usb/gadget/fusb300_udc.c:946: undefined reference to `usb_gadget_map_request'
    drivers/usb/gadget/fusb300_udc.c:958: undefined reference to `usb_gadget_unmap_request'

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Felipe Balbi

    Geert Uytterhoeven
     
  • Since commit 511f3c53 (usb: gadget: udc-core: fix a regression during
    gadget driver unbinding) usb_gadget_remove_driver will pass NULL for
    the driver argument.

    Signed-off-by: Maarten ter Huurne
    Signed-off-by: Felipe Balbi

    Maarten ter Huurne
     
  • Add the missing unlock before return from function cppi41_dma_callback()
    in the error handling case.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Felipe Balbi

    Wei Yongjun