Skip to contentSkip to conversation

dma mapping fixes for 4.16

PATCH New Christoph Hellwig 1 participant 5 messages Feb 13, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Below are a few small fixups for the dma mapping changes in 4.16-rc1. The most urgent one is the ia64 compile fix.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 1/4 ia64: fix build failure with CONFIG_SWIOTLB

From: Corentin Labbe <clabbe-rdvid1DuHRBWk0Htik3J/[email protected]>

arch/ia64/kernel/pci-swiotlb.c is removed in commit 4fac8076df85 ("ia64: clean up swiotlb support") but pci-swiotlb.o is still present in Makefile, and so build fail when CONFIG_SWIOTLB is enabled.
Fix the build failure by removing pci-swiotlb.o from makefile

Fixes 4fac8076df85 ("ia64: clean up swiotlb support")
---
 arch/ia64/kernel/Makefile | 1 -
 1 file changed, 1 deletion(-)
arch/ia64/kernel/Makefile +0 -1
index 0b4c65a1af25..498f3da3f225 100644
@@ -41,7 +41,6 @@ ifneq ($(CONFIG_IA64_ESI),)
 obj-y				+= esi_stub.o	# must be in kernel proper
 endif
 obj-$(CONFIG_INTEL_IOMMU)	+= pci-dma.o
-obj-$(CONFIG_SWIOTLB)		+= pci-swiotlb.o
 
 obj-$(CONFIG_BINFMT_ELF)	+= elfcore.o
 
Signature · 1 line
2.14.2
#3 lore raw

PATCH 2/4 dma-direct: mark as is_phys

In reply to a message not in the archive

Various PCI_DMA_BUS_IS_PHYS implementations rely on this flag to make proper decisions for block and networking addressability.

---
 lib/dma-direct.c | 1 +
 1 file changed, 1 insertion(+)
lib/dma-direct.c +1 -0
index 40b1f92f2214..fdc733cf9e30 100644
@@ -152,5 +152,6 @@ const struct dma_map_ops dma_direct_ops = {
 	.map_sg			= dma_direct_map_sg,
 	.dma_supported		= dma_direct_supported,
 	.mapping_error		= dma_direct_mapping_error,
+	.is_phys		= 1,
 };
 EXPORT_SYMBOL(dma_direct_ops);
Signature · 1 line
2.14.2
#4 lore raw

PATCH 3/4 dma-direct: comment the dma_direct_free calling convention

In reply to a message not in the archive
---
 lib/dma-direct.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/dma-direct.c +4 -0
index fdc733cf9e30..c9e8e21cb334 100644
@@ -84,6 +84,10 @@ void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
 	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,
 		dma_addr_t dma_addr, unsigned long attrs)
 {
Signature · 1 line
2.14.2
#5 lore raw

PATCH 4/4 dma-mapping: fix a comment typo

In reply to a message not in the archive
---
 include/linux/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/dma-mapping.h +1 -1
index 34fe8463d10e..eb9eab4ecd6d 100644
@@ -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
- * don't use this is new code.
+ * don't use this in new code.
  */
 #ifndef arch_dma_supported
 #define arch_dma_supported(dev, mask)	(1)
Signature · 1 line
2.14.2