]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/iommu.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / iommu.c
index d3276ebcfb4715a118268a8cb6c92640a33afcca..b781d3d54fb8f7ac7c69c358d69abcedb6cab199 100644 (file)
@@ -134,7 +134,8 @@ unsigned long iommu_range_alloc(struct device *dev,
        else
                boundary_size = ALIGN(1UL << 32, 1 << IO_PAGE_SHIFT);
 
-       n = iommu_area_alloc(arena->map, limit, start, npages, 0,
+       n = iommu_area_alloc(arena->map, limit, start, npages,
+                            iommu->page_table_map_base >> IO_PAGE_SHIFT,
                             boundary_size >> IO_PAGE_SHIFT, 0);
        if (n == -1) {
                if (likely(pass < 1)) {
@@ -200,12 +201,11 @@ int iommu_table_init(struct iommu *iommu, int tsbsize,
        /* Allocate and initialize the dummy page which we
         * set inactive IO PTEs to point to.
         */
-       iommu->dummy_page = __get_free_pages(GFP_KERNEL, 0);
+       iommu->dummy_page = get_zeroed_page(GFP_KERNEL);
        if (!iommu->dummy_page) {
                printk(KERN_ERR "IOMMU: Error, gfp(dummy_page) failed.\n");
                goto out_free_map;
        }
-       memset((void *)iommu->dummy_page, 0, PAGE_SIZE);
        iommu->dummy_page_pa = (unsigned long) __pa(iommu->dummy_page);
 
        /* Now allocate and setup the IOMMU page table itself.  */
@@ -626,7 +626,7 @@ static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist,
 iommu_map_failed:
        for_each_sg(sglist, s, nelems, i) {
                if (s->dma_length != 0) {
-                       unsigned long vaddr, npages, entry, i;
+                       unsigned long vaddr, npages, entry, j;
                        iopte_t *base;
 
                        vaddr = s->dma_address & IO_PAGE_MASK;
@@ -637,8 +637,8 @@ iommu_map_failed:
                                >> IO_PAGE_SHIFT;
                        base = iommu->page_table + entry;
 
-                       for (i = 0; i < npages; i++)
-                               iopte_make_dummy(iommu, base + i);
+                       for (j = 0; j < npages; j++)
+                               iopte_make_dummy(iommu, base + j);
 
                        s->dma_address = DMA_ERROR_CODE;
                        s->dma_length = 0;
@@ -803,7 +803,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,
        spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-const struct dma_ops sun4u_dma_ops = {
+static const struct dma_ops sun4u_dma_ops = {
        .alloc_coherent         = dma_4u_alloc_coherent,
        .free_coherent          = dma_4u_free_coherent,
        .map_single             = dma_4u_map_single,