1. 07 Sep, 2017 3 commits
  2. 15 Jun, 2017 1 commit
  3. 15 Apr, 2016 1 commit
  4. 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
       - 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
      Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
  5. 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>
  6. 01 Jul, 2015 2 commits
  7. 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
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  8. 05 May, 2015 1 commit
  9. 08 Aug, 2014 1 commit
  10. 25 Jul, 2014 1 commit
  11. 09 Dec, 2013 1 commit
  12. 09 Jul, 2013 1 commit
  13. 30 May, 2013 1 commit
  14. 27 Mar, 2013 1 commit
  15. 20 Mar, 2013 1 commit
  16. 28 Feb, 2013 2 commits
  17. 27 Sep, 2012 1 commit
  18. 30 Jul, 2012 1 commit
  19. 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>
  20. 31 Jul, 2009 1 commit
  21. 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>
  22. 07 Apr, 2008 1 commit
  23. 28 Jan, 2008 2 commits
  24. 11 Jan, 2008 1 commit
  25. 27 Nov, 2007 1 commit
  26. 02 Nov, 2007 2 commits
  27. 29 Oct, 2007 3 commits
  28. 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>
  29. 24 Oct, 2007 1 commit
  30. 23 Oct, 2007 1 commit
  31. 22 Oct, 2007 2 commits
    • Jens Axboe's avatar
      Add CONFIG_DEBUG_SG sg validation · d6ec0842
      Jens Axboe authored
      Add a Kconfig entry which will toggle some sanity checks on the sg
      entry and tables.
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    • Jens Axboe's avatar
      Change table chaining layout · 18dabf47
      Jens Axboe authored
      Change the page member of the scatterlist structure to be an unsigned
      long, and encode more stuff in the lower bits:
      - Bits 0 and 1 zero: this is a normal sg entry. Next sg entry is located
        at sg + 1.
      - Bit 0 set: this is a chain entry, the next real entry is at ->page_link
        with the two low bits masked off.
      - Bit 1 set: this is the final entry in the sg entry. sg_next() will return
        NULL when passed such an entry.
      It's thus important that sg table users use the proper accessors to get
      and set the page member.
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>