History

swiotlb: Update is_swiotlb_buffer to add a struct device argument

Update is_swiotlb_buffer to add a struct device argument. This will be useful later to allow for different pools.

Claire Chang committed 5 years ago

Commit 7fd856a1 parent 69031f55 files · +17 −16Browse files

Showing the changes to kernel (2 of 5 files). Show all

Unified · Split

2 files
  1. kernel/dma/direct.c +3 −3
  2. kernel/dma/direct.h +3 −3
kernel/dma/direct.c+3−3
@@ -343,7 +343,7 @@ void dma_direct_sync_sg_for_device(struct device *dev, · 342 unmodified lines
343343 for_each_sg(sgl, sg, nents, i) {
344344 phys_addr_t paddr = dma_to_phys(dev, sg_dma_address(sg));
345345
346− if (unlikely(is_swiotlb_buffer(paddr)))
346+ if (unlikely(is_swiotlb_buffer(dev, paddr)))
347347 swiotlb_sync_single_for_device(dev, paddr, sg->length,
348348 dir);
349349
@@ -369,7 +369,7 @@ void dma_direct_sync_sg_for_cpu(struct device *dev, · 19 unmodified lines
369369 if (!dev_is_dma_coherent(dev))
370370 arch_sync_dma_for_cpu(paddr, sg->length, dir);
371371
372− if (unlikely(is_swiotlb_buffer(paddr)))
372+ if (unlikely(is_swiotlb_buffer(dev, paddr)))
373373 swiotlb_sync_single_for_cpu(dev, paddr, sg->length,
374374 dir);
375375
@@ -504,7 +504,7 @@ size_t dma_direct_max_mapping_size(struct device *dev) · 128 unmodified lines
504504 bool dma_direct_need_sync(struct device *dev, dma_addr_t dma_addr)
505505 {
506506 return !dev_is_dma_coherent(dev) ||
507− is_swiotlb_buffer(dma_to_phys(dev, dma_addr));
507+ is_swiotlb_buffer(dev, dma_to_phys(dev, dma_addr));
508508 }
509509
510510 /**
kernel/dma/direct.h+3−3
@@ -56,7 +56,7 @@ static inline void dma_direct_sync_single_for_device(struct device *dev, · 55 unmodified lines
5656 {
5757 phys_addr_t paddr = dma_to_phys(dev, addr);
5858
59− if (unlikely(is_swiotlb_buffer(paddr)))
59+ if (unlikely(is_swiotlb_buffer(dev, paddr)))
6060 swiotlb_sync_single_for_device(dev, paddr, size, dir);
6161
6262 if (!dev_is_dma_coherent(dev))
@@ -73,7 +73,7 @@ static inline void dma_direct_sync_single_for_cpu(struct device *dev, · 10 unmodified lines
7373 arch_sync_dma_for_cpu_all();
7474 }
7575
76− if (unlikely(is_swiotlb_buffer(paddr)))
76+ if (unlikely(is_swiotlb_buffer(dev, paddr)))
7777 swiotlb_sync_single_for_cpu(dev, paddr, size, dir);
7878
7979 if (dir == DMA_FROM_DEVICE)
@@ -113,7 +113,7 @@ static inline void dma_direct_unmap_page(struct device *dev, dma_addr_t addr, · 33 unmodified lines
113113 if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
114114 dma_direct_sync_single_for_cpu(dev, addr, size, dir);
115115
116− if (unlikely(is_swiotlb_buffer(phys)))
116+ if (unlikely(is_swiotlb_buffer(dev, phys)))
117117 swiotlb_tbl_unmap_single(dev, phys, size, dir, attrs);
118118 }
119119 #endif /* _KERNEL_DMA_DIRECT_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t