1. 04 6月, 2012 1 次提交
  2. 04 5月, 2012 2 次提交
  3. 19 4月, 2012 1 次提交
  4. 11 4月, 2012 1 次提交
    • P
      usb: fsl_udc_core: prime status stage once data stage has primed · f79a60b8
      Peter Chen 提交于
      - For Control Read transfer, the ACK handshake on an IN transaction
      may be corrupted, so the device may not receive the ACK for data
      stage, the complete irq will not occur at this situation.
      Therefore, we need to move prime status stage from complete irq
      routine to the place where the data stage has just primed, or the
      host will never get ACK for status stage.
      The above issue has been described at USB2.0 spec chapter 8.5.3.3.
      
      - After adding prime status stage just after prime the data stage,
      there is a potential problem when the status dTD is added before the data stage
      has primed by hardware. The reason is the device's dTD descriptor has NO direction bit,
      if data stage (IN) prime hasn't finished, the status stage(OUT)
      dTD will be added at data stage dTD's Next dTD Pointer, so when the data stage
      transfer has finished, the status dTD will be primed as IN by hardware,
      then the host will never receive ACK from the device side for status stage.
      
      - Delete below code at fsl_ep_queue:
             /* Update ep0 state */
             if ((ep_index(ep) == 0))
                     udc->ep0_state = DATA_STATE_XMIT;
      the udc->ep0_state will be updated again after udc->driver->setup
      finishes.
      
      It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial.
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f79a60b8
  5. 29 3月, 2012 1 次提交
  6. 27 2月, 2012 2 次提交
  7. 24 2月, 2012 2 次提交
    • P
      usb: fsl_udc_core: Fix scheduling while atomic dump message · c5cc5ed8
      Peter Chen 提交于
      When loading g_ether gadget, there is below message:
      
      Backtrace:
      [<80012248>] (dump_backtrace+0x0/0x10c) from [<803cb42c>] (dump_stack+0x18/0x1c)
      r7:00000000 r6:80512000 r5:8052bef8 r4:80513f30
      [<803cb414>] (dump_stack+0x0/0x1c) from [<8000feb4>] (show_regs+0x44/0x50)
      [<8000fe70>] (show_regs+0x0/0x50) from [<8004c840>] (__schedule_bug+0x68/0x84)
      r5:8052bef8 r4:80513f30
      [<8004c7d8>] (__schedule_bug+0x0/0x84) from [<803cd0e4>] (__schedule+0x4b0/0x528)
      r5:8052bef8 r4:809aad00
      [<803ccc34>] (__schedule+0x0/0x528) from [<803cd214>] (_cond_resched+0x44/0x58)
      [<803cd1d0>] (_cond_resched+0x0/0x58) from [<800a9488>] (dma_pool_alloc+0x184/0x250)
       r5:9f9b4000 r4:9fb4fb80
       [<800a9304>] (dma_pool_alloc+0x0/0x250) from [<802a8ad8>] (fsl_req_to_dtd+0xac/0x180)
      [<802a8a2c>] (fsl_req_to_dtd+0x0/0x180) from [<802a8ce4>] (fsl_ep_queue+0x138/0x274)
      [<802a8bac>] (fsl_ep_queue+0x0/0x274) from [<7f004328>] (composite_setup+0x2d4/0xfac [g_ether])
      [<7f004054>] (composite_setup+0x0/0xfac [g_ether]) from [<802a9bb4>] (fsl_udc_irq+0x8dc/0xd38)
      [<802a92d8>] (fsl_udc_irq+0x0/0xd38) from [<800704f8>] (handle_irq_event_percpu+0x54/0x188)
      [<800704a4>] (handle_irq_event_percpu+0x0/0x188) from [<80070674>] (handle_irq_event+0x48/0x68)
      [<8007062c>] (handle_irq_event+0x0/0x68) from [<800738ec>] (handle_level_irq+0xb4/0x138)
       r5:80514f94 r4:80514f40
       [<80073838>] (handle_level_irq+0x0/0x138) from [<8006ffa4>] (generic_handle_irq+0x38/0x44)
       r7:00000012 r6:80510b1c r5:80529860 r4:80512000
       [<8006ff6c>] (generic_handle_irq+0x0/0x44) from [<8000f4c4>] (handle_IRQ+0x54/0xb4)
      [<8000f470>] (handle_IRQ+0x0/0xb4) from [<800085b8>] (tzic_handle_irq+0x64/0x94)
       r9:412fc085 r8:00000000 r7:80513f30 r6:00000001 r5:00000000
       r4:00000000
       [<80008554>] (tzic_handle_irq+0x0/0x94) from [<8000e680>] (__irq_svc+0x40/0x60)
      
      The reason of above dump message is calling dma_poll_alloc with can-schedule
      mem_flags at atomic context.
      
      To fix this problem, below changes are made:
      - fsl_req_to_dtd doesn't need to be protected by spin_lock_irqsave,
      as struct usb_request can be access at process context. Move lock
      to beginning of hardware visit (fsl_queue_td).
      - Change the memory flag which using to allocate dTD descriptor buffer,
      the memory flag can be from gadget layer.
      
      It is tested at i.mx51 bbg board with g_mass_storage, g_ether, g_serial.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Acked-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c5cc5ed8
    • I
      usb: gadget: Clear usb_endpoint_descriptor inside the struct usb_ep on disable · f9c56cdd
      Ido Shayevitz 提交于
      This fix a bug in f_serial, which expect the ep->desc to be NULL after
      disabling an endpoint.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NIdo Shayevitz <idos@codeaurora.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      f9c56cdd
  8. 24 1月, 2012 1 次提交
  9. 12 12月, 2011 2 次提交
  10. 29 11月, 2011 3 次提交
  11. 16 11月, 2011 1 次提交
  12. 15 11月, 2011 2 次提交
  13. 18 9月, 2011 1 次提交
    • M
      usb: Provide usb_speed_string() function · e538dfda
      Michal Nazarewicz 提交于
      In a few places in the kernel, the code prints
      a human-readable USB device speed (eg. "high speed").
      This involves a switch statement sometimes wrapped
      around in ({ ... }) block leading to code repetition.
      
      To mitigate this issue, this commit introduces
      usb_speed_string() function, which returns
      a human-readable name of provided speed.
      
      It also changes a few places switch was used to use
      this new function.  This changes a bit the way the
      speed is printed in few instances at the same time
      standardising it.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e538dfda
  14. 24 8月, 2011 1 次提交
    • K
      USB: use usb_endpoint_maxp() instead of le16_to_cpu() · 29cc8897
      Kuninori Morimoto 提交于
      Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
      instead of le16_to_cpu(desc->wMaxPacketSize).
      This patch fix it up
      
      Cc: Armin Fuerst <fuerst@in.tum.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Johannes Erdfelt <johannes@erdfelt.com>
      Cc: Vojtech Pavlik <vojtech@suse.cz>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: David Kubicek <dave@awk.cz>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Brad Hards <bhards@bigpond.net.au>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: David Lopo <dlopo@chipidea.mips.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
      Cc: Xie Xiaobo <X.Xie@freescale.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Jiang Bo <tanya.jiang@freescale.com>
      Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
      Cc: Darius Augulis <augulis.darius@gmail.com>
      Cc: Xiaochen Shen <xiaochen.shen@intel.com>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Ben Dooks <ben@simtec.co.uk>
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Herbert Pötzl <herbert@13thfloor.at>
      Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
      Cc: Roman Weissgaerber <weissg@vienna.at>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: Florian Floe Echtler <echtler@fs.tum.de>
      Cc: Christian Lucht <lucht@codemercs.com>
      Cc: Juergen Stuber <starblue@sourceforge.net>
      Cc: Georges Toth <g.toth@e-biz.lu>
      Cc: Bill Ryder <bryder@sgi.com>
      Cc: Kuba Ober <kuba@mareimbrium.org>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      29cc8897
  15. 02 7月, 2011 1 次提交
  16. 29 6月, 2011 1 次提交
    • S
      usb: gadget: convert all users to the new udc infrastructure · 0f91349b
      Sebastian Andrzej Siewior 提交于
      peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
      register/unregister to the udc-core.
      
      The udc-core will take the first available gadget driver and attach
      function driver which is calling usb_gadget_register_driver(). This is
      the same behaviour we have right now.
      
      Only dummy_hcd was tested, the others were compiled tested.
      
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Dan Carpenter <error27@gmail.com>
      Cc: Darius Augulis <augulis.darius@gmail.com>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
      Cc: Roy Huang <roy.huang@analog.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
      Cc: Xiaochen Shen <xiaochen.shen@intel.com>
      Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
      Cc: cxie4 <cxie4@marvell.com>
      Cc: linux-geode@lists.infradead.org
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0f91349b
  17. 10 6月, 2011 1 次提交
  18. 07 5月, 2011 1 次提交
  19. 03 5月, 2011 3 次提交
  20. 31 3月, 2011 1 次提交
  21. 03 3月, 2011 1 次提交
  22. 23 10月, 2010 1 次提交
  23. 10 8月, 2010 1 次提交
  24. 21 5月, 2010 1 次提交
  25. 31 10月, 2009 1 次提交
    • A
      USB: fsl_udc_core: Fix kernel oops on module removal · 37c4fd8c
      Anton Vorontsov 提交于
      fsl_udc_release() calls dma_free_coherent() with an inappropriate
      device passed to it, and since the device has no dma_ops, the following
      oops pops up:
      
        Kernel BUG at d103ce9c [verbose debug info unavailable]
        Oops: Exception in kernel mode, sig: 5 [#1]
        ...
        NIP [d103ce9c] fsl_udc_release+0x50/0x80 [fsl_usb2_udc]
        LR [d103ce74] fsl_udc_release+0x28/0x80 [fsl_usb2_udc]
        Call Trace:
        [cfbc7dc0] [d103ce74] fsl_udc_release+0x28/0x80 [fsl_usb2_udc]
        [cfbc7dd0] [c01a35c4] device_release+0x2c/0x90
        [cfbc7de0] [c016b480] kobject_cleanup+0x58/0x98
        [cfbc7e00] [c016c52c] kref_put+0x54/0x6c
        [cfbc7e10] [c016b360] kobject_put+0x34/0x64
        [cfbc7e20] [c01a1d0c] put_device+0x1c/0x2c
        [cfbc7e30] [d103dbfc] fsl_udc_remove+0xc0/0x1e4 [fsl_usb2_udc]
        ...
      
      This patch fixes the issue by passing dev->parent, which points to
      a correct device.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Guennadi Liakhovetski <lg@denx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      37c4fd8c
  26. 16 6月, 2009 1 次提交
  27. 25 3月, 2009 1 次提交
  28. 28 2月, 2009 1 次提交
  29. 01 12月, 2008 1 次提交
    • A
      USB: fsl_usb2_udc: Report disconnect before unbinding · 1f15a506
      Anton Vorontsov 提交于
      Gadgets disable endpoints in their disconnect callbacks, so
      we must call disconnect before unbinding.
      
      The patch fixes following badness:
      
      root@b1:~# insmod fsl_usb2_udc.ko
      Freescale High-Speed USB SOC Device Controller driver (Apr 20, 2007)
      root@b1:~# insmod g_ether.ko
      g_ether gadget: using random self ethernet address
      g_ether gadget: using random host ethernet address
      usb0: MAC 26:07:ba:c0:44:33
      usb0: HOST MAC 96:81:0c:05:4d:e3
      g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
      g_ether gadget: g_ether ready
      fsl-usb2-udc: bind to driver g_ether
      g_ether gadget: high speed config #1: CDC Ethernet (ECM)
      root@b1:~# rmmod g_ether.ko
      ------------[ cut here ]------------
      Badness at drivers/usb/gadget/composite.c:871
      [...]
      NIP [e10c3454] composite_unbind+0x24/0x15c [g_ether]
      LR [e10aa454] usb_gadget_unregister_driver+0x13c/0x164 [fsl_usb2_udc]
      Call Trace:
      [df145e80] [ffffff94] 0xffffff94 (unreliable)
      [df145eb0] [e10aa454] usb_gadget_unregister_driver+0x13c/0x164 [fsl_usb2_udc]
      [df145ed0] [e10c4c40] usb_composite_unregister+0x3c/0x4c [g_ether]
      [df145ee0] [c006bcc0] sys_delete_module+0x130/0x19c
      [df145f40] [c00142d8] ret_from_syscall+0x0/0x38
      [...]
      unregistered gadget driver 'g_ether'
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1f15a506
  30. 18 10月, 2008 2 次提交