1. 13 4月, 2011 1 次提交
    • M
      USB: musb: blackfin: work around anomaly 05000450 · 13254307
      Mike Frysinger 提交于
      DMA mode 1 data corruption anomaly on Blackfin systems.  This issue is
      specific to the Blackfin silicon as the bug appears to be related to the
      connection of the musb ip to the bus/dma fabric.
      
      Data corruption when using USB DMA mode 1. (Issue manager 17-01-0105)
      DMA mode 1 allows large size transfers to generate a single interrupt
      at the end of the entire transfer.  The transfer is split up in packets
      of length specified in the Maximum Packet Size field for that endpoint.
      If the transfer size is not an integer multiple of the Maximum Packet
      Size, a short packet will be present at the end of the transfer.
      
      Under certain conditions this packet may be corrupted in the USB FIFO.
      
      Workaround:
      Use DMA mode 1 to transfer (n* Maximum Packet Size) and schedule DMA
      mode 0 to transfer the short packet.
      
      As an example if your transfer size is 33168 bytes and Maximum Packet
      Size equals 512, schedule [33168 - (33168 mod 512)] in DMA mode 1 and
      the remainder (33168 mod 512) in DMA mode 0.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      13254307
  2. 01 12月, 2010 1 次提交
    • H
      usb: musb: add names for IRQs in structure resource · fcf173e4
      Hema Kalliguddi 提交于
      Soon resource data will get automatically
      populated from a set of autogenerated data
      from TI's hardware database for the OMAP
      platform.
      
      Such database, might not have resources at
      the expected order by the current drivers.
      
      While we could hack in some exceptions to
      that tool to generate resources in a specific
      order, it seems less fragile to use the
      resource name instead. That way, no matter
      what order the resources are generated, the
      driver still work.
      
      Modified the OMAP, Blackfin and Davinci
      architecture files to add the name of the IRQs
      in the resource structures and musb driver to
      use the platform_get_irq_byname() api to get
      the device and dma irq numbers instead of using
      the index.
      
      Cc: Tony Lindgren <tony@atomide.com>
      Acked-by: NKevin Hilman <khilman@deeprootsystems.com>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NHema HK <hemahk@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      fcf173e4
  3. 09 11月, 2010 1 次提交
    • A
      usb: musb: fail unaligned DMA transfers on v1.8 and above · 6e16edfe
      Anand Gadiyar 提交于
      The Inventra DMA engine in version 1.8 and later of the MUSB
      controller cannot handle DMA addresses that are not aligned
      to a 4 byte boundary. It ends up ignoring the last two bits
      programmed in the DMA_ADDR register. This is a deliberate
      design change in the controller and is documented in the
      programming guide.
      
      Earlier versions of the controller could handle these
      accesses just fine.
      
      Fail dma_channel_program if we see an unaligned address when
      using the newer controllers, so that the caller can carry out
      the transfer using PIO mode.
      (Current callers already have this backup path in place).
      Signed-off-by: NAnand Gadiyar <gadiyar@ti.com>
      Tested-by: NMing Lei <tom.leiming@gmail.com>
      Cc: Ajay Kumar Gupta <ajay.gupta@ti.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      6e16edfe
  4. 23 10月, 2010 1 次提交
  5. 11 8月, 2010 1 次提交
  6. 30 6月, 2010 1 次提交
  7. 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
  8. 03 3月, 2010 1 次提交
    • A
      usb: musb: workaround MUSB DMA_INTR sometimes reads zero · f933a0c0
      Anand Gadiyar 提交于
      MUSB DMA_INTR register may sometimes read zero when infact there
      was a pending interrupt. Workaround this by reading the DMA_COUNT
      values for all enabled channels when this condition occurs.
      Flag these channels as the ones needing to be serviced.
      
      Additionally, the absence of a debug print meant we would never
      catch a spurious DMA interrupt in MUSB. So this patch adds a
      debug print in the IRQ handler.
      Signed-off-by: NAnand Gadiyar <gadiyar@ti.com>
      Cc: Ajay Kumar Gupta <ajay.gupta@ti.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Vikram Pandita <vikram.pandita@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f933a0c0
  9. 12 12月, 2009 2 次提交
  10. 18 4月, 2009 2 次提交
    • 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
    • S
      USB: musb: bugfixes for multi-packet TXDMA support · c7bbc056
      Sergei Shtylyov 提交于
      We really want to use DMA mode 1 for all multi-packet transfers;
      that's one IRQ on DMA completion, instead of one per packet.
      
      There is an important issue with such transfers, especially on
      the host side:  when such transfers end with a full-size packet,
      we must defer musb_dma_completion() calls until the FIFO empties.
      Else we report URB completions too soon, and may clobber data in
      the FIFO fifo when writing the next packet (losing data).
      
      The Inventra DMA support uses DMA mode 1, but it ignores that
      issue.  The CPPI DMA support uses mode 0, but doesn't handle
      its TXPKTRDY interrupts quite right either; it can get stale
      "packet ready" interrupts, and report transfer completion too
      early using slightly different code paths, also losing data.
      
      So I'm solving it in a generic way -- by adding a sort of the
      "interrupt filter" into musb_host_tx(), catching these cases
      where a DMA completion IRQ doesn't suffice and removing some
      needlessly controller-specific logic.  When a TXDMA interrupt
      happens and DMA request mode 1 is active, that filter resets
      to mode 0 and defers URB completion processing until TXPKTRDY,
      unless the FIFO is already empty.  Related filtering logic in
      Inventra and CPPI code gets removed.
      
      Since it should be competely safe now to use the DMA request
      mode 1 for host side transfers with the CPPI DMA controller,
      set it in musb_h_tx_dma_start() ... now renamed (and shared).
      
      [ dbrownell@users.sourceforge.net: don't introduce more
      CamElCase; use more concise explanations ]
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Felipe Balbi <felipe.balbi@nokia.com>
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c7bbc056
  11. 08 1月, 2009 2 次提交
  12. 18 10月, 2008 1 次提交
  13. 14 8月, 2008 1 次提交