1. 15 Apr, 2016 1 commit
  2. 24 Aug, 2015 1 commit
    • Robert Jarzmik's avatar
      lib: scatterlist: add sg splitting function · f8bcbe62
      Robert Jarzmik authored
      Sometimes a scatter-gather has to be split into several chunks, or sub
      scatter lists. This happens for example if a scatter list will be
      handled by multiple DMA channels, each one filling a part of it.
      
      A concrete example comes with the media V4L2 API, where the scatter list
      is allocated from userspace to hold an image, regardless of the
      knowledge of how many DMAs will fill it :
       - in a simple RGB565 case, one DMA will pump data from the camera ISP
         to memory
       - in the trickier YUV422 case, 3 DMAs will pump data from the camera
         ISP pipes, one for pipe Y, one for pipe U and one for pipe V
      
      For these cases, it is necessary to split the original scatter list into
      multiple scatter lists, which is the purpose of this patch.
      
      The guarantees that are required for this patch are :
       - the intersection of spans of any couple of resulting scatter lists is
         empty.
       - the union of spans of all resulting scatter lists is a subrange of
         the span of the original scatter list.
       - streaming DMA API operations (mapping, unmapping) should not happen
         both on both the resulting and the original scatter list. It's either
         the first or the later ones.
       - the caller is reponsible to call kfree() on the resulting
         scatterlists.
      Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      f8bcbe62
  3. 17 Aug, 2015 1 commit
    • Christoph Hellwig's avatar
      scatterlist: allow limited chaining without ARCH_HAS_SG_CHAIN · 10c95ed9
      Christoph Hellwig authored
      There are a couple of uses of struct scatterlist that never go to
      the dma_map_sg() helper and thus don't care about ARCH_HAS_SG_CHAIN
      which indicates that we can map chained S/G list.
      
      The most important one is the crypto code, which currently has
      to open code a few helpers to always allow chaining.  This patch
      removes a few #ifdef ARCH_HAS_SG_CHAIN statements so that we can
      switch the crypto code to these common helpers.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      10c95ed9
  4. 01 Jul, 2015 2 commits
  5. 03 Jun, 2015 1 commit
    • Tom Lendacky's avatar
      scatterlist: introduce sg_nents_for_len · cfaed10d
      Tom Lendacky authored
      When performing a dma_map_sg() call, the number of sg entries to map is
      required. Using sg_nents to retrieve the number of sg entries will
      return the total number of entries in the sg list up to the entry marked
      as the end. If there happen to be unused entries in the list, these will
      still be counted. Some dma_map_sg() implementations will not handle the
      unused entries correctly (lib/swiotlb.c) and execute a BUG_ON.
      
      The sg_nents_for_len() function will traverse the sg list and return the
      number of entries required to satisfy the supplied length argument. This
      can then be supplied to the dma_map_sg() call to successfully map the
      sg.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      cfaed10d
  6. 05 May, 2015 1 commit
  7. 08 Aug, 2014 1 commit
  8. 25 Jul, 2014 1 commit
  9. 09 Dec, 2013 1 commit
  10. 09 Jul, 2013 1 commit
  11. 30 May, 2013 1 commit
  12. 27 Mar, 2013 1 commit
  13. 20 Mar, 2013 1 commit
  14. 28 Feb, 2013 2 commits
  15. 27 Sep, 2012 1 commit
  16. 30 Jul, 2012 1 commit
  17. 04 Mar, 2012 1 commit
    • Paul Gortmaker's avatar
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker authored
      If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
      other BUG variant in a static inline (i.e. not in a #define) then
      that header really should be including <linux/bug.h> and not just
      expecting it to be implicitly present.
      
      We can make this change risk-free, since if the files using these
      headers didn't have exposure to linux/bug.h already, they would have
      been causing compile failures/warnings.
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  18. 31 Jul, 2009 1 commit
  19. 23 Jul, 2008 1 commit
    • Tejun Heo's avatar
      sg: reimplement sg mapping iterator · 137d3edb
      Tejun Heo authored
      This is alternative implementation of sg content iterator introduced
      by commit 83e7d317... from Pierre Ossman in next-20080716.  As there's
      already an sg iterator which iterates over sg entries themselves, name
      this sg_mapping_iterator.
      
      Slightly edited description from the original implementation follows.
      
      Iteration over a sg list is not that trivial when you take into
      account that memory pages might have to be mapped before being used.
      Unfortunately, that means that some parts of the kernel restrict
      themselves to directly accesible memory just to not have to deal with
      the mess.
      
      This patch adds a simple iterator system that allows any code to
      easily traverse an sg list and not have to deal with all the details.
      The user can decide to consume part of the iteration.  Also, iteration
      can be stopped and resumed later if releasing the kmap between
      iteration steps is necessary.  These features are useful to implement
      piecemeal sg copying for interrupt drive PIO for example.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
      137d3edb
  20. 07 Apr, 2008 1 commit
  21. 28 Jan, 2008 2 commits
  22. 11 Jan, 2008 1 commit
  23. 27 Nov, 2007 1 commit
  24. 02 Nov, 2007 2 commits
  25. 29 Oct, 2007 3 commits
  26. 25 Oct, 2007 1 commit
    • Hugh Dickins's avatar
      fix sg_phys to use dma_addr_t · 85cdffcd
      Hugh Dickins authored
      x86_32 CONFIG_HIGHMEM64G with 5GB RAM hung when booting, after issuing
      some "request_module: runaway loop modprobe binfmt-0000" messages in
      trying to exec /sbin/init.
      
      The binprm buf doesn't see the right ".ELF" header because sg_phys()
      is providing the wrong physical addresses for high pages: a 32-bit
      unsigned long is too small in this case, we need to use dma_addr_t.
      Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      85cdffcd
  27. 24 Oct, 2007 1 commit
  28. 23 Oct, 2007 1 commit
  29. 22 Oct, 2007 3 commits
  30. 16 Oct, 2007 2 commits
  31. 21 Sep, 2006 1 commit