1. 12 6月, 2012 1 次提交
  2. 07 2月, 2012 4 次提交
  3. 14 10月, 2011 1 次提交
  4. 31 3月, 2011 1 次提交
  5. 24 2月, 2011 2 次提交
    • S
      ARM: Tegra: DMA: Fail safe if initialization fails · ccac0515
      Stephen Warren 提交于
      tegra_dma_init currently simply bails out early if any initialization fails.
      This skips various data-structure initialization. In turn, this means that
      tegra_dma_allocate_channel can still hand out channels. In this case, when
      tegra_dma_free_channel is called, which calls tegra_dma_cancel, the walking
      on ch->list will OOPS since the list's next/prev pointers may still be
      NULL.
      
      To solve this, add an explicit "initialized" flag, only set this once _init
      has fully completed successfully, and have _allocate_channel refuse to hand
      out channels if this is not set.
      
      While at it, simplify _init:
      * Remove redundant memsets
      * Use bitmap_fill to mark all channels as in-use up-front, and remove
        some now-redundant bitmap initialization loops.
      * Only mark a channel as free once all channel-related initialization has
        completed.
      
      Finally, the successful exit path from _init always has ret==0, so just
      hard-code that return. The error path still returns ret.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NColin Cross <ccross@android.com>
      ccac0515
    • S
      ARM: Tegra: Make tegra_dma_init a postcore_initcall · dc54c23b
      Stephen Warren 提交于
      The following commit makes the Tegra APB DMA engine fail to initialize
      correctly: 0cf6230a
      ARM: tegra: Move tegra_common_init to tegra_init_early
      
      The reason is that tegra_init_early_ calls tegra_dma_init which calls
      request_threaded_irq, which fails since the IRQ hasn't yet been marked
      valid; that only happens in tegra_init_irq, which gets called after
      tegra_init_early.
      
      This used to work OK, since tegra_init_early was tegra_common_init, which
      got called after tegra_init_irq, basically from the beginning of
      tegra_harmony_init.
      
      Solve this by converting tegra_dma_init to a postcore_initcall. This makes
      it execute late enough that IRQs are marked valid, and avoids having to
      add it back to every machine's init function.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NColin Cross <ccross@android.com>
      dc54c23b
  6. 21 2月, 2011 1 次提交
  7. 20 2月, 2011 1 次提交
    • S
      ARM: tegra: Prevent requeuing in-progress DMA requests · 499ef7a5
      Stephen Warren 提交于
      If a request already in the queue is passed to tegra_dma_enqueue_req,
      tegra_dma_req.node->{next,prev} will end up pointing to itself instead
      of at tegra_dma_channel.list, which is the way a the end-of-list
      should be set up. When the DMA request completes and is list_del'd,
      the list head will still point at it, yet the node's next/prev will
      contain the list poison values. When the next DMA request completes,
      a kernel panic will occur when those poison values are dereferenced.
      
      This makes the DMA driver more robust in the face of buggy clients.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NColin Cross <ccross@android.com>
      499ef7a5
  8. 11 2月, 2011 1 次提交
    • C
      ARM: tegra: dma: Fix critical data corruption bugs · 5789fee9
      Colin Cross 提交于
      Sometimes, due to high interrupt latency in the continuous mode
      of DMA transfer, the half buffer complete interrupt is handled
      after DMA has transferred the full buffer.  When this is detected,
      stop DMA immediately and restart with the next buffer if the next
      buffer is ready.
      
      originally fixed by Victor(Weiguo) Pan <wpan@nvidia.com>
      
      In place of using the simple spin_lock()/spi_unlock() in the
      interrupt thread, using the spin_lock_irqsave() and
      spin_unlock_irqrestore(). The lock is shared between the normal
      process context and interrupt context.
      
      originally fixed by Laxman Dewangan (ldewangan@nvidia.com)
      
      The use of shadow registers caused memory corruption at physical
      address 0 because the enable bit was not shadowed, and assuming it
      needed to be set would enable an unconfigured dma block.  Most of the
      register accesses don't need to know the previous state of the
      registers, and the few places that do need to modify only a few bits
      in the registers are the same ones that were sometimes incorrectly
      setting the enable bit.  This patch convert tegra_dma_update_hardware
      to set the entire register, and the other users to read-modify-write,
      and drops the shadow registers completely.
      
      Also fixes missing locking in tegra_dma_allocate_channel
      Signed-off-by: NColin Cross <ccross@android.com>
      5789fee9
  9. 10 2月, 2011 1 次提交
  10. 22 10月, 2010 1 次提交
    • C
      [ARM] tegra: Add APB DMA support · 4de3a8fa
      Colin Cross 提交于
      The APB DMA block handles DMA transfers to and from some peripherals
      in the Tegra SOC.  It reads from sequential addresses on the memory
      bus, and writes repeatedly to the same address on the APB bus.
      
      Two transfer modes are supported, oneshot for transferring a known
      size to or from a peripheral, and continuous for streaming data.
      In continuous mode, a callback occurs when the buffer is half full
      to allow the existing data to be handled and a new request queued.x
      
      v2 changes:
      	dma API no longer uses PTR_ERR
      Signed-off-by: NErik Gilling <konkers@android.com>
      Signed-off-by: NColin Cross <ccross@android.com>
      4de3a8fa