]> Pileus Git - ~andy/linux/blobdiff - arch/ia64/hp/common/hwsw_iommu.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[~andy/linux] / arch / ia64 / hp / common / hwsw_iommu.c
index 1ba02baf2f94fbc77a000374b0e859b411303008..94e57109fad658d060542aea2ed9f51bd1d230db 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/machvec.h>
 
 /* swiotlb declarations & definitions: */
-extern void swiotlb_init_with_default_size (size_t size);
+extern int swiotlb_late_init_with_default_size (size_t size);
 extern ia64_mv_dma_alloc_coherent      swiotlb_alloc_coherent;
 extern ia64_mv_dma_free_coherent       swiotlb_free_coherent;
 extern ia64_mv_dma_map_single          swiotlb_map_single;
@@ -63,11 +63,20 @@ use_swiotlb (struct device *dev)
        return dev && dev->dma_mask && !hwiommu_dma_supported(dev, *dev->dma_mask);
 }
 
-void
+void __init
 hwsw_init (void)
 {
        /* default to a smallish 2MB sw I/O TLB */
-       swiotlb_init_with_default_size (2 * (1<<20));
+       if (swiotlb_late_init_with_default_size (2 * (1<<20)) != 0) {
+#ifdef CONFIG_IA64_GENERIC
+               /* Better to have normal DMA than panic */
+               printk(KERN_WARNING "%s: Failed to initialize software I/O TLB,"
+                      " reverting to hpzx1 platform vector\n", __FUNCTION__);
+               machvec_init("hpzx1");
+#else
+               panic("Unable to initialize software I/O TLB services");
+#endif
+       }
 }
 
 void *
@@ -183,3 +192,7 @@ EXPORT_SYMBOL(hwsw_unmap_sg);
 EXPORT_SYMBOL(hwsw_dma_supported);
 EXPORT_SYMBOL(hwsw_alloc_coherent);
 EXPORT_SYMBOL(hwsw_free_coherent);
+EXPORT_SYMBOL(hwsw_sync_single_for_cpu);
+EXPORT_SYMBOL(hwsw_sync_single_for_device);
+EXPORT_SYMBOL(hwsw_sync_sg_for_cpu);
+EXPORT_SYMBOL(hwsw_sync_sg_for_device);