1. 03 7月, 2019 1 次提交
  2. 18 6月, 2019 4 次提交
  3. 06 6月, 2019 4 次提交
  4. 21 5月, 2019 1 次提交
    • B
      usb: remove redundant 'default n' from Kconfig-s · d991f855
      Bartlomiej Zolnierkiewicz 提交于
      'default n' is the default value for any bool or tristate Kconfig
      setting so there is no need to write it explicitly.
      
      Also since commit f467c564 ("kconfig: only write '# CONFIG_FOO
      is not set' for visible symbols") the Kconfig behavior is the same
      regardless of 'default n' being present or not:
      
          ...
          One side effect of (and the main motivation for) this change is making
          the following two definitions behave exactly the same:
      
              config FOO
                      bool
      
              config FOO
                      bool
                      default n
      
          With this change, neither of these will generate a
          '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
          That might make it clearer to people that a bare 'default n' is
          redundant.
          ...
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d991f855
  5. 03 5月, 2019 16 次提交
  6. 19 4月, 2019 1 次提交
  7. 19 2月, 2019 1 次提交
    • G
      usb: dwc2: use struct_size() in kzalloc() · eeca7606
      Gustavo A. R. Silva 提交于
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct foo {
          int stuff;
          struct boo entry[];
      };
      
      size = sizeof(struct foo) + count * sizeof(struct boo);
      instance = kzalloc(size, GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
      
      Notice that, in this case, variable size is not necessary, hence
      it is removed.
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eeca7606
  8. 07 2月, 2019 2 次提交
  9. 22 1月, 2019 1 次提交
  10. 17 1月, 2019 1 次提交
  11. 11 12月, 2018 1 次提交
    • M
      usb: dwc2: Fix disable all EP's on disconnect · 4fe4f9fe
      Minas Harutyunyan 提交于
      Disabling all EP's allow to reset EP's to initial state.
      Introduced new function dwc2_hsotg_ep_disable_lock() which
      before calling dwc2_hsotg_ep_disable() function acquire
      hsotg->lock and release on exiting.
      From dwc2_hsotg_ep_disable() function removed acquiring
      hsotg->lock.
      In dwc2_hsotg_core_init_disconnected() function when USB
      reset interrupt asserted disabling all ep’s by
      dwc2_hsotg_ep_disable() function.
      This updates eliminating sparse imbalance warnings.
      
      Reverted changes in dwc2_hostg_disconnect() function.
      Introduced new function dwc2_hsotg_ep_disable_lock().
      Changed dwc2_hsotg_ep_ops. Now disable point to
      dwc2_hsotg_ep_disable_lock() function.
      In functions dwc2_hsotg_udc_stop() and dwc2_hsotg_suspend()
      dwc2_hsotg_ep_disable() function replaced by
      dwc2_hsotg_ep_disable_lock() function.
      In dwc2_hsotg_ep_disable() function removed acquiring
      of hsotg->lock.
      
      Fixes: dccf1bad ("usb: dwc2: Disable all EP's on disconnect")
      Signed-off-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      4fe4f9fe
  12. 10 12月, 2018 1 次提交
  13. 05 12月, 2018 2 次提交
    • T
      usb: dwc2: host: use hrtimer for NAK retries · 6ed30a7d
      Terin Stock 提交于
      Modify the wait delay utilize the high resolution timer API to allow for
      more precisely scheduled callbacks.
      
      A previous commit added a 1ms retry delay after multiple consecutive
      NAKed transactions using jiffies. On systems with a low timer interrupt
      frequency, this delay may be significantly longer than specified,
      resulting in misbehavior with some USB devices.
      
      This scenario was reached on a Raspberry Pi 3B with a Macally FDD-USB
      floppy drive (identified as 0424:0fdc Standard Microsystems Corp.
      Floppy, based on the USB97CFDC USB FDC). With the relay delay, the drive
      would be unable to mount a disk, replying with NAKs until the device was
      reset.
      
      Using ktime, the delta between starting the timer (in dwc2_hcd_qh_add)
      and the callback function can be determined. With the original delay
      implementation, this value was consistently approximately 12ms. (output
      in us).
      
          <idle>-0     [000] ..s.  1600.559974: dwc2_wait_timer_fn: wait_timer delta: 11976
          <idle>-0     [000] ..s.  1600.571974: dwc2_wait_timer_fn: wait_timer delta: 11977
          <idle>-0     [000] ..s.  1600.583974: dwc2_wait_timer_fn: wait_timer delta: 11976
          <idle>-0     [000] ..s.  1600.595974: dwc2_wait_timer_fn: wait_timer delta: 11977
      
      After converting the relay delay to using a higher resolution timer, the
      delay was much closer to 1ms.
      
          <idle>-0     [000] d.h.  1956.553017: dwc2_wait_timer_fn: wait_timer delta: 1002
          <idle>-0     [000] d.h.  1956.554114: dwc2_wait_timer_fn: wait_timer delta: 1002
          <idle>-0     [000] d.h.  1957.542660: dwc2_wait_timer_fn: wait_timer delta: 1004
          <idle>-0     [000] d.h.  1957.543701: dwc2_wait_timer_fn: wait_timer delta: 1002
      
      The floppy drive operates properly with delays up to approximately 5ms,
      and sends NAKs for any delays that are longer.
      
      Fixes: 38d2b5fb ("usb: dwc2: host: Don't retry NAKed transactions right away")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NTerin Stock <terin@terinstock.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      6ed30a7d
    • M
      usb: dwc2: Disable power down feature on Samsung SoCs · 35a60541
      Marek Szyprowski 提交于
      Power down feature of DWC2 module integrated in Samsung SoCs doesn't work
      properly or needs some additional handling in PHY or SoC glue layer, so
      disable it for now. Without disabling power down, DWC2 causes random memory
      trashes and fails enumeration if there is no USB link to host on driver
      probe.
      
      Fixes: 03ea6d6e ("usb: dwc2: Enable power down")
      Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      35a60541
  14. 26 11月, 2018 2 次提交
  15. 14 11月, 2018 1 次提交
  16. 05 10月, 2018 1 次提交
    • S
      usb: dwc2: disable power_down on rockchip devices · c216765d
      SolidHal 提交于
       The bug would let the usb controller enter partial power down,
       which was formally known as hibernate, upon boot if nothing was plugged
       in to the port. Partial power down couldn't be exited properly, so any
       usb devices plugged in after boot would not be usable.
      
       Before the name change, params.hibernation was false by default, so
       _dwc2_hcd_suspend() would skip entering hibernation. With the
       rename, _dwc2_hcd_suspend() was changed to use  params.power_down
       to decide whether or not to enter partial power down.
      
       Since params.power_down is non-zero by default, it needs to be set
       to 0 for rockchip devices to restore functionality.
      
       This bug was reported in the linux-usb thread:
       REGRESSION: usb: dwc2: USB device not seen after boot
      
       The commit that caused this regression is:
      6d23ee9cSigned-off-by: NSolidHal <hal@halemmerich.com>
      Acked-by: NMinas Harutyunyan <hminas@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      c216765d