]> Pileus Git - ~andy/linux/blobdiff - arch/powerpc/sysdev/dart_iommu.c
Merge tag 'iio-fixes-for-3.9a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[~andy/linux] / arch / powerpc / sysdev / dart_iommu.c
index 8ef63a01e34561e3831b7047f1f0a8fd79a4d04b..bd968a43a48b29047fa5f2d9d8cd1fe9ceb66b69 100644 (file)
@@ -73,11 +73,16 @@ static int dart_is_u4;
 
 #define DBG(...)
 
+static DEFINE_SPINLOCK(invalidate_lock);
+
 static inline void dart_tlb_invalidate_all(void)
 {
        unsigned long l = 0;
        unsigned int reg, inv_bit;
        unsigned long limit;
+       unsigned long flags;
+
+       spin_lock_irqsave(&invalidate_lock, flags);
 
        DBG("dart: flush\n");
 
@@ -110,12 +115,17 @@ retry:
                        panic("DART: TLB did not flush after waiting a long "
                              "time. Buggy U3 ?");
        }
+
+       spin_unlock_irqrestore(&invalidate_lock, flags);
 }
 
 static inline void dart_tlb_invalidate_one(unsigned long bus_rpn)
 {
        unsigned int reg;
        unsigned int l, limit;
+       unsigned long flags;
+
+       spin_lock_irqsave(&invalidate_lock, flags);
 
        reg = DART_CNTL_U4_ENABLE | DART_CNTL_U4_IONE |
                (bus_rpn & DART_CNTL_U4_IONE_MASK);
@@ -137,6 +147,8 @@ wait_more:
                        panic("DART: TLB did not flush after waiting a long "
                              "time. Buggy U4 ?");
        }
+
+       spin_unlock_irqrestore(&invalidate_lock, flags);
 }
 
 static void dart_flush(struct iommu_table *tbl)