1. 20 11月, 2009 2 次提交
  2. 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
  3. 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
  4. 13 5月, 2009 1 次提交
  5. 09 4月, 2009 1 次提交
  6. 27 3月, 2009 1 次提交
  7. 26 3月, 2009 2 次提交
  8. 19 2月, 2009 1 次提交
  9. 20 1月, 2009 1 次提交
  10. 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
  11. 07 1月, 2009 13 次提交
  12. 06 1月, 2009 1 次提交
  13. 04 12月, 2008 1 次提交
  14. 12 11月, 2008 1 次提交
  15. 09 7月, 2008 4 次提交
    • H
      dmaengine: Add slave DMA interface · dc0ee643
      Haavard Skinnemoen 提交于
      This patch adds the necessary interfaces to the DMA Engine framework
      to use functionality found on most embedded DMA controllers: DMA from
      and to I/O registers with hardware handshaking.
      
      In this context, hardware hanshaking means that the peripheral that
      owns the I/O registers in question is able to tell the DMA controller
      when more data is available for reading, or when there is room for
      more data to be written. This usually happens internally on the chip,
      but these signals may also be exported outside the chip for things
      like IDE DMA, etc.
      
      A new struct dma_slave is introduced. This contains information that
      the DMA engine driver needs to set up slave transfers to and from a
      slave device. Most engines supporting DMA slave transfers will want to
      extend this structure with controller-specific parameters.  This
      additional information is usually passed from the platform/board code
      through the client driver.
      
      A "slave" pointer is added to the dma_client struct. This must point
      to a valid dma_slave structure iff the DMA_SLAVE capability is
      requested.  The DMA engine driver may use this information in its
      device_alloc_chan_resources hook to configure the DMA controller for
      slave transfers from and to the given slave device.
      
      A new operation for preparing slave DMA transfers is added to struct
      dma_device. This takes a scatterlist and returns a single descriptor
      representing the whole transfer.
      
      Another new operation for terminating all pending transfers is added as
      well. The latter is needed because there may be errors outside the scope
      of the DMA Engine framework that may require DMA operations to be
      terminated prematurely.
      
      DMA Engine drivers may extend the dma_device, dma_chan and/or
      dma_slave_descriptor structures to allow controller-specific
      operations. The client driver can detect such extensions by looking at
      the DMA Engine's struct device, or it can request a specific DMA
      Engine device by setting the dma_dev field in struct dma_slave.
      
      dmaslave interface changes since v4:
        * Fix checkpatch errors
        * Fix changelog (there are no slave descriptors anymore)
      
      dmaslave interface changes since v3:
        * Use dma_data_direction instead of a new enum
        * Submit slave transfers as scatterlists
        * Remove the DMA slave descriptor struct
      
      dmaslave interface changes since v2:
        * Add a dma_dev field to struct dma_slave. If set, the client can
          only be bound to the DMA controller that corresponds to this
          device.  This allows controller-specific extensions of the
          dma_slave structure; if the device matches, the controller may
          safely assume its extensions are present.
        * Move reg_width into struct dma_slave as there are currently no
          users that need to be able to set the width on a per-transfer
          basis.
      
      dmaslave interface changes since v1:
        * Drop the set_direction and set_width descriptor hooks. Pass the
          direction and width to the prep function instead.
        * Declare a dma_slave struct with fixed information about a slave,
          i.e. register addresses, handshake interfaces and such.
        * Add pointer to a dma_slave struct to dma_client. Can be NULL if
          the DMA_SLAVE capability isn't requested.
        * Drop the set_slave device hook since the alloc_chan_resources hook
          now has enough information to set up the channel for slave
          transfers.
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      dc0ee643
    • H
      dmaengine: Add dma_client parameter to device_alloc_chan_resources · 848c536a
      Haavard Skinnemoen 提交于
      A DMA controller capable of doing slave transfers may need to know a
      few things about the slave when preparing the channel. We don't want
      to add this information to struct dma_channel since the channel hasn't
      yet been bound to a client at this point.
      
      Instead, pass a reference to the client requesting the channel to the
      driver's device_alloc_chan_resources hook so that it can pick the
      necessary information from the dma_client struct by itself.
      
      [dan.j.williams@intel.com: fixed up fsldma and mv_xor]
      Acked-by: NMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      848c536a
    • D
      dmaengine: track the number of clients using a channel · 7cc5bf9a
      Dan Williams 提交于
      Haavard's dma-slave interface would like to test for exclusive access to a
      channel.  The standard channel refcounting is not sufficient in that it
      tracks more than just client references, it is also inaccurate as reference
      counts are percpu until the channel is removed.
      
      This change also enables a future fix to deallocate resources when a client
      declines to use a capable channel.
      Acked-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      7cc5bf9a
    • H
      dmaengine: Couple DMA channels to their physical DMA device · 1099dc79
      Haavard Skinnemoen 提交于
      Set the 'parent' field of channel class devices to point to the
      physical DMA device initialized by the DMA engine driver.
      
      This allows drivers to use chan->dev.parent for syncing DMA buffers
      and adds a 'device' symlink to the real device in
      /sys/class/dma/dmaXchanY.
      Signed-off-by: NHaavard Skinnemoen <hskinnemoen@atmel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      1099dc79
  16. 22 4月, 2008 1 次提交
  17. 18 4月, 2008 3 次提交
  18. 14 3月, 2008 1 次提交
  19. 07 2月, 2008 1 次提交
    • D
      async_tx: kill tx_set_src and tx_set_dest methods · 0036731c
      Dan Williams 提交于
      The tx_set_src and tx_set_dest methods were originally implemented to allow
      an array of addresses to be passed down from async_xor to the dmaengine
      driver while minimizing stack overhead.  Removing these methods allows
      drivers to have all transaction parameters available at 'prep' time, saves
      two function pointers in struct dma_async_tx_descriptor, and reduces the
      number of indirect branches..
      
      A consequence of moving this data to the 'prep' routine is that
      multi-source routines like async_xor need temporary storage to convert an
      array of linear addresses into an array of dma addresses.  In order to keep
      the same stack footprint of the previous implementation the input array is
      reused as storage for the dma addresses.  This requires that
      sizeof(dma_addr_t) be less than or equal to sizeof(void *).  As a
      consequence CONFIG_DMADEVICES now depends on !CONFIG_HIGHMEM64G.  It also
      requires that drivers be able to make descriptor resources available when
      the 'prep' routine is polled.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NShannon Nelson <shannon.nelson@intel.com>
      0036731c