Merge branch 'intelfb-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[powerpc.git] / arch / x86_64 / kernel / pci-calgary.c
index 7c43cb0..cfb09b0 100644 (file)
@@ -86,7 +86,8 @@
 
 #define MAX_NUM_OF_PHBS                8 /* how many PHBs in total? */
 #define MAX_NUM_CHASSIS                8 /* max number of chassis */
-#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2) /* max dev->bus->number */
+/* MAX_PHB_BUS_NUM is the maximal possible dev->bus->number */
+#define MAX_PHB_BUS_NUM                (MAX_NUM_OF_PHBS * MAX_NUM_CHASSIS * 2)
 #define PHBS_PER_CALGARY       4
 
 /* register offsets in Calgary's internal register space */
@@ -129,11 +130,6 @@ static void tce_cache_blast(struct iommu_table *tbl);
 #ifdef CONFIG_IOMMU_DEBUG
 int debugging __read_mostly = 1;
 
-static inline void tce_cache_blast_stress(struct iommu_table *tbl)
-{
-       tce_cache_blast(tbl);
-}
-
 static inline unsigned long verify_bit_range(unsigned long* bitmap,
        int expected, unsigned long start, unsigned long end)
 {
@@ -153,10 +149,6 @@ static inline unsigned long verify_bit_range(unsigned long* bitmap,
 #else /* debugging is disabled */
 int debugging __read_mostly = 0;
 
-static inline void tce_cache_blast_stress(struct iommu_table *tbl)
-{
-}
-
 static inline unsigned long verify_bit_range(unsigned long* bitmap,
        int expected, unsigned long start, unsigned long end)
 {
@@ -289,8 +281,6 @@ static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
        }
 
        __clear_bit_string(tbl->it_map, entry, npages);
-
-       tce_cache_blast_stress(tbl);
 }
 
 static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
@@ -934,6 +924,9 @@ void __init detect_calgary(void)
        if (swiotlb || no_iommu || iommu_detected)
                return;
 
+       if (!early_pci_allowed())
+               return;
+
        specified_table_size = determine_tce_table_size(end_pfn * PAGE_SIZE);
 
        for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {