1. 15 5月, 2012 1 次提交
  2. 04 5月, 2012 2 次提交
  3. 23 4月, 2012 1 次提交
  4. 18 4月, 2012 2 次提交
  5. 11 4月, 2012 6 次提交
    • S
      usb: musb: omap: fix the error check for pm_runtime_get_sync · ad579699
      Shubhrajyoti D 提交于
      pm_runtime_get_sync returns a signed integer. In case of errors
      it returns a negative value. This patch fixes the error check
      by making it signed instead of unsigned thus preventing register
      access if get_sync_fails. Also passes the error cause to the
      debug message.
      
      Cc: stable@vger.kernel.org
      Cc:  Kishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NShubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      ad579699
    • K
      usb: musb: omap: fix crash when musb glue (omap) gets initialized · 3006dc8c
      Kishon Vijay Abraham I 提交于
      pm_runtime_enable is being called after omap2430_musb_init. Hence
      pm_runtime_get_sync in omap2430_musb_init does not have any effect (does
      not enable clocks) resulting in a crash during register access. It is
      fixed here.
      
      Cc: stable@vger.kernel.org # v3.0, v3.1, v3.2, v3.3
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3006dc8c
    • G
      usb: musb: wake the device before ulpi transfers · bf070bc1
      Grazvydas Ignotas 提交于
      musb can be suspended at the time some other driver wants to do ulpi
      transfers using usb_phy_io_* functions, and that can cause data abort,
      as it happened with isp1704_charger:
      http://article.gmane.org/gmane.linux.kernel/1226122
      
      Add pm_runtime to ulpi functions to rectify this. This also adds io_dev
      to usb_phy so that pm_runtime_* functions can be used.
      
      Cc: Felipe Contreras <felipe.contreras@gmail.com>
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      bf070bc1
    • A
      usb: musb: fix bug in musb_cleanup_urb · 692933b2
      Ajay Kumar Gupta 提交于
      Control transfers with data expected from device to host will use usb_rcvctrlpipe()
      for urb->pipe so for such urbs 'is_in' will be set causing control urb to fall
      into the first "if" condition in musb_cleanup_urb().
      
      Fixed by adding logic to check for non control endpoints.
      Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      692933b2
    • G
      usb: musb: fix some runtime_pm issues · c04352a5
      Grazvydas Ignotas 提交于
      When runtime_pm was originally added, it was done in rather confusing
      way: omap2430_musb_init() (called from musb_init_controller) would do
      runtime_pm_get_sync() and musb_init_controller() itself would do
      runtime_pm_put to balance it out. This is not only confusing but also
      wrong if non-omap2430 glue layer is used.
      
      This confusion resulted in commit 772aed45 "usb: musb: fix
      pm_runtime mismatch", that removed runtime_pm_put() from
      musb_init_controller as that looked unbalanced, and also happened to
      fix unrelated isp1704_charger crash. However this broke runtime PM
      functionality (musb is now always powered, even without gadget active).
      
      Avoid these confusing runtime pm dependences by making
      musb_init_controller() and omap2430_musb_init() do their own runtime
      get/put pairs; also cover error paths. Remove unneeded runtime_pm_put
      in omap2430_remove too. isp1704_charger crash that motivated
      772aed45 will be fixed by following patch.
      
      Cc: Felipe Contreras <felipe.contreras@gmail.com>
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c04352a5
    • V
      usb: musb: fix oops on omap2430 module unload · afb76df1
      Vladimir Zapolskiy 提交于
      This change prevents runtime suspend and resume actual execution, if
      omap2430 controller driver is loaded after musb-hdrc, and therefore the
      controller isn't initialized properly.
      
      The problem is reproducible with 3.1.y and 3.2 kernels.
      
      Kernel configuration of musb:
      
        % cat .config | egrep 'MUSB|GADGET'
        CONFIG_USB_MUSB_HDRC=y
        # CONFIG_USB_MUSB_TUSB6010 is not set
        CONFIG_USB_MUSB_OMAP2PLUS=m
        # CONFIG_USB_MUSB_AM35X is not set
        CONFIG_MUSB_PIO_ONLY=y
        CONFIG_USB_GADGET=y
        # CONFIG_USB_GADGET_DEBUG is not set
        # CONFIG_USB_GADGET_DEBUG_FILES is not set
        # CONFIG_USB_GADGET_DEBUG_FS is not set
        CONFIG_USB_GADGET_VBUS_DRAW=2
        CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
        CONFIG_USB_GADGET_MUSB_HDRC=m
        CONFIG_USB_GADGET_DUALSPEED=y
        CONFIG_USB_GADGETFS=m
        # CONFIG_USB_MIDI_GADGET is not set
      
      Fixes the following oops on module unloading:
      
        Unable to handle kernel NULL pointer dereference at virtual address 00000220
        ----8<----
        [<bf162088>] (omap2430_runtime_resume+0x24/0x54 [omap2430]) from [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50)
        [<c0302e34>] (pm_generic_runtime_resume+0x3c/0x50) from [<c0031a24>] (_od_runtime_resume+0x28/0x2c)
        [<c0031a24>] (_od_runtime_resume+0x28/0x2c) from [<c0306cb0>] (__rpm_callback+0x60/0xa0)
        [<c0306cb0>] (__rpm_callback+0x60/0xa0) from [<c0307f2c>] (rpm_resume+0x3fc/0x6e4)
        [<c0307f2c>] (rpm_resume+0x3fc/0x6e4) from [<c030851c>] (__pm_runtime_resume+0x5c/0x90)
        [<c030851c>] (__pm_runtime_resume+0x5c/0x90) from [<c02fd0dc>] (__device_release_driver+0x2c/0xd0)
        [<c02fd0dc>] (__device_release_driver+0x2c/0xd0) from [<c02fda18>] (driver_detach+0xe8/0xf4)
        [<c02fda18>] (driver_detach+0xe8/0xf4) from [<c02fcf88>] (bus_remove_driver+0xa0/0x104)
        [<c02fcf88>] (bus_remove_driver+0xa0/0x104) from [<c02fde54>] (driver_unregister+0x60/0x80)
        [<c02fde54>] (driver_unregister+0x60/0x80) from [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20)
        [<c02ff2d4>] (platform_driver_unregister+0x1c/0x20) from [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430])
        [<bf162928>] (omap2430_exit+0x14/0x1c [omap2430]) from [<c007d8bc>] (sys_delete_module+0x1f4/0x264)
        [<c007d8bc>] (sys_delete_module+0x1f4/0x264) from [<c000f000>] (ret_fast_syscall+0x0/0x30)
      Signed-off-by: NVladimir Zapolskiy <vladimir.zapolskiy@nokia.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: stable@vger.kernel.org # 3.1
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      afb76df1
  6. 21 3月, 2012 1 次提交
  7. 02 3月, 2012 1 次提交
  8. 27 2月, 2012 2 次提交
  9. 24 2月, 2012 1 次提交
    • S
      usb: musb: Reselect index reg in interrupt context · 39287076
      Supriya Karanth 提交于
      musb INDEX register is getting modified/corrupted during temporary
      un-locking in a SMP system. Set this register with proper value
      after re-acquiring the lock
      
      Scenario:
      ---------
      CPU1 is handling a data transfer completion interrupt received for
      the CLASS1 EP
      CPU2 is handling a CLASS2 thread which is queuing data to musb for
      transfer
      
      Below is the error sequence:
      
               CPU1                   |             CPU2
      --------------------------------------------------------------------
      Data transfer completion inter- |
      rupt recieved.                  |
                                      |
      musb INDEX reg set to CLASS1 EP |
                                      |
      musb LOCK is acquired.          |
                                      |
                                      | CLASS2 thread queues data.
                                      |
                                      | CLASS2 thread tries to acquire musb
                                      | LOCK but lock is already taken by
                                      | CLASS1, so CLASS2 thread is
                                      | spinning.
                                      |
      From Interrupt Context musb     |
      giveback function is called     |
                                      |
      The giveback function releases  | CLASS2 thread now acquires LOCK
      LOCK                            |
                                      |
      ClASS1 Request's completion cal-| ClASS2 schedules the data transfer and
      lback is called                 | sets the MUSB INDEX to Class2 EP number
                                      |
      Interrupt handler for CLASS1 EP |
      tries to acquire LOCK and is    |
      spinning                        |
                                      |
      Interrupt for Class1 EP acquires| Class2 completes the scheduling etc and
      the MUSB LOCK                   | releases the musb LOCK
                                      |
      Interrupt for Class1 EP schedul-|
      es the next data transfer       |
      but musb INDEX register is still|
      set to CLASS2 EP                |
      
      Since the MUSB INDEX register is set to a different endpoint, we
      read and modify the wrong registers. Hence data transfer will not
      happen properly. This results in unpredictable behavior
      
      So, the MUSB INDEX register is set to proper value again when
      interrupt re-acquires the lock
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NSupriya Karanth <supriya.karanth@stericsson.com>
      Signed-off-by: NPraveena Nadahally <praveen.nadahally@stericsson.com>
      Reviewed-by: Nsrinidhi kasagar <srinidhi.kasagar@stericsson.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      39287076
  10. 22 2月, 2012 1 次提交
  11. 13 2月, 2012 2 次提交
  12. 03 2月, 2012 1 次提交
    • C
      usb: musb: fix a build error on mips · 976d98cb
      Cong Wang 提交于
      On mips, we got:
      
      drivers/usb/musb/musb_io.h:44: error: conflicting types for 'readsl'
      arch/mips/include/asm/io.h:529: error: previous definition of 'readsl' was here
      drivers/usb/musb/musb_io.h:46: error: conflicting types for 'readsw'
      arch/mips/include/asm/io.h:528: error: previous definition of 'readsw' was here
      drivers/usb/musb/musb_io.h:48: error: conflicting types for 'readsb'
      
      so, should add !defined(CONFIG_MIPS) too.
      
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      976d98cb
  13. 01 2月, 2012 1 次提交
  14. 31 1月, 2012 1 次提交
  15. 25 1月, 2012 1 次提交
  16. 24 1月, 2012 3 次提交
    • G
      usb: musb: fix shutdown while usb gadget is in use · 24307cae
      Grazvydas Ignotas 提交于
      If we shutdown without stopping the gadget first or removing the cable,
      gadget manages to configure itself again:
      
      root@pandora /root# poweroff
      The system is going down NOW!
      Requesting system poweroff
      [   47.714385] musb-hm halted.
      [   48.120697]  gadget: suspend
      [   48.123748]  gadget: reset config
      [   48.127227]  gadget: ecm deactivated
      [   48.130981] usb0: gether_disconnect
      [   48.281799]  gadget: high-speed config #1: CDC Ethernet (ECM)
      [   48.287872]  gadget: init ecm
      [   48.290985]  gadget: notify connect false
      [   48.295288]  gadget: notify speed 425984000
      
      This is not only unwanted, it's also happening on half-unitialized
      state, after musb_shutdown() has returned, which sometimes causes
      hardware to fail to work after reboot. Let's better properly stop
      gadget on shutdown too.
      
      This patch moves musb_gadget_cleanup out of musb_free(), which has 2
      callsites: probe error path and musb_remove. On probe error path it was
      superflous since musb_gadget_cleanup is called explicitly there, and
      musb_remove() calls musb_shutdown(), so cleanup will get called as before.
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      24307cae
    • S
      usb: musb: davinci: fix build breakage · 006896fc
      Sekhar Nori 提交于
      Commit 0020afb3 (ARM: mach-davinci:
      remove mach/memory.h) removed mach/memory.h for DaVinci which broke
      DaVinci MUSB build.
      
      mach/memory.h is not actually needed in davinci.c, so remove it.
      While at it, also remove some more machine specific inclulde
      files which are not needed for build.
      
      Tested on DM644x EVM using USB card reader.
      
      Cc: stable@vger.kernel.org # v3.2
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      006896fc
    • G
      usb: musb: drop superfluous pm_runtime calls around musb_shutdown · f5579787
      Grazvydas Ignotas 提交于
      Since commit 4f9edd2d "usb: musb: Fix the crash issue during reboot"
      musb_shutdown() does pm_runtime_get_sync/pm_runtime_put by itself, so
      this no longer needs to be done by the caller. Also, musb_exit_debugfs()
      doesn't access the device, so just drop those runtime_pm calls.
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Reviewed-by: NShubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f5579787
  17. 13 1月, 2012 1 次提交
  18. 21 12月, 2011 1 次提交
  19. 20 12月, 2011 6 次提交
  20. 14 12月, 2011 1 次提交
  21. 12 12月, 2011 4 次提交
    • F
      usb: musb: omap2430: fix compile warning · e7f4e732
      Felipe Balbi 提交于
      fix the following compile warning:
      
      drivers/usb/musb/omap2430.c: In function 'musb_otg_notifier_work':
      drivers/usb/musb/omap2430.c:279:3: warning: 'return' with a value, in
      	function returning void
      drivers/usb/musb/omap2430.c:282:2: warning: 'return' with a value, in
      	function returning void
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      e7f4e732
    • V
      usb: musb: fix pm_runtime calls while atomic · 712d8efa
      Vikram Pandita 提交于
      musb pm_runtime_get_sync call happens in intrrupt context on cable attach case
      That can result in re-enabling the interrupts and cause side affects.
      
      So move the code to a work queue.
      
      Following is the error path hit on cable attach:
      
      BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:802
      in_atomic(): 0, irqs_disabled(): 0, pid: 18, name: irq/378-twl6030
      
      Backtrace:
      [<c00520f0>] (dump_backtrace+0x0/0x110) from [<c054f454>] (dump_stack+0x18/0x1c)
      [<c054f43c>] (dump_stack+0x0/0x1c) from [<c007f59c>] (__might_sleep+0x130/0x134)
      [<c007f46c>] (__might_sleep+0x0/0x134) from [<c02c2794>] (__pm_runtime_resume+0x94/0x98)
      [<c02c2700>] (__pm_runtime_resume+0x0/0x98) from [<c033e7e4>] (musb_otg_notifications+0x9c/0x164)
      [<c033e748>] (musb_otg_notifications+0x0/0x164) from [<c00b3df0>] (notifier_call_chain+0x4c/0x8c)
      [<c00b3da4>] (notifier_call_chain+0x0/0x8c) from [<c00b44a8>] (__atomic_notifier_call_chain+0x40/0x54)
      [<c00b4468>] (__atomic_notifier_call_chain+0x0/0x54) from [<c00b44dc>] (atomic_notifier_call_chain+0x20/0x28)
      [<c00b44bc>] (atomic_notifier_call_chain+0x0/0x28) from [<c033f124>] (twl6030_usb_irq+0xc8/0xdc)
      [<c033f05c>] (twl6030_usb_irq+0x0/0xdc) from [<c00d79f8>] (irq_thread_fn+0x24/0x40)
      [<c00d79d4>] (irq_thread_fn+0x0/0x40) from [<c00d7b64>] (irq_thread+0x150/0x1d8)
      [<c00d7a14>] (irq_thread+0x0/0x1d8) from [<c00adf70>] (kthread+0x94/0x98)
      [<c00adedc>] (kthread+0x0/0x98) from [<c0094388>] (do_exit+0x0/0x720)
      
      Tested with:
      MUSB Device mode: Cold boot / Hot plug
      MUSB Host mode: Cold boot / Hot plug
      Signed-off-by: NVikram Pandita <vikram.pandita@ti.com>
      Signed-off-by: NMoiz Sonasath <m-sonasath@ti.com>
      Signed-off-by: NVikram Pandita <vikram.pandita@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      712d8efa
    • F
      usb: musb: drop ARCH dependency · 1e546aa6
      Felipe Balbi 提交于
      musb core driver and tusb6010 glue layer don't
      depend on anything which is ARCH-specific. It
      builds fine on x86 and ARM. Dropping the dependency
      so we can compile-test on linux-next.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1e546aa6
    • F
      usb: musb: headers cleanup · 7d5b49a2
      Felipe Balbi 提交于
      Remove a few unnecessary headers from a
      few files.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      7d5b49a2