1. 18 5月, 2017 2 次提交
  2. 26 4月, 2017 1 次提交
  3. 18 4月, 2017 4 次提交
  4. 14 3月, 2017 3 次提交
    • B
      usb: musb: fix possible spinlock deadlock · bc1e2154
      Bin Liu 提交于
      The DSPS glue calls del_timer_sync() in its musb_platform_disable()
      implementation, which requires the caller to not hold a lock. But
      musb_remove() calls musb_platform_disable() will musb->lock held. This
      could causes spinlock deadlock.
      
      So change musb_remove() to call musb_platform_disable() without holds
      musb->lock. This doesn't impact the musb_platform_disable implementation
      in other glue drivers.
      
      root@am335x-evm:~# modprobe -r musb-dsps
      [  126.134879] musb-hdrc musb-hdrc.1: remove, state 1
      [  126.140465] usb usb2: USB disconnect, device number 1
      [  126.146178] usb 2-1: USB disconnect, device number 2
      [  126.416985] musb-hdrc musb-hdrc.1: USB bus 2 deregistered
      [  126.423943]
      [  126.425525] ======================================================
      [  126.431997] [ INFO: possible circular locking dependency detected ]
      [  126.438564] 4.11.0-rc1-00003-g1557f13bca04-dirty #77 Not tainted
      [  126.444852] -------------------------------------------------------
      [  126.451414] modprobe/778 is trying to acquire lock:
      [  126.456523]  (((&glue->timer))){+.-...}, at: [<c01b8788>] del_timer_sync+0x0/0xd0
      [  126.464403]
      [  126.464403] but task is already holding lock:
      [  126.470511]  (&(&musb->lock)->rlock){-.-...}, at: [<bf30b7f8>] musb_remove+0x50/0x1
      30 [musb_hdrc]
      [  126.479965]
      [  126.479965] which lock already depends on the new lock.
      [  126.479965]
      [  126.488531]
      [  126.488531] the existing dependency chain (in reverse order) is:
      [  126.496368]
      [  126.496368] -> #1 (&(&musb->lock)->rlock){-.-...}:
      [  126.502968]        otg_timer+0x80/0xec [musb_dsps]
      [  126.507990]        call_timer_fn+0xb4/0x390
      [  126.512372]        expire_timers+0xf0/0x1fc
      [  126.516754]        run_timer_softirq+0x80/0x178
      [  126.521511]        __do_softirq+0xc4/0x554
      [  126.525802]        irq_exit+0xe8/0x158
      [  126.529735]        __handle_domain_irq+0x58/0xb8
      [  126.534583]        __irq_usr+0x54/0x80
      [  126.538507]
      [  126.538507] -> #0 (((&glue->timer))){+.-...}:
      [  126.544636]        del_timer_sync+0x40/0xd0
      [  126.549066]        musb_remove+0x6c/0x130 [musb_hdrc]
      [  126.554370]        platform_drv_remove+0x24/0x3c
      [  126.559206]        device_release_driver_internal+0x14c/0x1e0
      [  126.565225]        bus_remove_device+0xd8/0x108
      [  126.569970]        device_del+0x1e4/0x308
      [  126.574170]        platform_device_del+0x24/0x8c
      [  126.579006]        platform_device_unregister+0xc/0x20
      [  126.584394]        dsps_remove+0x14/0x30 [musb_dsps]
      [  126.589595]        platform_drv_remove+0x24/0x3c
      [  126.594432]        device_release_driver_internal+0x14c/0x1e0
      [  126.600450]        driver_detach+0x38/0x6c
      [  126.604740]        bus_remove_driver+0x4c/0xa0
      [  126.609407]        SyS_delete_module+0x11c/0x1e4
      [  126.614252]        __sys_trace_return+0x0/0x10
      
      Fixes: ea2f35c0 ("usb: musb: Fix sleeping function called from invalid context for hdrc glue")
      Cc: <stable@vger.kernel.org> #4.9+
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bc1e2154
    • B
      usb: musb: dsps: fix iounmap in error and exit paths · 6b7ad496
      Bin Liu 提交于
      Cleanly iounmap the pointer in error and exit paths.
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b7ad496
    • B
      usb: musb: cppi41: don't check early-TX-interrupt for Isoch transfer · 0090114d
      Bin Liu 提交于
      The CPPI 4.1 driver polls register to workaround the premature TX
      interrupt issue, but it causes audio playback underrun when triggered in
      Isoch transfers.
      
      Isoch doesn't do back-to-back transfers, the TX should be done by the
      time the next transfer is scheduled. So skip this polling workaround for
      Isoch transfer.
      
      Fixes: a655f481 ("usb: musb: musb_cppi41: handle pre-mature TX complete interrupt")
      Cc: <stable@vger.kernel.org> #4.1+
      Reported-by: NAlexandre Bailon <abailon@baylibre.com>
      Acked-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Tested-by: NAlexandre Bailon <abailon@baylibre.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0090114d
  5. 15 2月, 2017 1 次提交
  6. 09 2月, 2017 6 次提交
  7. 03 2月, 2017 17 次提交
  8. 25 1月, 2017 3 次提交
    • T
      usb: musb: Fix external abort on non-linefetch for musb_irq_work() · 3ba7b779
      Tony Lindgren 提交于
      While testing musb host mode cable plugging on a BeagleBone, I came across this
      error:
      
      Unhandled fault: external abort on non-linefetch (0x1008) at 0xd1dcfc60
      ...
      [<bf668390>] (musb_default_readb [musb_hdrc]) from [<bf668578>] (musb_irq_work+0x1c/0x180 [musb_hdrc])
      [<bf668578>] (musb_irq_work [musb_hdrc]) from [<c0156554>] (process_one_work+0x2b4/0x808)
      [<c0156554>] (process_one_work) from [<c015767c>] (worker_thread+0x3c/0x550)
      [<c015767c>] (worker_thread) from [<c015d568>] (kthread+0x104/0x148)
      [<c015d568>] (kthread) from [<c01078d0>] (ret_from_fork+0x14/0x24)
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ba7b779
    • T
      usb: musb: Fix host mode error -71 regression · 407788b5
      Tony Lindgren 提交于
      Commit 467d5c98 ("usb: musb: Implement session bit based runtime PM for
      musb-core") started implementing musb generic runtime PM support by
      introducing devctl register session bit based state control.
      
      This caused a regression where if a USB mass storage device is connected
      to a USB hub, we can get:
      
      usb 1-1: reset high-speed USB device number 2 using musb-hdrc
      usb 1-1: device descriptor read/64, error -71
      usb 1-1.1: new high-speed USB device number 4 using musb-hdrc
      
      This is because before the USB storage device is connected, musb is
      in OTG_STATE_A_SUSPEND. And we currently only set need_finish_resume
      in musb_stage0_irq() and the related code calling finish_resume_work
      in musb_resume() and musb_runtime_resume() never gets called.
      
      To fix the issue, we can call schedule_delayed_work() directly in
      musb_stage0_irq() to have finish_resume_work run.
      
      And we should no longer never get interrupts when when suspended.
      We have changed musb to no longer need pm_runtime_irqsafe().
      The need_finish_resume flag was added in commit 9298b4aa ("usb:
      musb: fix device hotplug behind hub") and no longer applies as far
      as I can tell. So let's just remove the earlier code that no longer
      is needed.
      
      Fixes: 467d5c98 ("usb: musb: Implement session bit based runtime PM for musb-core")
      Reported-by: NBin Liu <b-liu@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NBin Liu <b-liu@ti.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      407788b5
    • B
      usb: musb: constify musb_hdrc_config structures · 1e572aa5
      Bhumika Goyal 提交于
      Declare musb_hdrc_config structures as const as they are only stored in
      the config field of a musb_hdrc_platform_data structure. This field is of
      type const, so musb_hdrc_config structures having this property can be
      made const too.
      Done using Coccinelle:
      
      @r disable optional_qualifier@
      identifier x;
      position p;
      @@
      static struct musb_hdrc_config x@p={...};
      
      @ok@
      struct musb_hdrc_platform_data pdata;
      identifier r.x;
      position p;
      @@
      pdata.config=&x@p;
      
      @bad@
      position p != {r.p,ok.p};
      identifier r.x;
      @@
      x@p
      
      @depends on !bad disable optional_qualifier@
      identifier r.x;
      @@
      +const
      struct musb_hdrc_config x;
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         1212	    338	      0	   1550	    60e	drivers/usb/musb/jz4740.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         1268	    290	      0	   1558	    616	drivers/usb/musb/jz4740.o
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         6151	    333	     16	   6500	   1964	drivers/usb/musb/sunxi.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         6215	    269	     16	   6500	   1964	drivers/usb/musb/sunxi.o
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         3668	    864	      0	   4532	   11b4	drivers/usb/musb/ux500.o
      
      File size after:
         text	   data	    bss	    dec	    hex	filename
         3724	    808	      0	   4532	   11b4	drivers/usb/musb/ux500.o
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e572aa5
  9. 11 1月, 2017 1 次提交
  10. 06 1月, 2017 2 次提交