1. 07 1月, 2013 1 次提交
    • J
      dmaengine: add helper function to request a slave DMA channel · 9a6cecc8
      Jon Hunter 提交于
      Currently slave DMA channels are requested by calling dma_request_channel()
      and requires DMA clients to pass various filter parameters to obtain the
      appropriate channel.
      
      With device-tree being used by architectures such as arm and the addition of
      device-tree helper functions to extract the relevant DMA client information
      from device-tree, add a new function to request a slave DMA channel using
      device-tree. This function is currently a simple wrapper that calls the
      device-tree of_dma_request_slave_channel() function.
      
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Stephen Warren <swarren@nvidia.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Dan Williams <djbw@fb.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Reviewed-by: NStephen Warren <swarren@wwwdotorg.org>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      9a6cecc8
  2. 06 10月, 2012 1 次提交
  3. 20 7月, 2012 1 次提交
  4. 06 4月, 2012 1 次提交
  5. 06 3月, 2012 1 次提交
  6. 18 11月, 2011 1 次提交
    • J
      DMAEngine: Define interleaved transfer request api · b14dab79
      Jassi Brar 提交于
      Define a new api that could be used for doing fancy data transfers
      like interleaved to contiguous copy and vice-versa.
      Traditional SG_list based transfers tend to be very inefficient in
      such cases as where the interleave and chunk are only a few bytes,
      which call for a very condensed api to convey pattern of the transfer.
      This api supports all 4 variants of scatter-gather and contiguous transfer.
      
      Of course, neither can this api help transfers that don't lend to DMA by
      nature, i.e, scattered tiny read/writes with no periodic pattern.
      
      Also since now we support SLAVE channels that might not provide
      device_prep_slave_sg callback but device_prep_interleaved_dma,
      remove the BUG_ON check.
      Signed-off-by: NJassi Brar <jaswinder.singh@linaro.org>
      Acked-by: NBarry Song <Baohua.Song@csr.com>
      [renamed dmaxfer_template to dma_interleaved_template
       did fixup after the enum dma_transfer_merge]
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      b14dab79
  7. 04 8月, 2011 1 次提交
  8. 24 6月, 2011 1 次提交
  9. 22 6月, 2011 1 次提交
    • A
      net: remove mm.h inclusion from netdevice.h · b7f080cf
      Alexey Dobriyan 提交于
      Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).
      
      To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
      definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
      via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
      Removal of mm.h from scatterlist.h was tried and was found not feasible
      on most archs, so the link was cutoff earlier.
      
      Hope people are OK with tiny include file.
      
      Note, that mm_types.h is still dragged in, but it is a separate story.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7f080cf
  10. 08 10月, 2010 2 次提交
  11. 06 10月, 2010 1 次提交
    • S
      dmaengine: add possibility for cyclic transfers · 782bc950
      Sascha Hauer 提交于
      Cyclic transfers are useful for audio where a single buffer divided
      in periods has to be transfered endlessly until stopped. After being
      prepared the transfer is started using the dma_async_descriptor->tx_submit
      function. dma_async_descriptor->callback is called after each period.
      The transfer is stopped using the DMA_TERMINATE_ALL callback.
      While being used for cyclic transfers the channel cannot be used
      for other transfer types.
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      782bc950
  12. 18 5月, 2010 1 次提交
  13. 17 5月, 2010 1 次提交
    • J
      DMA ENGINE: Do not reset 'private' of channel · cc05ea0c
      Jassi Brar 提交于
      The member 'private' of 'struct dma_chan' is meant for passing
      data between client and the controller driver.
      
      The DMA client driver may point it to platform specific stuff after
      acquiring the channel. So, it is the responsiblity of the same code
      to reset it, if it must.
      
      The DMA engine doesn't set it and hence, shouldn't reset it either.
      
      This reseting of private by DMA Engine comes in the way of implementing
      default channel settings during DMAC probe. That capability is useful
      for not having the clients to always provide platform specific data,
      like Rx/Tx FIFO addresses, which usually doesn't change across channel
      requests.
      Signed-off-by: NJassi Brar <jassi.brar@samsung.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      cc05ea0c
  14. 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
  15. 27 3月, 2010 2 次提交
    • L
      DMAENGINE: generic channel status v2 · 07934481
      Linus Walleij 提交于
      Convert the device_is_tx_complete() operation on the
      DMA engine to a generic device_tx_status()operation which
      can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE,
      DMA_TX_PAUSED.
      
      [dan.j.williams@intel.com: update for timberdale]
      Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Cc: Magnus Damm <damm@opensource.se>
      Cc: Liam Girdwood <lrg@slimlogic.co.uk>
      Cc: Joe Perches <joe@perches.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      07934481
    • L
      DMAENGINE: generic slave control v2 · c3635c78
      Linus Walleij 提交于
      Convert the device_terminate_all() operation on the
      DMA engine to a generic device_control() operation
      which can now optionally support also pausing and
      resuming DMA on a certain channel. Implemented for the
      COH 901 318 DMAC as an example.
      
      [dan.j.williams@intel.com: update for timberdale]
      Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Cc: Magnus Damm <damm@opensource.se>
      Cc: Liam Girdwood <lrg@slimlogic.co.uk>
      Cc: Joe Perches <joe@perches.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      c3635c78
  16. 17 2月, 2010 1 次提交
    • T
      percpu: add __percpu sparse annotations to what's left · a29d8b8e
      Tejun Heo 提交于
      Add __percpu sparse annotations to places which didn't make it in one
      of the previous patches.  All converions are trivial.
      
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NBorislav Petkov <borislav.petkov@amd.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Neil Brown <neilb@suse.de>
      a29d8b8e
  17. 03 2月, 2010 1 次提交
  18. 20 11月, 2009 2 次提交
  19. 03 10月, 2009 1 次提交
  20. 09 9月, 2009 2 次提交
    • D
      dmaengine: kill tx_list · 08031727
      Dan Williams 提交于
      The tx_list attribute of struct dma_async_tx_descriptor is common to
      most, but not all dma driver implementations.  None of the upper level
      code (dmaengine/async_tx) uses it, so allow drivers to implement it
      locally if they need it.  This saves sizeof(struct list_head) bytes for
      drivers that do not manage descriptors with a linked list (e.g.: ioatdma
      v2,3).
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      
      08031727
    • D
      dmaengine, async_tx: add a "no channel switch" allocator · 138f4c35
      Dan Williams 提交于
      Channel switching is problematic for some dmaengine drivers as the
      architecture precludes separating the ->prep from ->submit.  In these
      cases the driver can select ASYNC_TX_DISABLE_CHANNEL_SWITCH to modify
      the async_tx allocator to only return channels that support all of the
      required asynchronous operations.
      
      For example MD_RAID456=y selects support for asynchronous xor, xor
      validate, pq, pq validate, and memcpy.  When
      ASYNC_TX_DISABLE_CHANNEL_SWITCH=y any channel with all these
      capabilities is marked DMA_ASYNC_TX allowing async_tx_find_channel() to
      quickly locate compatible channels with the guarantee that dependency
      chains will remain on one channel.  When
      ASYNC_TX_DISABLE_CHANNEL_SWITCH=n async_tx_find_channel() may select
      channels that lead to operation chains that need to cross channel
      boundaries using the async_tx channel switch capability.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      138f4c35
  21. 30 8月, 2009 2 次提交
    • D
      async_tx: add support for asynchronous GF multiplication · b2f46fd8
      Dan Williams 提交于
      [ Based on an original patch by Yuri Tikhonov ]
      
      This adds support for doing asynchronous GF multiplication by adding
      two additional functions to the async_tx API:
      
       async_gen_syndrome() does simultaneous XOR and Galois field
          multiplication of sources.
      
       async_syndrome_val() validates the given source buffers against known P
          and Q values.
      
      When a request is made to run async_pq against more than the hardware
      maximum number of supported sources we need to reuse the previous
      generated P and Q values as sources into the next operation.  Care must
      be taken to remove Q from P' and P from Q'.  For example to perform a 5
      source pq op with hardware that only supports 4 sources at a time the
      following approach is taken:
      
      p, q = PQ(src0, src1, src2, src3, COEF({01}, {02}, {04}, {08}))
      p', q' = PQ(p, q, q, src4, COEF({00}, {01}, {00}, {10}))
      
      p' = p + q + q + src4 = p + src4
      q' = {00}*p + {01}*q + {00}*q + {10}*src4 = q + {10}*src4
      
      Note: 4 is the minimum acceptable maxpq otherwise we punt to
      synchronous-software path.
      
      The DMA_PREP_CONTINUE flag indicates to the driver to reuse p and q as
      sources (in the above manner) and fill the remaining slots up to maxpq
      with the new sources/coefficients.
      
      Note1: Some devices have native support for P+Q continuation and can skip
      this extra work.  Devices with this capability can advertise it with
      dma_set_maxpq.  It is up to each driver how to handle the
      DMA_PREP_CONTINUE flag.
      
      Note2: The api supports disabling the generation of P when generating Q,
      this is ignored by the synchronous path but is implemented by some dma
      devices to save unnecessary writes.  In this case the continuation
      algorithm is simplified to only reuse Q as a source.
      
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NYuri Tikhonov <yur@emcraft.com>
      Signed-off-by: NIlya Yanok <yanok@emcraft.com>
      Reviewed-by: NAndre Noll <maan@systemlinux.org>
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      b2f46fd8
    • D
      async_tx: remove walk of tx->parent chain in dma_wait_for_async_tx · 95475e57
      Dan Williams 提交于
      We currently walk the parent chain when waiting for a given tx to
      complete however this walk may race with the driver cleanup routine.
      The routines in async_raid6_recov.c may fall back to the synchronous
      path at any point so we need to be prepared to call async_tx_quiesce()
      (which calls  dma_wait_for_async_tx).  To remove the ->parent walk we
      guarantee that every time a dependency is attached ->issue_pending() is
      invoked, then we can simply poll the initial descriptor until
      completion.
      
      This also allows for a lighter weight 'issue pending' implementation as
      there is no longer a requirement to iterate through all the channels'
      ->issue_pending() routines as long as operations have been submitted in
      an ordered chain.  async_tx_issue_pending() is added for this case.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      95475e57
  22. 13 5月, 2009 1 次提交
  23. 09 4月, 2009 1 次提交
  24. 27 3月, 2009 1 次提交
  25. 26 3月, 2009 2 次提交
  26. 19 2月, 2009 1 次提交
  27. 20 1月, 2009 1 次提交
  28. 13 1月, 2009 1 次提交
    • Y
      dmaengine: fix dependency chaining · dd59b853
      Yuri Tikhonov 提交于
      In dmaengine we track the dependencies between the descriptors
      using the 'next' pointers of the structure. These pointers are
      set to NULL as soon as the corresponding descriptor has been
      submitted to the channel (in dma_run_dependencies()).
      
      But, the first 'next' in chain is still remaining set, regardless
      the fact, that tx->next has been already submitted. This may lead to
      multiple submissions of the same descriptor. This patch fixes this.
      
      Actually, some previous implementation of the xxx_run_dependencies()
      function already had this fix in place. The fdb..0eaf3 commit, beside the
      correct things, broke this.
      
      Cc: <stable@kernel.org>
      Signed-off-by: NYuri Tikhonov <yur@emcraft.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      dd59b853
  29. 07 1月, 2009 6 次提交