forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'dma-mapping-4.16' of git://git.infradead.org/users/hch/dma…
…-mapping Pull dma mapping updates from Christoph Hellwig: "Except for a runtime warning fix from Christian this is all about consolidation of the generic no-IOMMU code, a well as the glue code for swiotlb. All the code is based on the x86 implementation with hooks to allow all architectures that aren't cache coherent to use it. The x86 conversion itself has been deferred because the x86 maintainers were a little busy in the last months" * tag 'dma-mapping-4.16' of git://git.infradead.org/users/hch/dma-mapping: (57 commits) MAINTAINERS: add the iommu list for swiotlb and xen-swiotlb arm64: use swiotlb_alloc and swiotlb_free arm64: replace ZONE_DMA with ZONE_DMA32 mips: use swiotlb_{alloc,free} mips/netlogic: remove swiotlb support tile: use generic swiotlb_ops tile: replace ZONE_DMA with ZONE_DMA32 unicore32: use generic swiotlb_ops ia64: remove an ifdef around the content of pci-dma.c ia64: clean up swiotlb support ia64: use generic swiotlb_ops ia64: replace ZONE_DMA with ZONE_DMA32 swiotlb: remove various exports swiotlb: refactor coherent buffer allocation swiotlb: refactor coherent buffer freeing swiotlb: wire up ->dma_supported in swiotlb_dma_ops swiotlb: add common swiotlb_map_ops swiotlb: rename swiotlb_free to swiotlb_exit x86: rename swiotlb_dma_ops powerpc: rename swiotlb_dma_ops ...
- Loading branch information
Showing
119 changed files
with
728 additions
and
1,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4343,10 +4343,12 @@ T: git git://git.infradead.org/users/hch/dma-mapping.git | |
W: http://git.infradead.org/users/hch/dma-mapping.git | ||
S: Supported | ||
F: lib/dma-debug.c | ||
F: lib/dma-noop.c | ||
F: lib/dma-direct.c | ||
F: lib/dma-virt.c | ||
F: drivers/base/dma-mapping.c | ||
F: drivers/base/dma-coherent.c | ||
F: include/asm-generic/dma-mapping.h | ||
F: include/linux/dma-direct.h | ||
F: include/linux/dma-mapping.h | ||
|
||
DME1737 HARDWARE MONITOR DRIVER | ||
|
@@ -13071,7 +13073,7 @@ F: arch/x86/boot/video* | |
|
||
SWIOTLB SUBSYSTEM | ||
M: Konrad Rzeszutek Wilk <[email protected]> | ||
L: [email protected].org | ||
L: [email protected].org | ||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git | ||
S: Supported | ||
F: lib/swiotlb.c | ||
|
@@ -15026,6 +15028,7 @@ F: include/xen/interface/io/vscsiif.h | |
XEN SWIOTLB SUBSYSTEM | ||
M: Konrad Rzeszutek Wilk <[email protected]> | ||
L: [email protected] (moderated for non-subscribers) | ||
L: [email protected] | ||
S: Supported | ||
F: arch/x86/xen/*swiotlb* | ||
F: drivers/xen/*swiotlb* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef ASM_ARM_DMA_DIRECT_H | ||
#define ASM_ARM_DMA_DIRECT_H 1 | ||
|
||
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | ||
{ | ||
unsigned int offset = paddr & ~PAGE_MASK; | ||
return pfn_to_dma(dev, __phys_to_pfn(paddr)) + offset; | ||
} | ||
|
||
static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr) | ||
{ | ||
unsigned int offset = dev_addr & ~PAGE_MASK; | ||
return __pfn_to_phys(dma_to_pfn(dev, dev_addr)) + offset; | ||
} | ||
|
||
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | ||
{ | ||
u64 limit, mask; | ||
|
||
if (!dev->dma_mask) | ||
return 0; | ||
|
||
mask = *dev->dma_mask; | ||
|
||
limit = (mask + 1) & ~mask; | ||
if (limit && size > limit) | ||
return 0; | ||
|
||
if ((addr | (addr + size - 1)) & ~mask) | ||
return 0; | ||
|
||
return 1; | ||
} | ||
|
||
#endif /* ASM_ARM_DMA_DIRECT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.