Commit 1e3510b2 authored by Linus Torvalds's avatar Linus Torvalds

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
parents af27d940 7bcfab20
...@@ -41,7 +41,6 @@ ifneq ($(CONFIG_IA64_ESI),) ...@@ -41,7 +41,6 @@ ifneq ($(CONFIG_IA64_ESI),)
obj-y += esi_stub.o # must be in kernel proper obj-y += esi_stub.o # must be in kernel proper
endif endif
obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
obj-$(CONFIG_BINFMT_ELF) += elfcore.o obj-$(CONFIG_BINFMT_ELF) += elfcore.o
......
...@@ -375,6 +375,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, ...@@ -375,6 +375,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
dev->ofdev.dev.of_node = np; dev->ofdev.dev.of_node = np;
dev->ofdev.archdata.dma_mask = 0xffffffffUL; dev->ofdev.archdata.dma_mask = 0xffffffffUL;
dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask; dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
dev->ofdev.dev.coherent_dma_mask = dev->ofdev.archdata.dma_mask;
dev->ofdev.dev.parent = parent; dev->ofdev.dev.parent = parent;
dev->ofdev.dev.bus = &macio_bus_type; dev->ofdev.dev.bus = &macio_bus_type;
dev->ofdev.dev.release = macio_release_dev; dev->ofdev.dev.release = macio_release_dev;
......
...@@ -578,7 +578,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) ...@@ -578,7 +578,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
/* /*
* This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please
* don't use this is new code. * don't use this in new code.
*/ */
#ifndef arch_dma_supported #ifndef arch_dma_supported
#define arch_dma_supported(dev, mask) (1) #define arch_dma_supported(dev, mask) (1)
......
...@@ -84,6 +84,10 @@ void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, ...@@ -84,6 +84,10 @@ void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
return page_address(page); return page_address(page);
} }
/*
* NOTE: this function must never look at the dma_addr argument, because we want
* to be able to use it as a helper for iommu implementations as well.
*/
void dma_direct_free(struct device *dev, size_t size, void *cpu_addr, void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
dma_addr_t dma_addr, unsigned long attrs) dma_addr_t dma_addr, unsigned long attrs)
{ {
...@@ -152,5 +156,6 @@ const struct dma_map_ops dma_direct_ops = { ...@@ -152,5 +156,6 @@ const struct dma_map_ops dma_direct_ops = {
.map_sg = dma_direct_map_sg, .map_sg = dma_direct_map_sg,
.dma_supported = dma_direct_supported, .dma_supported = dma_direct_supported,
.mapping_error = dma_direct_mapping_error, .mapping_error = dma_direct_mapping_error,
.is_phys = 1,
}; };
EXPORT_SYMBOL(dma_direct_ops); EXPORT_SYMBOL(dma_direct_ops);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment