1. 13 5月, 2020 1 次提交
    • M
      dma-mapping: add generic helpers for mapping sgtable objects · d9d200bc
      Marek Szyprowski 提交于
      struct sg_table is a common structure used for describing a memory
      buffer. It consists of a scatterlist with memory pages and DMA addresses
      (sgl entry), as well as the number of scatterlist entries: CPU pages
      (orig_nents entry) and DMA mapped pages (nents entry).
      
      It turned out that it was a common mistake to misuse nents and orig_nents
      entries, calling DMA-mapping functions with a wrong number of entries or
      ignoring the number of mapped entries returned by the dma_map_sg
      function.
      
      To avoid such issues, let's introduce a common wrappers operating
      directly on the struct sg_table objects, which take care of the proper
      use of the nents and orig_nents entries.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      d9d200bc
  2. 20 4月, 2020 1 次提交
    • D
      dma-pool: add additional coherent pools to map to gfp mask · c84dc6e6
      David Rientjes 提交于
      The single atomic pool is allocated from the lowest zone possible since
      it is guaranteed to be applicable for any DMA allocation.
      
      Devices may allocate through the DMA API but not have a strict reliance
      on GFP_DMA memory.  Since the atomic pool will be used for all
      non-blockable allocations, returning all memory from ZONE_DMA may
      unnecessarily deplete the zone.
      
      Provision for multiple atomic pools that will map to the optimal gfp
      mask of the device.
      
      When allocating non-blockable memory, determine the optimal gfp mask of
      the device and use the appropriate atomic pool.
      
      The coherent DMA mask will remain the same between allocation and free
      and, thus, memory will be freed to the same atomic pool it was allocated
      from.
      
      __dma_atomic_pool_init() will be changed to return struct gen_pool *
      later once dynamic expansion is added.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c84dc6e6
  3. 22 11月, 2019 1 次提交
    • N
      dma-mapping: treat dev->bus_dma_mask as a DMA limit · a7ba70f1
      Nicolas Saenz Julienne 提交于
      Using a mask to represent bus DMA constraints has a set of limitations.
      The biggest one being it can only hold a power of two (minus one). The
      DMA mapping code is already aware of this and treats dev->bus_dma_mask
      as a limit. This quirk is already used by some architectures although
      still rare.
      
      With the introduction of the Raspberry Pi 4 we've found a new contender
      for the use of bus DMA limits, as its PCIe bus can only address the
      lower 3GB of memory (of a total of 4GB). This is impossible to represent
      with a mask. To make things worse the device-tree code rounds non power
      of two bus DMA limits to the next power of two, which is unacceptable in
      this case.
      
      In the light of this, rename dev->bus_dma_mask to dev->bus_dma_limit all
      over the tree and treat it as such. Note that dev->bus_dma_limit should
      contain the higher accessible DMA address.
      Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      a7ba70f1
  4. 15 11月, 2019 1 次提交
  5. 31 10月, 2019 2 次提交
  6. 04 9月, 2019 5 次提交
  7. 03 9月, 2019 1 次提交
  8. 29 8月, 2019 1 次提交
  9. 22 8月, 2019 1 次提交
  10. 23 7月, 2019 1 次提交
  11. 17 7月, 2019 1 次提交
  12. 10 7月, 2019 1 次提交
  13. 08 4月, 2019 1 次提交
  14. 07 3月, 2019 1 次提交
  15. 20 2月, 2019 3 次提交
  16. 14 2月, 2019 2 次提交
  17. 01 2月, 2019 2 次提交
  18. 08 1月, 2019 1 次提交
  19. 04 1月, 2019 4 次提交
  20. 23 12月, 2018 1 次提交
  21. 20 12月, 2018 1 次提交
  22. 14 12月, 2018 6 次提交
  23. 06 12月, 2018 1 次提交