summaryrefslogtreecommitdiffstats
path: root/arch/ia64/hp/common/hwsw_iommu.c
diff options
context:
space:
mode:
authorAlex Williamson2005-09-06 19:20:49 +0200
committerTony Luck2005-09-15 01:22:11 +0200
commit0b9afede3d9c66fef06f1d5ef5ff15c4b97730fc (patch)
tree95f55e1219eed9c3fd2458ddbf960307c631114e /arch/ia64/hp/common/hwsw_iommu.c
parentPartially revert "Fix time going twice as fast problem on ATI Xpress chipsets" (diff)
downloadkernel-qcow2-linux-0b9afede3d9c66fef06f1d5ef5ff15c4b97730fc.tar.gz
kernel-qcow2-linux-0b9afede3d9c66fef06f1d5ef5ff15c4b97730fc.tar.xz
kernel-qcow2-linux-0b9afede3d9c66fef06f1d5ef5ff15c4b97730fc.zip
[IA64] more robust zx1/sx1000 machvec support
Machine vector selection has always been a bit of a hack given how early in system boot it needs to be done. Services like ACPI namespace are not available and there are non-trivial problems to moving them to early boot. However, there's no reason we can't change to a different machvec later in boot when the services we need are available. By adding a entry point for later initialization of the swiotlb, we can add an error path for the hpzx1 machevec initialization and fall back to the DIG machine vector if IOMMU hardware isn't found in the system. Since ia64 uses 4GB for zone DMA (no ISA support), it's trivial to allocate a contiguous range from the slab for bounce buffer usage. Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/hp/common/hwsw_iommu.c')
-rw-r--r--arch/ia64/hp/common/hwsw_iommu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c
index 80f8ef013939..317c334c5a18 100644
--- a/arch/ia64/hp/common/hwsw_iommu.c
+++ b/arch/ia64/hp/common/hwsw_iommu.c
@@ -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;
@@ -67,7 +67,16 @@ void
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 *