1. 25 8月, 2015 1 次提交
    • R
      lib: scatterlist: add sg splitting function · f8bcbe62
      Robert Jarzmik 提交于
      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: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f8bcbe62
  2. 17 8月, 2015 1 次提交
  3. 01 7月, 2015 2 次提交
  4. 03 6月, 2015 1 次提交
    • T
      scatterlist: introduce sg_nents_for_len · cfaed10d
      Tom Lendacky 提交于
      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: NTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      cfaed10d
  5. 06 5月, 2015 1 次提交
  6. 09 8月, 2014 1 次提交
  7. 26 7月, 2014 1 次提交
  8. 09 12月, 2013 1 次提交
  9. 10 7月, 2013 1 次提交
  10. 30 5月, 2013 1 次提交
  11. 28 3月, 2013 1 次提交
  12. 20 3月, 2013 1 次提交
  13. 28 2月, 2013 2 次提交
  14. 27 9月, 2012 1 次提交
  15. 30 7月, 2012 1 次提交
  16. 05 3月, 2012 1 次提交
    • P
      BUG: headers with BUG/BUG_ON etc. need linux/bug.h · 187f1882
      Paul Gortmaker 提交于
      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: NPaul Gortmaker <paul.gortmaker@windriver.com>
      187f1882
  17. 31 7月, 2009 1 次提交
  18. 23 7月, 2008 1 次提交
    • T
      sg: reimplement sg mapping iterator · 137d3edb
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
      137d3edb
  19. 08 4月, 2008 1 次提交
  20. 28 1月, 2008 2 次提交
  21. 11 1月, 2008 1 次提交
  22. 27 11月, 2007 1 次提交
  23. 02 11月, 2007 2 次提交
  24. 29 10月, 2007 3 次提交
  25. 25 10月, 2007 1 次提交
    • H
      fix sg_phys to use dma_addr_t · 85cdffcd
      Hugh Dickins 提交于
      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: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      85cdffcd
  26. 24 10月, 2007 2 次提交
  27. 23 10月, 2007 2 次提交
    • J
      Add CONFIG_DEBUG_SG sg validation · d6ec0842
      Jens Axboe 提交于
      Add a Kconfig entry which will toggle some sanity checks on the sg
      entry and tables.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      d6ec0842
    • J
      Change table chaining layout · 18dabf47
      Jens Axboe 提交于
      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: NJens Axboe <jens.axboe@oracle.com>
      18dabf47
  28. 22 10月, 2007 1 次提交
  29. 16 10月, 2007 2 次提交
  30. 21 9月, 2006 1 次提交
  31. 30 10月, 2005 1 次提交
    • H
      [PATCH] Introduce sg_set_buf · d32311fe
      Herbert Xu 提交于
      sg_init_one is a nice tool for the block layer.  However, users
      of struct scatterlist in other subsystems don't usually need the
      DMA attributes.  For them it's a waste of time and space to
      initialise the whole struct scatterlist structure.
      
      Therefore this patch adds a new function sg_set_buf to initialise
      a scatterlist without zeroing the DMA attributes.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      d32311fe