1. 22 3月, 2017 1 次提交
  2. 21 6月, 2016 2 次提交
    • I
      usb: gadget: pch_udc: reorder spin_[un]lock to avoid deadlock · 1d23d16a
      Iago Abal 提交于
      The above commit reordered spin_lock/unlock and now `&dev->lock' is acquired
      (rather than released) before calling `dev->driver->disconnect',
      `dev->driver->setup', `dev->driver->suspend', `usb_gadget_giveback_request', and
      `usb_gadget_udc_reset'.
      
      But this *may* not be the right way to fix the problem pointed by d3cb25a1.
      
      Note that the other usb/gadget/udc drivers do release the lock before calling
      these functions. There are also inconsistencies within pch_udc.c, where
      `dev->driver->disconnect' is called while holding `&dev->lock' in lines 613 and
      1184, but not in line 2739.
      
      Finally, commit d3cb25a1 may have introduced several potential deadlocks.
      
      For instance, EBA (https://github.com/models-team/eba) reports:
      
          Double lock in drivers/usb/gadget/udc/pch_udc.c
          first at 2791: spin_lock(& dev->lock); [pch_udc_isr]
          second at 2694: spin_lock(& dev->lock); [pch_udc_svc_cfg_interrupt]
              after calling from 2793: pch_udc_dev_isr(dev, dev_intr);
              after calling from 2724: pch_udc_svc_cfg_interrupt(dev);
      
      Similarly, other potential deadlocks are 2791 -> 2793 -> 2721 -> 2657; and
      2791 -> 2793 -> 2711 -> 2573 -> 1499 -> 1480.
      
      Fixes: d3cb25a1 ("usb: gadget: udc: fix spin_lock in pch_udc")
      Signed-off-by: NIago Abal <mail@iagoabal.eu>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      1d23d16a
    • M
      usb: gadget: fix unused-but-set-variale warnings · 872ce511
      Michal Nazarewicz 提交于
      Those are enabled with W=1 make option.
      
      The patch leaves of some type-limits warnings which are caused by
      generic macros used in a way where they produce always-false
      conditions.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      872ce511
  3. 19 4月, 2016 1 次提交
  4. 18 4月, 2016 5 次提交
  5. 15 3月, 2016 1 次提交
  6. 19 10月, 2015 1 次提交
  7. 29 9月, 2015 1 次提交
  8. 05 8月, 2015 1 次提交
  9. 03 8月, 2015 1 次提交
    • P
      usb: gadget: udc: fix spin_lock in pch_udc · d3cb25a1
      Pengyu Ma 提交于
      When remove module g_serial on quark platform, the following Warning on:
      
      Modules linked in: usb_f_acm u_serial g_serial(-) pch_udc libcomposite configfs udc_core
      ad7298 industrialio_triggered_buffer kfifo_buf tpm_i2c_infineon indus
      CPU: 0 PID: 369 Comm: modprobe Not tainted 3.14.29ltsi-WR7.0.0.0_standard #6
      Hardware name: Intel Corp. QUARK/CrossHill, BIOS 0x010100F5 01/01/2014
       f641df0c f641df0c f641dec8 c15ac7fa f641defc c103084f c16c2356 f641df28
       00000171 c16b855c 000009dd c15b2d6f 000009dd c15b2d6f f6bd2000 faae5480
       00000000 f641df14 c10308a3 00000009 f641df0c c16c2356 f641df28 f641df2c
      Call Trace:
       [<c15ac7fa>] dump_stack+0x16/0x18
       [<c103084f>] warn_slowpath_common+0x7f/0xa0
       [<c15b2d6f>] ? preempt_count_sub+0x6f/0xc0
       [<c15b2d6f>] ? preempt_count_sub+0x6f/0xc0
       [<c10308a3>] warn_slowpath_fmt+0x33/0x40
       [<c15b2d6f>] preempt_count_sub+0x6f/0xc0
       [<faadbc82>] pch_udc_pcd_pullup+0x32/0xa0 [pch_udc]
       [<fa9747d9>] usb_gadget_remove_driver+0x29/0x60 [udc_core]
       [<fa974869>] usb_gadget_unregister_driver+0x59/0x80 [udc_core]
       [<faa78310>] usb_composite_unregister+0x10/0x20 [libcomposite]
       [<faae50f1>] cleanup+0xd/0xf [g_serial]
       [<c1084c47>] SyS_delete_module+0xf7/0x150
       [<c111f8dd>] ? ____fput+0xd/0x10
       [<c104b2ae>] ? task_work_run+0x6e/0xa0
       [<c15afda5>] syscall_call+0x7/0x7
      
      g_serial module on quark is depended on pch_udc module, ttyGSX cann't recieve
      data and warning on when remove g_serial.
      
      It was unlocked before the modification of the structure it was protecting,
      fix it as "lock -> unlock" to resolve this.
      Signed-off-by: NPengyu Ma <pengyu.ma@windriver.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d3cb25a1
  10. 29 7月, 2015 1 次提交
    • V
      usb: udc: Convert use of __constant_cpu_to_leXX to cpu_to_leXX · b5c03bff
      Vaishali Thakkar 提交于
      In big endian cases, the macro cpu_to_le{16,32} unfolds to __swab{16,32}
      which provides special case for constants. In little endian cases,
      __constant_cpu_to_le{16,32} and cpu_to_le{16,32} expand directly to
      the same expression. So, replace __constant_cpu_to_le{16,32} with
      cpu_to_le{16,32} with the goal of getting rid of the definition of
      __constant_cpu_to_le{16,32} completely.
      
      The semantic patch that performs this transformation is as follows:
      
      @@expression x;@@
      
      (
      - __constant_cpu_to_le16(x)
      + cpu_to_le16(x)
      |
      - __constant_cpu_to_le32(x)
      + cpu_to_le32(x)
      )
      Signed-off-by: NVaishali Thakkar <vthakkar1994@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      b5c03bff
  11. 30 1月, 2015 1 次提交
  12. 11 11月, 2014 1 次提交
  13. 04 11月, 2014 1 次提交
  14. 25 9月, 2014 1 次提交
  15. 20 8月, 2014 1 次提交
  16. 17 7月, 2014 1 次提交
  17. 18 12月, 2013 1 次提交
    • R
      usb: gadget: add "maxpacket_limit" field to struct usb_ep · e117e742
      Robert Baldyga 提交于
      This patch adds "maxpacket_limit" to struct usb_ep. This field contains
      maximum value of maxpacket supported by driver, and is set in driver probe.
      This value should be used by autoconfig() function, because value of field
      "maxpacket" is set to value from endpoint descriptor when endpoint becomes
      enabled. So when autoconfig() function will be called again for this endpoint,
      "maxpacket" value will contain wMaxPacketSize from descriptior instead of
      maximum packet size for this endpoint.
      
      For this reason this patch adds new field "maxpacket_limit" which contains
      value of maximum packet size (which defines maximum endpoint capabilities).
      This value is used in ep_matches() function used by autoconfig().
      
      Value of "maxpacket_limit" should be set in UDC driver probe function, using
      usb_ep_set_maxpacket_limit() function, defined in gadget.h. This function
      set choosen value to both "maxpacket_limit" and "maxpacket" fields.
      
      This patch modifies UDC drivers by adding support for maxpacket_limit.
      Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      e117e742
  18. 07 12月, 2013 1 次提交
  19. 05 12月, 2013 1 次提交
  20. 01 10月, 2013 1 次提交
  21. 26 9月, 2013 1 次提交
  22. 27 3月, 2013 1 次提交
    • F
      usb: gadget: pch_udc: fix sparse warnings · 3f8b6201
      Felipe Balbi 提交于
      fix the following sparse warnings:
      
      drivers/usb/gadget/pch_udc.c:1483:9: warning: context imbalance in 'complete_req' - unexpected unlock
      drivers/usb/gadget/pch_udc.c:2408:28: warning: context imbalance in 'pch_udc_svc_control_out' - unexpected unlock
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3f8b6201
  23. 18 3月, 2013 5 次提交
  24. 25 1月, 2013 1 次提交
  25. 10 9月, 2012 1 次提交
  26. 04 6月, 2012 1 次提交
  27. 04 5月, 2012 2 次提交
  28. 06 3月, 2012 1 次提交
  29. 24 2月, 2012 1 次提交
  30. 09 2月, 2012 1 次提交
    • T
      usb: gadget: pch_udc: Detecting VBUS through GPIO with interrupt · 637b78eb
      Tomoya MORINAGA 提交于
      Problem:
       pch_udc continues operation even if VBUS becomes Low.
       pch_udc performs D+ pulling up before VBUS becomes High.
       USB device should be controlled according to VBUS state.
      
      Root cause:
       The current pch_udc is not always monitoring VBUS.
      
      Solution:
       The change of VBUS is detected using an interrupt of GPIO.
       If VBUS became Low, pch_udc handles 'disconnect'.
       After VBUS became High, a pull improves D+, and pch_udc
       handles 'connect'.
      
      [ balbi@ti.com : make it actually compile ]
      Signed-off-by: NTomoya MORINAGA <tomoya.rohm@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      637b78eb