Skip to content
Snippets Groups Projects
  1. Dec 17, 2009
  2. Nov 19, 2009
    • Dan Williams's avatar
      async_tx: build-time toggling of async_{syndrome,xor}_val dma support · 7b3cc2b1
      Dan Williams authored
      
      ioat3.2 does not support asynchronous error notifications which makes
      the driver experience latencies when non-zero pq validate results are
      expected.  Provide a mechanism for turning off async_xor_val and
      async_syndrome_val via Kconfig.  This approach is generally useful for
      any driver that specifies ASYNC_TX_DISABLE_CHANNEL_SWITCH and would like
      to force the async_tx api to fall back to the synchronous path for
      certain operations.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      7b3cc2b1
  3. Oct 20, 2009
    • Dan Williams's avatar
      async_tx: fix asynchronous raid6 recovery for ddf layouts · da17bf43
      Dan Williams authored
      
      The raid6 recovery code currently requires special handling of the
      4-disk and 5-disk recovery scenarios for the native layout.  Quoting
      from commit 0a82a623:
      
           In these situations the default N-disk algorithm will present
           0-source or 1-source operations to dma devices.  To cover for
           dma devices where the minimum source count is 2 we implement
           4-disk and 5-disk handling in the recovery code.
      
      The ddf layout presents disks=6 and disks=7 to the recovery code in
      these situations.  Instead of looking at the number of disks count the
      number of non-zero sources in the list and call the special case code
      when the number of non-failed sources is 0 or 1.
      
      [neilb@suse.de: replace 'ddf' flag with counting good sources]
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      da17bf43
    • Dan Williams's avatar
      async_pq: rename scribble page · 030b0772
      Dan Williams authored
      
      The global scribble page is used as a temporary destination buffer when
      disabling the P or Q result is requested.  The local scribble buffer
      contains memory for performing address conversions.  Rename the global
      variable to avoid confusion.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      
      
      030b0772
  4. Oct 19, 2009
  5. Oct 15, 2009
    • NeilBrown's avatar
      raid6/async_tx: handle holes in block list in async_syndrome_val · b2141e69
      NeilBrown authored
      
      async_syndrome_val check the P and Q blocks used for RAID6
      calculations.
      With DDF raid6, some of the data blocks might be NULL, so
      this needs to be handled in the same way that async_gen_syndrome
      handles it.
      
      As async_syndrome_val calls async_xor, also enhance async_xor
      to detect and skip NULL blocks in the list.
      
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      b2141e69
    • NeilBrown's avatar
      md/async: don't pass a memory pointer as a page pointer. · 5dd33c9a
      NeilBrown authored
      
      md/raid6 passes a list of 'struct page *' to the async_tx routines,
      which then either DMA map them for offload, or take the page_address
      for CPU based calculations.
      
      For RAID6 we sometime leave 'blanks' in the list of pages.
      For CPU based calcs, we want to treat theses as a page of zeros.
      For offloaded calculations, we simply don't pass a page to the
      hardware.
      
      Currently the 'blanks' are encoded as a pointer to
      raid6_empty_zero_page.  This is a 4096 byte memory region, not a
      'struct page'.  This is mostly handled correctly but is rather ugly.
      
      So change the code to pass and expect a NULL pointer for the blanks.
      When taking page_address of a page, we need to check for a NULL and
      in that case use raid6_empty_zero_page.
      
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      5dd33c9a
  6. Sep 21, 2009
  7. Sep 16, 2009
    • Dan Williams's avatar
      raid6test: fix stack overflow · 1b6df693
      Dan Williams authored
      
      Testing on x86_64 with NDISKS=255 yields:
      
         do_IRQ: modprobe near stack overflow (cur:ffff88007d19c000,sp:ffff88007d19c128)
      
      ...and eventually
      
         general protection fault: 0000 [#1]
      
      Moving the scribble buffers off the stack allows the test to complete
      successfully.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      1b6df693
  8. Sep 08, 2009
    • Dan Williams's avatar
      dmaengine, async_tx: support alignment checks · 83544ae9
      Dan Williams authored
      
      Some engines have transfer size and address alignment restrictions.  Add
      a per-operation alignment property to struct dma_device that the async
      routines and dmatest can use to check alignment capabilities.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      83544ae9
    • Dan Williams's avatar
      dmaengine, async_tx: add a "no channel switch" allocator · 138f4c35
      Dan Williams authored
      
      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: default avatarDan Williams <dan.j.williams@intel.com>
      138f4c35
    • Dan Williams's avatar
      dmaengine: add fence support · 0403e382
      Dan Williams authored
      
      Some engines optimize operation by reading ahead in the descriptor chain
      such that descriptor2 may start execution before descriptor1 completes.
      If descriptor2 depends on the result from descriptor1 then a fence is
      required (on descriptor2) to disable this optimization.  The async_tx
      api could implicitly identify dependencies via the 'depend_tx'
      parameter, but that would constrain cases where the dependency chain
      only specifies a completion order rather than a data dependency.  So,
      provide an ASYNC_TX_FENCE to explicitly identify data dependencies.
      
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      0403e382
  9. Aug 29, 2009
    • Dan Williams's avatar
      async_tx: raid6 recovery self test · cb3c8299
      Dan Williams authored
      
      Port drivers/md/raid6test/test.c to use the async raid6 recovery
      routines.  This is meant as a unit test for raid6 acceleration drivers.  In
      addition to the 16-drive test case this implements tests for the 4-disk and
      5-disk special cases (dma devices can not generically handle less than 2
      sources), and adds a test for the D+Q case.
      
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      
      cb3c8299
    • Dan Williams's avatar
      async_tx: add support for asynchronous RAID6 recovery operations · 0a82a623
      Dan Williams authored
      
       async_raid6_2data_recov() recovers two data disk failures
      
       async_raid6_datap_recov() recovers a data disk and the P disk
      
      These routines are a port of the synchronous versions found in
      drivers/md/raid6recov.c.  The primary difference is breaking out the xor
      operations into separate calls to async_xor.  Two helper routines are
      introduced to perform scalar multiplication where needed.
      async_sum_product() multiplies two sources by scalar coefficients and
      then sums (xor) the result.  async_mult() simply multiplies a single
      source by a scalar.
      
      This implemention also includes, in contrast to the original
      synchronous-only code, special case handling for the 4-disk and 5-disk
      array cases.  In these situations the default N-disk algorithm will
      present 0-source or 1-source operations to dma devices.  To cover for
      dma devices where the minimum source count is 2 we implement 4-disk and
      5-disk handling in the recovery code.
      
      [ Impact: asynchronous raid6 recovery routines for 2data and datap cases ]
      
      Cc: Yuri Tikhonov <yur@emcraft.com>
      Cc: Ilya Yanok <yanok@emcraft.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      
      0a82a623
    • Dan Williams's avatar
      async_tx: add support for asynchronous GF multiplication · b2f46fd8
      Dan Williams authored
      
      [ 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: default avatarYuri Tikhonov <yur@emcraft.com>
      Signed-off-by: default avatarIlya Yanok <yanok@emcraft.com>
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      b2f46fd8
    • Dan Williams's avatar
      async_tx: remove walk of tx->parent chain in dma_wait_for_async_tx · 95475e57
      Dan Williams authored
      
      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: default avatarDan Williams <dan.j.williams@intel.com>
      95475e57
    • Dan Williams's avatar
      async_tx: kill needless module_{init|exit} · af1f951e
      Dan Williams authored
      
      If module_init and module_exit are nops then neither need to be defined.
      
      [ Impact: pure cleanup ]
      
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      af1f951e
    • Dan Williams's avatar
      async_tx: add sum check flags · ad283ea4
      Dan Williams authored
      
      Replace the flat zero_sum_result with a collection of flags to contain
      the P (xor) zero-sum result, and the soon to be utilized Q (raid6 reed
      solomon syndrome) zero-sum result.  Use the SUM_CHECK_ namespace instead
      of DMA_ since these flags will be used on non-dma-zero-sum enabled
      platforms.
      
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      ad283ea4
  10. Jul 01, 2009
  11. Jun 03, 2009
    • Dan Williams's avatar
      async_xor: permit callers to pass in a 'dma/page scribble' region · 04ce9ab3
      Dan Williams authored
      
      async_xor() needs space to perform dma and page address conversions.  In
      most cases the code can simply reuse the struct page * array because the
      size of the native pointer matches the size of a dma/page address.  In
      order to support archs where sizeof(dma_addr_t) is larger than
      sizeof(struct page *), or to preserve the input parameters, we utilize a
      memory region passed in by the caller.
      
      Since the code is now prepared to handle the case where it cannot
      perform address conversions on the stack, we no longer need the
      !HIGHMEM64G dependency in drivers/dma/Kconfig.
      
      [ Impact: don't clobber input buffers for address conversions ]
      
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      04ce9ab3
    • Dan Williams's avatar
      async_tx: structify submission arguments, add scribble · a08abd8c
      Dan Williams authored
      
      Prepare the api for the arrival of a new parameter, 'scribble'.  This
      will allow callers to identify scratchpad memory for dma address or page
      address conversions.  As this adds yet another parameter, take this
      opportunity to convert the common submission parameters (flags,
      dependency, callback, and callback argument) into an object that is
      passed by reference.
      
      Also, take this opportunity to fix up the kerneldoc and add notes about
      the relevant ASYNC_TX_* flags for each routine.
      
      [ Impact: moves api pass-by-value parameters to a pass-by-reference struct ]
      
      Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      a08abd8c
    • Dan Williams's avatar
      async_tx: kill ASYNC_TX_DEP_ACK flag · 88ba2aa5
      Dan Williams authored
      
      In support of inter-channel chaining async_tx utilizes an ack flag to
      gate whether a dependent operation can be chained to another.  While the
      flag is not set the chain can be considered open for appending.  Setting
      the ack flag closes the chain and flags the descriptor for garbage
      collection.  The ASYNC_TX_DEP_ACK flag essentially means "close the
      chain after adding this dependency".  Since each operation can only have
      one child the api now implicitly sets the ack flag at dependency
      submission time.  This removes an unnecessary management burden from
      clients of the api.
      
      [ Impact: clean up and enforce one dependency per operation ]
      
      Reviewed-by: default avatarAndre Noll <maan@systemlinux.org>
      Acked-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      88ba2aa5
  12. Apr 08, 2009
  13. Mar 25, 2009
  14. Jan 06, 2009
  15. Jan 05, 2009
  16. Dec 08, 2008
    • Dan Williams's avatar
      async_xor: dma_map destination DMA_BIDIRECTIONAL · a06d568f
      Dan Williams authored
      
      Mapping the destination multiple times is a misuse of the dma-api.
      Since the destination may be reused as a source, ensure that it is only
      mapped once and that it is mapped bidirectionally.  This appears to add
      ugliness on the unmap side in that it always reads back the destination
      address from the descriptor, but gcc can determine that dma_unmap is a
      nop and not emit the code that calculates its arguments.
      
      Cc: <stable@kernel.org>
      Cc: Saeed Bishara <saeed@marvell.com>
      Acked-by: default avatarYuri Tikhonov <yur@emcraft.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      a06d568f
  17. Sep 13, 2008
  18. Sep 05, 2008
  19. Aug 05, 2008
  20. Jul 17, 2008
  21. Jul 08, 2008
Loading