1. 25 9月, 2010 6 次提交
    • M
      usb: musb: gadget: fix dma length in txstate · 66af83dd
      Ming Lei 提交于
      DMA length should not go beyond the availabe space
      of request buffer, so fix it.
      
      Also set max_len of cppi dma channel as max size of
      int type, so make musb dma handling happier.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      66af83dd
    • M
      usb: musb: gadget: complete request only if data is transfered over · bb27bc2c
      Ming Lei 提交于
      Complete the current request only if the data transfer is over.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bb27bc2c
    • M
      usb: musb: gadget: fix DMA length for OUT transfer · 1018b4e4
      Ming Lei 提交于
      DMA length should not go beyond the availabe space of request buffer,
      so fix it.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NAnand Gadiyar <gadiyar@ti.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1018b4e4
    • M
      usb: musb: gadget: enable autoclear for OUT transfer in both DMA 0 and DMA 1 · 490e5fbe
      Ming Lei 提交于
      This patch fixes one bugs of OUT transfer in double buffer case:
      
      	-the current code only enable autoclear for dma mode 1, and not
      	for dma mode 0
      
      Without this patch, test #5 of usbtest can't be passed if we
      configure musb as g_zero and use fifo mode 3 to enable double
      buffer mode.
      
      With this patch and the following patch(fix dma length),
      on my beagle B5, test#5(queued bulk out) may go beyond
      18Mbyte/s(seems dma mode 0 is quicker in double buffer case)
      if musb is configured as g_zero and fifo mode 3 is taken, follows
      the test command:
      
          #./testusb -D DEV_NAME -c 1024 -t 5 -s 32768 -g 8   [1]
      
      Also I have tested this patch can't make g_ether broken.
      
      [1],source of testusb : tools/usb/testusb.c under linux kernel;
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      490e5fbe
    • M
      usb: musb: gadget: fix bulk IN infinit hangs in double buffer case · eeb1b2a4
      Ming Lei 提交于
      This patch fixes one infinite hang of bulk IN transfer in double buffer
      case, the hang can be observed easily by test #6 of usbtest if musb is
      configured as g_zero and fifo mode 3 is taken to enable double fifo.
      
      In fact, the patch only removes the check for non-empty fifo before
      loading data from new request into fifo since the check is not correct:
      
      	-in double buffer case, fifo may accommodate more than one packet,
      	even though it has contained one packet already and is non-empty
      
      	-since last DMA is completed before calling musb_g_tx, it is sure
      	that fifo may accommodate at least one packet
      
      Without applying the patch, new requst enqueued from .complte may not
      have a chance to be loaded into fifo, then will never be completed and
      cause infinite hangs.
      
      With the patch, on my beagle B5, test#6(queued bulk in) can be passed and
      test result may go beyond 33Mbyte/s if musb is configured as g_zero and
      fifo mode 3 is taken, follows the test command:
      
      	#testusb -D DEV_NAME -c 1024 -t 6 -s 32768 -g 8   [1]
      
      [1],
          -source of testusb : tools/usb/testusb.c under linux kernel;
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NAnand Gadiyar <gadiyar@ti.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      eeb1b2a4
    • M
      usb: musb: gadget: fix kernel panic if using out ep with FIFO_TXRX style · bd2e74d6
      Ming Lei 提交于
      For shared fifo hw endpoint(with FIFO_TXRX style), only ep_in
      field of musb_hw_ep is intialized in musb_g_init_endpoints, and
      ep_out is not initialized, but musb_g_rx and rxstate may access
      ep_out field of musb_hw_ep by the method below:
      
      	musb_ep = &musb->endpoints[epnum].ep_out
      
      which can cause the kernel panic[1] below, this patch fixes the issue
      by getting 'musb_ep' from '&musb->endpoints[epnum].ep_in' for shared fifo
      endpoint.
      
      [1], kernel panic
      [root@OMAP3EVM /]# musb_interrupt 1583: ** IRQ peripheral usb0008 tx0000 rx4000
      musb_stage0_irq 460: <== Power=f0, DevCtl=99, int_usb=0x8
      musb_g_rx 772: <== (null), rxcsr 4007 ffffffe8
      musb_g_rx 786:  iso overrun on ffffffe8
      Unable to handle kernel NULL pointer dereference at virtual address 00000008
      pgd = c0004000
      [00000008] *pgd=00000000
      Internal error: Oops: 17 [#1] PREEMPT
      last sysfs file: /sys/devices/platform/musb_hdrc/usb1/usb_device/usbdev1.1/dev
      Modules linked in: g_zero
      CPU: 0    Tainted: G        W    (2.6.35-rc6-gkh-wl+ #92)
      PC is at musb_g_rx+0xfc/0x2ec
      LR is at vprintk+0x3f4/0x458
      pc : [<c02c07a4>]    lr : [<c006ccb0>]    psr: 20000193
      sp : c760bd78  ip : c03c9d70  fp : c760bdbc
      r10: 00000000  r9 : fa0ab1e0  r8 : 0000000e
      r7 : c7e80158  r6 : ffffffe8  r5 : 00000001  r4 : 00004003
      r3 : 00010003  r2 : c760bcd8  r1 : c03cd030  r0 : 0000002e
      Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 8778c019  DAC: 00000017
      Process kmemleak (pid: 421, stack limit = 0xc760a2e8)
      Stack: (0xc760bd78 to 0xc760c000)
      bd60:                                                       ffffffe8 c04b1b58
      bd80: ffffffe8 c7c01ac0 00000000 c7e80d24 c0084238 00000001 00000001 c7e80158
      bda0: 0000000e 00000008 00000099 000000f0 c760be04 c760bdc0 c02bcd68 c02c06b4
      bdc0: 00000099 00000008 00004000 c760bdd8 c03cc4f8 00000000 00000002 c7e80158
      bde0: c7d2e300 60000193 c760a000 0000005c 00000000 00000000 c760be24 c760be08
      be00: c02bcecc c02bc1ac c7d2e300 c7d2e300 0000005c c760a000 c760be54 c760be28
      be20: c00ad698 c02bce6c 00000000 c7d2e300 c067c258 0000005c c067c294 00000001
      be40: c760a000 00000000 c760be74 c760be58 c00af984 c00ad5fc 0000005c 00000000
      be60: 00000000 00000002 c760be8c c760be78 c0039080 c00af8d0 ffffffff fa200000
      be80: c760beec c760be90 c0039b6c c003900c 00000001 00000000 c7d1e240 00000000
      bea0: 00000000 c068bae8 00000000 60000013 00000001 00000000 00000000 c760beec
      bec0: c0064ecc c760bed8 c00ff7d0 c003a0a8 60000013 ffffffff 00000000 c068bae8
      bee0: c760bf24 c760bef0 c00ff7d0 c0064ec4 00000001 00000000 c00ff700 00000000
      bf00: c0087f00 00000000 60000013 c0d76a70 c0e23795 00000001 c760bf4c c760bf28
      bf20: c00ffdd8 c00ff70c c068bb08 c068bae8 60000013 c0100938 c068bb30 00000000
      bf40: c760bf84 c760bf50 c010014c c00ffd84 00000001 00000000 c010000c 00012c00
      bf60: c7c33f04 00012c00 c7c33f04 00000000 c0100938 00000000 c760bf9c c760bf88
      bf80: c01009a8 c0100018 c760bfa8 c7c33f04 c760bff4 c760bfa0 c0088000 c0100944
      bfa0: c760bf98 00000000 00000000 00000001 dead4ead ffffffff ffffffff c08ba2bc
      bfc0: 00000000 c049e7fa 00000000 c0087f70 c760bfd0 c760bfd0 c7c33f04 c0087f70
      bfe0: c006f5e8 00000013 00000000 c760bff8 c006f5e8 c0087f7c 7f0004ff df2000ff
      Backtrace:
      [<c02c06a8>] (musb_g_rx+0x0/0x2ec) from [<c02bcd68>] (musb_interrupt+0xbc8/0xcc0)
      [<c02bc1a0>] (musb_interrupt+0x0/0xcc0) from [<c02bcecc>] (generic_interrupt+0x6c/0x84)
      [<c02bce60>] (generic_interrupt+0x0/0x84) from [<c00ad698>] (handle_IRQ_event+0xa8/0x1ec)
       r7:c760a000 r6:0000005c r5:c7d2e300 r4:c7d2e300
      [<c00ad5f0>] (handle_IRQ_event+0x0/0x1ec) from [<c00af984>] (handle_level_irq+0xc0/0x13c)
      [<c00af8c4>] (handle_level_irq+0x0/0x13c) from [<c0039080>] (asm_do_IRQ+0x80/0xa0)
       r7:00000002 r6:00000000 r5:00000000 r4:0000005c
      [<c0039000>] (asm_do_IRQ+0x0/0xa0) from [<c0039b6c>] (__irq_svc+0x4c/0xb4)
      Exception stack(0xc760be90 to 0xc760bed8)
      be80:                                     00000001 00000000 c7d1e240 00000000
      bea0: 00000000 c068bae8 00000000 60000013 00000001 00000000 00000000 c760beec
      bec0: c0064ecc c760bed8 c00ff7d0 c003a0a8 60000013 ffffffff
       r5:fa200000 r4:ffffffff
      [<c0064eb8>] (sub_preempt_count+0x0/0x100) from [<c00ff7d0>] (find_and_get_object+0xd0/0x110)
       r5:c068bae8 r4:00000000
      [<c00ff700>] (find_and_get_object+0x0/0x110) from [<c00ffdd8>] (scan_block+0x60/0x104)
       r8:00000001 r7:c0e23795 r6:c0d76a70 r5:60000013 r4:00000000
      [<c00ffd78>] (scan_block+0x0/0x104) from [<c010014c>] (kmemleak_scan+0x140/0x484)
      [<c010000c>] (kmemleak_scan+0x0/0x484) from [<c01009a8>] (kmemleak_scan_thread+0x70/0xcc)
       r8:00000000 r7:c0100938 r6:00000000 r5:c7c33f04 r4:00012c00
      [<c0100938>] (kmemleak_scan_thread+0x0/0xcc) from [<c0088000>] (kthread+0x90/0x98)
       r5:c7c33f04 r4:c760bfa8
      [<c0087f70>] (kthread+0x0/0x98) from [<c006f5e8>] (do_exit+0x0/0x684)
       r7:00000013 r6:c006f5e8 r5:c0087f70 r4:c7c33f04
      Code: e3002312 e58d6000 e2833e16 eb0422d5 (e5963020)
      ---[ end trace f3d5e96f75c297b7 ]---
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Reviewed-by: NSergei Shtylyov <sshtylyov@mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Anand Gadiyar <gadiyar@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bd2e74d6
  2. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  3. 03 3月, 2010 2 次提交
  4. 24 12月, 2009 5 次提交
  5. 12 12月, 2009 3 次提交
  6. 01 12月, 2009 1 次提交
    • S
      USB: musb_gadget: fix STALL handling · cea83241
      Sergei Shtylyov 提交于
      The driver incorrectly cancels the mass-storage device CSW request
      (which leads to device reset) due to giving back URB at the head of
      endpoint's queue after sending each STALL handshake; stop doing that
      and start checking for the queue being non-empty before stalling an
      endpoint and disallowing stall in such case in musb_gadget_set_halt()
      like the other gadget drivers do.
      
      Moreover, the driver starts Rx request despite of the endpoint being
      halted -- fix this by moving the SendStall bit check from musb_g_rx()
      to rxstate().  And we also sometimes get into rxstate() with DMA still
      active after clearing an endpoint's halt (not clear why), so bail out
      in this case, similarly to what txstate() does...
      
      While at it, also do the following changes :
      
      - in musb_gadget_set_halt(), remove pointless Tx FIFO flushing (the
        driver does not allow stalling with non-empty Tx FIFO anyway);
      
      - in rxstate(), stop pointlessly zeroing the 'csr' variable;
      
      - in musb_gadget_set_halt(), move the 'done' label to a more proper
        place;
      
      - in musb_g_rx(), eliminate the 'done' label completely...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cea83241
  7. 16 6月, 2009 5 次提交
    • A
      musb: use dma mode 1 for TX if transfer size equals maxpacket (v2) · d1043a26
      Anand Gadiyar 提交于
      Currently, with Inventra DMA, we use Mode 0 if transfer size is less
      than or equal to the endpoint's maxpacket size.  This requires that
      we explicitly set TXPKTRDY for that transfer.
      
      However the musb_g_tx code will not set TXPKTRDY twice if the last
      transfer is exactly equal to maxpacket, even if request->zero is set.
      Using Mode 1 will solve this; a better fix might be in musb_g_tx().
      
      Without this change, musb will not correctly send out a ZLP if the
      last transfer is the maxpacket size and request->zero is set.
      Signed-off-by: NAnand Gadiyar <gadiyar@ti.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d1043a26
    • D
      musb: support disconnect after HNP roleswitch · ab983f2a
      David Brownell 提交于
      Adjust HNP state machines in MUSB driver so that they handle the
      case where the cable is disconnected.  The A-side machine was
      very wrong (unrecoverable); the B-Side was much less so.
      
       - A_PERIPHERAL ... as usual, the non-observability of the ID
         pin through Mentor's registers makes trouble.  We can't go
         directly to A_WAIT_VFALL to end the session and start the
         disconnect processing.  We can however sense link suspending,
         go to A_WAIT_BCON, and from there use OTG timeouts to finally
         trigger that A_WAIT_VFALL transition.  (Hoping that nobody
         reconnects quickly to that port and notices the wrong state.)
      
       - B_HOST ... actually clear the Host Request (HR) bit as the
         messages say, disconnect the peripheral from the root hub,
         and don't detour through a suspend state.  (In some cases
         this would eventually have cleaned up.)
      
      Also adjust the A_SUSPEND transition to respect the A_AIDL_BDIS
      timeout, so if HNP doesn't trigger quickly enough the A_WAIT_VFALL
      transition happens as it should.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ab983f2a
    • D
      musb: make initial HNP roleswitch work (v2) · 1de00dae
      David Brownell 提交于
      Minor HNP bugfixes, so the initial role switch works:
      
       - A-Device:
           * disconnect-during-suspend enters A_PERIPHERAL state
           * kill OTG timer after reset as A_PERIPHERAL ...
           * ... and also pass that reset to the gadget
           * once HNP succeeds, clear the "ignore_disconnect" flag
           * from A_PERIPHERAL, disconnect transitions to A_WAIT_BCON
      
       - B-Device:
           * kill OTG timer on entry to B_HOST state (HNP succeeded)
           * once HNP succeeds, clear "ignore_disconnect" flag
           * kick the root hub only _after_ the state is adjusted
      
      Other state transitions are left alone.  Notably, exit paths from
      the "roles have switched" state ... A_PERIPHERAL handling of that
      stays seriously broken.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1de00dae
    • D
      musb: proper hookup to transceiver drivers · 84e250ff
      David Brownell 提交于
      Let the otg_transceiver in MUSB be managed by an external driver;
      don't assume it's integrated.  OMAP3 chips need it to be external,
      and there may be ways to interact with the transceiver which add
      functionality to the system.
      
      Platform init code is responsible for setting up the transeciver,
      probably using the NOP transceiver for integrated transceivers.
      External ones will use whatever the board init code provided,
      such as twl4030 or something more hands-off.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      84e250ff
    • S
      musb_gadget: suppress "parasitic" TX interrupts with CPPI · 37e3ee99
      Sergei Shtylyov 提交于
      Suppress "parasitic" endpoint interrupts in the DMA mode
      when using CPPI DMA driver; they're caused by the MUSB gadget
      driver using the DMA request mode 0 instead of the mode 1.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      37e3ee99
  8. 18 4月, 2009 1 次提交
    • S
      USB: musb: sanitize clearing TXCSR DMA bits (take 2) · b6e434a5
      Sergei Shtylyov 提交于
      The MUSB code clears TXCSR_DMAMODE incorrectly in several
      places, either asserting that TXCSR_DMAENAB is clear (when
      sometimes it isn't) or clearing both bits together.  Recent
      versions of the programmer's guide require DMAENAB to be
      cleared first, although some older ones didn't.
      
      Fix this and while at it:
      
       - In musb_gadget::txstate(), stop clearing the AUTOSET
         and DMAMODE bits for the CPPI case since they never
         get set anyway (the former bit is reserved on DaVinci);
         but do clear the DMAENAB bit on the DMA error path.
      
       - In musb_host::musb_ep_program(), remove the duplicate
         DMA controller specific code code clearing the TXCSR
         previous state, add the code to clear TXCSR DMA bits
         on the Inventra DMA error path, to replace such code
         (executed late) on the PIO path.
      
       - In musbhsdma::dma_channel_abort()/dma_controller_irq(),
         add/use the 'offset' variable to avoid MUSB_EP_OFFSET()
         invocations on every RXCSR/TXCSR access.
      
      [dbrownell@users.sourceforge.net: don't introduce CamelCase,
      shrink diff]
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b6e434a5
  9. 28 2月, 2009 1 次提交
  10. 28 1月, 2009 1 次提交
    • J
      USB: musb uses endpoint functions · 96bcd090
      Julia Lawall 提交于
      This set of patches introduces calls to the following set of functions:
      
      usb_endpoint_dir_in(epd)
      usb_endpoint_dir_out(epd)
      usb_endpoint_is_bulk_in(epd)
      usb_endpoint_is_bulk_out(epd)
      usb_endpoint_is_int_in(epd)
      usb_endpoint_is_int_out(epd)
      usb_endpoint_num(epd)
      usb_endpoint_type(epd)
      usb_endpoint_xfer_bulk(epd)
      usb_endpoint_xfer_control(epd)
      usb_endpoint_xfer_int(epd)
      usb_endpoint_xfer_isoc(epd)
      
      In some cases, introducing one of these functions is not possible, and it
      just replaces an explicit integer value by one of the following constants:
      
      USB_ENDPOINT_XFER_BULK
      USB_ENDPOINT_XFER_CONTROL
      USB_ENDPOINT_XFER_INT
      USB_ENDPOINT_XFER_ISOC
      
      An extract of the semantic patch that makes these changes is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r1@ struct usb_endpoint_descriptor *epd; @@
      
      - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
      - \(USB_ENDPOINT_XFER_CONTROL\|0\))
      + usb_endpoint_xfer_control(epd)
      
      @r5@ struct usb_endpoint_descriptor *epd; @@
      
      - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
      -  \(USB_DIR_IN\|0x80\))
      + usb_endpoint_dir_in(epd)
      
      @inc@
      @@
      
      #include <linux/usb.h>
      
      @depends on !inc && (r1||r5)@
      @@
      
      + #include <linux/usb.h>
        #include <linux/usb/...>
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Acked-by: NFelipe Balbi <felipe.balbi@nokia.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      96bcd090
  11. 08 1月, 2009 1 次提交
  12. 14 8月, 2008 2 次提交