1. 24 1月, 2017 5 次提交
    • N
      usb: dwc2: host: use msleep() for long delay · d3fe81d2
      Nicholas Mc Guire 提交于
      ulseep_range() uses hrtimers and provides no advantage over msleep()
      for larger delays. Fix up the 100ms delays here passing the adjusted "min"
      value to msleep(). This helps reduce the load on the hrtimer subsystem.
      
      Link: http://lkml.org/lkml/2017/1/11/377
      Fixes: commit 2938fc63 ("usb: dwc2: Properly account for the force mode delays")
      Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org>
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d3fe81d2
    • J
      usb: dwc2: Avoid sleeping while holding hsotg->lock · 6e6360b6
      John Stultz 提交于
      Basically when plugging in various cables in different orders, I'm
      occasionally seeing the following BUG splat:
      
      [   86.215403] BUG: scheduling while atomic: kworker/u16:2/53/0x00000002
      [   86.219164] usb 1-1: USB disconnect, device number 9
      [   86.226845] Preemption disabled at:[   86.230218]
      [<ffffff8008673558>] dwc2_conn_id_status_change+0x120/0x250
      [   86.236894] CPU: 0 PID: 53 Comm: kworker/u16:2 Tainted: G        W
           4.9.0-rc8-00051-gd5a7979-dirty #1702
      [   86.246836] Hardware name: HiKey Development Board (DT)
      [   86.252100] Workqueue: dwc2 dwc2_conn_id_status_change
      [   86.257279] Call trace:
      [   86.259771] [<ffffff8008087c28>] dump_backtrace+0x0/0x1a0
      [   86.265210] [<ffffff8008087ddc>] show_stack+0x14/0x20
      [   86.270308] [<ffffff80084343f0>] dump_stack+0x90/0xb0
      [   86.275401] [<ffffff80080d8d94>] __schedule_bug+0x6c/0xb8
      [   86.280841] [<ffffff8008a07220>] __schedule+0x4f8/0x5b0
      [   86.286099] [<ffffff8008a073e8>] schedule+0x38/0xa0
      [   86.291017] [<ffffff8008a0a6cc>] schedule_hrtimeout_range_clock+0x8c/0xf0
      [   86.297846] [<ffffff8008a0a740>] schedule_hrtimeout_range+0x10/0x18
      [   86.304150] [<ffffff8008a0a4a0>] usleep_range+0x50/0x58
      [   86.309418] [<ffffff800866d8dc>] dwc2_wait_for_mode.isra.4+0x54/0xd0
      [   86.315815] [<ffffff800866f058>] dwc2_core_reset+0xe0/0x168
      [   86.321431] [<ffffff800867e364>] dwc2_hsotg_core_init_disconnected+0x2c/0x310
      [   86.328602] [<ffffff8008673568>] dwc2_conn_id_status_change+0x130/0x250
      [   86.335254] [<ffffff80080ccd48>] process_one_work+0x118/0x370
      [   86.341035] [<ffffff80080ccfe8>] worker_thread+0x48/0x498
      [   86.346473] [<ffffff80080d2eb0>] kthread+0xd0/0xe8
      [   86.351299] [<ffffff8008082e80>] ret_from_fork+0x10/0x50
      
      This seems to be caused by the dwc2_wait_for_mode() calling
      usleep_range() while the hstog->lock spinlock is held, since
      we take that before calling dwc2_hsotg_core_init_disconnected().
      
      This patch avoids the issue by adding an extra argument to
      dwc2_core_reset(), as suggested by John Youn, which allows us to
      skip the waiting, which should be unnecessary when calling from
      dwc2_hsotg_core_init_disconnected().
      
      Cc: Wei Xu <xuwei5@hisilicon.com>
      Cc: Guodong Xu <guodong.xu@linaro.org>
      Cc: Amit Pundir <amit.pundir@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: John Youn <johnyoun@synopsys.com>
      Cc: Douglas Anderson <dianders@chromium.org>
      Cc: Chen Yu <chenyu56@huawei.com>
      Cc: Vardan Mikayelyan <mvardan@synopsys.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      6e6360b6
    • J
      usb: dwc2: Fix usage of bool params · 95832c00
      John Youn 提交于
      Check these parameters only for true or false. There is no need to check
      for greater or less than 0.
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      95832c00
    • J
      usb: dwc2: Remove unused otg_ver parameter · 0f3a7459
      John Youn 提交于
      The otg_ver parameter only controls the SRP pulsing method and defaults
      to the 1.3 behavior. It is unused and can be removed.
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      0f3a7459
    • J
      usb: dwc2: Cleanup some checkpatch issues · 9da51974
      John Youn 提交于
      This commmit is the result of running checkpatch --fix.
      
      The results were verified for correctness. Some of the fixes result in
      line over 80 char which we will fix manually later.
      
      The following is a summary of what was done by checkpatch:
      * Remove externs on function prototypes.
      * Replace symbolic permissions with octal.
      * Align code to open parens.
      * Replace 'unsigned' with 'unsigned int'.
      * Remove unneccessary blank lines.
      * Add blank lines after declarations.
      * Add spaces around operators.
      * Remove unnecessary spaces after casts.
      * Replace 'x == NULL' with '!x'.
      * Replace kzalloc() with kcalloc().
      * Concatenate multi-line strings.
      * Use the BIT() macro.
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      9da51974
  2. 18 11月, 2016 2 次提交
  3. 17 10月, 2016 1 次提交
  4. 08 9月, 2016 2 次提交
  5. 04 3月, 2016 6 次提交
  6. 17 2月, 2016 1 次提交
  7. 04 2月, 2016 2 次提交
  8. 23 12月, 2015 14 次提交
  9. 15 12月, 2015 4 次提交
  10. 14 10月, 2015 1 次提交
  11. 02 10月, 2015 2 次提交