Skip to content

Commit 1e3510b

Browse files
committed
Merge tag 'dma-mapping-4.16-2' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fixes from Christoph Hellwig: "A few dma-mapping fixes for the fallout from the changes in rc1" * tag 'dma-mapping-4.16-2' of git://git.infradead.org/users/hch/dma-mapping: powerpc/macio: set a proper dma_coherent_mask dma-mapping: fix a comment typo dma-direct: comment the dma_direct_free calling convention dma-direct: mark as is_phys ia64: fix build failure with CONFIG_SWIOTLB
2 parents af27d94 + 7bcfab2 commit 1e3510b

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

arch/ia64/kernel/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ ifneq ($(CONFIG_IA64_ESI),)
4141
obj-y += esi_stub.o # must be in kernel proper
4242
endif
4343
obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o
44-
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
4544

4645
obj-$(CONFIG_BINFMT_ELF) += elfcore.o
4746

drivers/macintosh/macio_asic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
375375
dev->ofdev.dev.of_node = np;
376376
dev->ofdev.archdata.dma_mask = 0xffffffffUL;
377377
dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
378+
dev->ofdev.dev.coherent_dma_mask = dev->ofdev.archdata.dma_mask;
378379
dev->ofdev.dev.parent = parent;
379380
dev->ofdev.dev.bus = &macio_bus_type;
380381
dev->ofdev.dev.release = macio_release_dev;

include/linux/dma-mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
578578

579579
/*
580580
* This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please
581-
* don't use this is new code.
581+
* don't use this in new code.
582582
*/
583583
#ifndef arch_dma_supported
584584
#define arch_dma_supported(dev, mask) (1)

lib/dma-direct.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
8484
return page_address(page);
8585
}
8686

87+
/*
88+
* NOTE: this function must never look at the dma_addr argument, because we want
89+
* to be able to use it as a helper for iommu implementations as well.
90+
*/
8791
void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
8892
dma_addr_t dma_addr, unsigned long attrs)
8993
{
@@ -152,5 +156,6 @@ const struct dma_map_ops dma_direct_ops = {
152156
.map_sg = dma_direct_map_sg,
153157
.dma_supported = dma_direct_supported,
154158
.mapping_error = dma_direct_mapping_error,
159+
.is_phys = 1,
155160
};
156161
EXPORT_SYMBOL(dma_direct_ops);

0 commit comments

Comments
 (0)