1. 17 Nov, 2015 1 commit
    • Douglas Gilbert's avatar
      usb: gadget: atmel_usba_udc: Expose correct device speed · d134c48d
      Douglas Gilbert authored
      Following changes that appeared in lk 4.0.0, the gadget udc driver for
      some ARM based Atmel SoCs (e.g. at91sam9x5 and sama5d3 families)
      incorrectly deduced full-speed USB link speed even when the hardware
      had negotiated a high-speed link. The fix is to make sure that the
      UDPHS Interrupt Enable Register value does not mask the SPEED bit
      in the Interrupt Status Register.
      
      For a mass storage gadget this problem lead to failures when the host
      had a USB 3 port with the xhci_hcd driver. If the host was a USB 2
      port using the ehci_hcd driver then the mass storage gadget worked
      (but probably at a lower speed than it should have).
      Signed-off-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Cc: <stable@vger.kernel.org> #4.0+
      Fixes: 9870d895 ("usb: atmel_usba_udc: Mask status with enabled irqs")
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d134c48d
  2. 21 Sep, 2015 1 commit
  3. 14 Aug, 2015 1 commit
  4. 04 Aug, 2015 1 commit
  5. 31 Jul, 2015 1 commit
  6. 27 May, 2015 1 commit
    • Felipe Balbi's avatar
      usb: gadget: atmel: fix build warnings · 94a715ed
      Felipe Balbi authored
      This patch fixes the following build warnings:
      
      drivers/usb/gadget/udc/atmel_usba_udc.c:2207:12: warning:
      ‘usba_udc_suspend’ defined but not used [-Wunused-function] static int
      usba_udc_suspend(struct device *dev)
      drivers/usb/gadget/udc/atmel_usba_udc.c:2236:12: warning:
      ‘usba_udc_resume’ defined but not used [-Wunused-function] static int
      usba_udc_resume(struct device *dev)
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      94a715ed
  7. 26 May, 2015 1 commit
  8. 27 Apr, 2015 1 commit
    • Arnd Bergmann's avatar
      usb: gadget: remove incorrect __init/__exit annotations · c94e289f
      Arnd Bergmann authored
      A recent change introduced a link error for the composite
      printer gadget driver:
      
      `printer_unbind' referenced in section `.ref.data' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
      
      Evidently the unbind function should not be marked __exit here,
      because it is called through a callback pointer that is not necessarily
      discarded, __composite_unbind() is indeed called from the error path of
      composite_bind(), which can never work for a built-in driver.
      
      Looking at the surrounding code, I found the same problem in all other
      composite gadget drivers in both the bind and unbind functions, as
      well as the udc platform driver 'remove' functions. Those will break
      if anyone uses the 'unbind' sysfs attribute to detach a device from a
      built-in driver.
      
      This patch removes the incorrect annotations from all the gadget
      drivers.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c94e289f
  9. 19 Mar, 2015 1 commit
  10. 11 Mar, 2015 4 commits
  11. 17 Feb, 2015 1 commit
  12. 29 Jan, 2015 1 commit
  13. 26 Jan, 2015 1 commit
  14. 12 Jan, 2015 4 commits
  15. 10 Jan, 2015 1 commit
    • Songjun Wu's avatar
      usb: gadget: udc: atmel: fix possible oops when unloading module · 5fb694f9
      Songjun Wu authored
      When unloading the module 'g_hid.ko', the urb request will be dequeued and the
      completion routine will be excuted. If there is no urb packet, the urb request
      will not be added to the endpoint queue and the completion routine pointer in
      urb request is NULL.
      
      Accessing to this NULL function pointer will cause the Oops issue reported
      below.
      
      Add the code to check if the urb request is in the endpoint queue
      or not. If the urb request is not in the endpoint queue, a negative
      error code will be returned.
      
      Here is the Oops log:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = dedf0000
      [00000000] *pgd=3ede5831, *pte=00000000, *ppte=00000000
      Internal error: Oops: 80000007 [#1] ARM
      Modules linked in: g_hid(-) usb_f_hid libcomposite
      CPU: 0 PID: 923 Comm: rmmod Not tainted 3.18.0+ #2
      Hardware name: Atmel SAMA5 (Device Tree)
      task: df6b1100 ti: dedf6000 task.ti: dedf6000
      PC is at 0x0
      LR is at usb_gadget_giveback_request+0xc/0x10
      pc : [<00000000>]    lr : [<c02ace88>]    psr: 60000093
      sp : dedf7eb0  ip : df572634  fp : 00000000
      r10: 00000000  r9 : df52e210  r8 : 60000013
      r7 : df6a9858  r6 : df52e210  r5 : df6a9858  r4 : df572600
      r3 : 00000000  r2 : ffffff98  r1 : df572600  r0 : df6a9868
      Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c53c7d  Table: 3edf0059  DAC: 00000015
      Process rmmod (pid: 923, stack limit = 0xdedf6230)
      Stack: (0xdedf7eb0 to 0xdedf8000)
      7ea0:                                     00000000 c02adbbc df572580 deced608
      7ec0: df572600 df6a9868 df572634 c02aed3c df577c00 c01b8608 00000000 df6be27c
      7ee0: 00200200 00100100 bf0162f4 c000e544 dedf6000 00000000 00000000 bf010c00
      7f00: bf0162cc bf00159c 00000000 df572980 df52e218 00000001 df5729b8 bf0031d0
      [..]
      [<c02ace88>] (usb_gadget_giveback_request) from [<c02adbbc>] (request_complete+0x64/0x88)
      [<c02adbbc>] (request_complete) from [<c02aed3c>] (usba_ep_dequeue+0x70/0x128)
      [<c02aed3c>] (usba_ep_dequeue) from [<bf010c00>] (hidg_unbind+0x50/0x7c [usb_f_hid])
      [<bf010c00>] (hidg_unbind [usb_f_hid]) from [<bf00159c>] (remove_config.isra.6+0x98/0x9c [libcomposite])
      [<bf00159c>] (remove_config.isra.6 [libcomposite]) from [<bf0031d0>] (__composite_unbind+0x34/0x98 [libcomposite])
      [<bf0031d0>] (__composite_unbind [libcomposite]) from [<c02acee0>] (usb_gadget_remove_driver+0x50/0x78)
      [<c02acee0>] (usb_gadget_remove_driver) from [<c02ad570>] (usb_gadget_unregister_driver+0x64/0x94)
      [<c02ad570>] (usb_gadget_unregister_driver) from [<bf0160c0>] (hidg_cleanup+0x10/0x34 [g_hid])
      [<bf0160c0>] (hidg_cleanup [g_hid]) from [<c0056748>] (SyS_delete_module+0x118/0x19c)
      [<c0056748>] (SyS_delete_module) from [<c000e3c0>] (ret_fast_syscall+0x0/0x30)
      Code: bad PC value
      Signed-off-by: default avatarSongjun Wu <songjun.wu@atmel.com>
      [nicolas.ferre@atmel.com: reworked the commit message]
      Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Fixes: 914a3f3b ("USB: add atmel_usba_udc driver")
      Cc: <stable@vger.kernel.org> # 2.6.x-ish
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5fb694f9
  16. 22 Dec, 2014 2 commits
  17. 20 Nov, 2014 1 commit
  18. 10 Nov, 2014 1 commit
  19. 03 Nov, 2014 2 commits
  20. 20 Oct, 2014 1 commit
  21. 25 Sep, 2014 1 commit
  22. 19 Aug, 2014 1 commit
  23. 16 Jul, 2014 1 commit
  24. 30 Jun, 2014 1 commit
  25. 14 May, 2014 1 commit
  26. 05 Mar, 2014 2 commits
    • Gregory CLEMENT's avatar
      usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled · d8eb6c65
      Gregory CLEMENT authored
      commit 511f3c53 (usb: gadget: udc-core: fix a regression during gadget driver
      unbinding) introduced a crash when DEBUG is enabled.
      
      The debug trace in the atmel_usba_stop function made the assumption that the
      driver pointer passed in parameter was not NULL, but since the commit above,
      such assumption was no longer always true.
      
      This commit now uses the driver pointer stored in udc which fixes this
      issue.
      
      [ balbi@ti.com : improved commit log a bit ]
      
      Cc: <stable@vger.kernel.org> # v3.2+
      Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      d8eb6c65
    • Alexandre Belloni's avatar
      usb: gadget: atmel_usba: fix crash when no endpoint are specified · fb0e139d
      Alexandre Belloni authored
      If no endpoints are present in the device tree, the kernel will crash with the
      following error:
      
      Unable to handle kernel paging request at virtual address 00101008
      [...]
      [<c0222ff4>] (composite_dev_prepare) from [<c022326c>] (composite_bind+0x5c/0x190)
      [<c022326c>] (composite_bind) from [<c021ff8c>] (udc_bind_to_driver+0x48/0xf0)
      [<c021ff8c>] (udc_bind_to_driver) from [<c02208e0>] (usb_gadget_probe_driver+0x7c/0xa0)
      [<c02208e0>] (usb_gadget_probe_driver) from [<c0008970>] (do_one_initcall+0x94/0x140)
      [<c0008970>] (do_one_initcall) from [<c04b4b50>] (kernel_init_freeable+0xec/0x1b4)
      [<c04b4b50>] (kernel_init_freeable) from [<c0376cc4>] (kernel_init+0x8/0xe4)
      [<c0376cc4>] (kernel_init) from [<c0009590>] (ret_from_fork+0x14/0x24)
      Code: e5950014 e1a04001 e5902008 e3a010d0 (e5922008)
      ---[ end trace 35c74bdd89b373d0 ]---
      Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
      
      This checks for that case and returns an error, not allowing the driver to be
      loaded with no endpoints.
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      fb0e139d
  27. 19 Feb, 2014 2 commits
  28. 17 Dec, 2013 3 commits