mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
powerpc/cell: use the generic iommu bypass code
This gets rid of a lot of clumsy code and finally allows us to mark dma_iommu_ops const. Includes fixes from Michael Ellerman. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
cc9c156db5
commit
ba767b5283
4 changed files with 20 additions and 135 deletions
|
@ -20,14 +20,15 @@
|
|||
*/
|
||||
static inline bool dma_iommu_alloc_bypass(struct device *dev)
|
||||
{
|
||||
return dev->archdata.iommu_bypass &&
|
||||
return dev->archdata.iommu_bypass && !iommu_fixed_is_weak &&
|
||||
dma_nommu_dma_supported(dev, dev->coherent_dma_mask);
|
||||
}
|
||||
|
||||
static inline bool dma_iommu_map_bypass(struct device *dev,
|
||||
unsigned long attrs)
|
||||
{
|
||||
return dev->archdata.iommu_bypass;
|
||||
return dev->archdata.iommu_bypass &&
|
||||
(!iommu_fixed_is_weak || (attrs & DMA_ATTR_WEAK_ORDERING));
|
||||
}
|
||||
|
||||
/* Allocates a contiguous real buffer and creates mappings over it.
|
||||
|
@ -163,7 +164,7 @@ u64 dma_iommu_get_required_mask(struct device *dev)
|
|||
return mask;
|
||||
}
|
||||
|
||||
struct dma_map_ops dma_iommu_ops = {
|
||||
const struct dma_map_ops dma_iommu_ops = {
|
||||
.alloc = dma_iommu_alloc_coherent,
|
||||
.free = dma_iommu_free_coherent,
|
||||
.mmap = dma_nommu_mmap_coherent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue