Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[pandora-kernel.git] / arch / powerpc / kernel / iommu.c
index 961bb03..0cfcf98 100644 (file)
@@ -501,6 +501,14 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
        tbl->it_map = page_address(page);
        memset(tbl->it_map, 0, sz);
 
+       /*
+        * Reserve page 0 so it will not be used for any mappings.
+        * This avoids buggy drivers that consider page 0 to be invalid
+        * to crash the machine or even lose data.
+        */
+       if (tbl->it_offset == 0)
+               set_bit(0, tbl->it_map);
+
        tbl->it_hint = 0;
        tbl->it_largehint = tbl->it_halfpoint;
        spin_lock_init(&tbl->it_lock);