Skip to contentSkip to conversation

Disable sba_iommu bypass to be compatible with bio-level block merging

PATCH New Alex Williamson 1 participant 1 message Jun 27, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Disable sba_iommu bypass to be compatible with bio-level block merging

This patch works around a problem that David Mosberger
discovered prior to his 2.5.72 ia64 patch release. The zx1 iommu driver has an optimization to allow devices that can DMA directly to a memory address to completely bypass the iommu. For sg mappings, we skip the coalescing and everything. Effectively, this looks like a mixed bus system and I don't see how to handle that with the current bio code. IMHO, this really doesn't seem like an extraordinary situation and I'm sure there are other platforms that might hit it as well.

For now it seems like the best way to make things happy is
to disable the bypass feature and force all DMA to be mapped through the iommu. The attached patch is against David's last 2.5.72 ia64 patch. Much thanks to Grant Grundler for really diving into this and discovering what was happening. Thanks,

Alex

Signature · 1 line
Alex Williamson                             HP Linux & Open Source Lab
include/asm-ia64/io.h +1 -1
@@ -424,6 +424,6 @@
  * which is precisely what we want.
  */
 extern unsigned long ia64_max_iommu_merge_mask;
-#define BIO_VMERGE_BOUNDARY	(0UL)//(ia64_max_iommu_merge_mask + 1)
+#define BIO_VMERGE_BOUNDARY	(ia64_max_iommu_merge_mask + 1)
 
 #endif /* _ASM_IA64_IO_H */
arch/ia64/hp/common/sba_iommu.c +4 -1
@@ -47,8 +47,11 @@
 /*
 ** This option allows cards capable of 64bit DMA to bypass the IOMMU.  If
 ** not defined, all DMA will be 32bit and go through the TLB.
+** The bio merge code currently expects that if we tweak that vmerge
+** boundary that we will alway coalesce blocks on that boundary.  Enabling
+** this optimization is therefore incompatible with tuning the boundary.
 */
-#define ALLOW_IOV_BYPASS
+#undef ALLOW_IOV_BYPASS
 
 /*
 ** If a device prefetches beyond the end of a valid pdir entry, it will cause