Messages in this thread |  | | Date | Tue, 22 May 2001 15:22:20 +0200 | From | Andrea Arcangeli <> | Subject | Re: alpha iommu fixes |
| |
On Mon, May 21, 2001 at 10:53:39AM -0700, Richard Henderson wrote: > diff -ruNp linux/arch/alpha/kernel/pci_iommu.c linux-new/arch/alpha/kernel/pci_iommu.c > --- linux/arch/alpha/kernel/pci_iommu.c Fri Mar 2 11:12:07 2001 > +++ linux-new/arch/alpha/kernel/pci_iommu.c Mon May 21 01:25:25 2001 > @@ -402,8 +402,20 @@ sg_fill(struct scatterlist *leader, stru > paddr &= ~PAGE_MASK; > npages = calc_npages(paddr + size); > dma_ofs = iommu_arena_alloc(arena, npages); > - if (dma_ofs < 0) > - return -1; > + if (dma_ofs < 0) { > + /* If we attempted a direct map above but failed, die. */ > + if (leader->dma_address == 0) > + return -1; > + > + /* Otherwise, break up the remaining virtually contiguous > + hunks into individual direct maps. */ > + for (sg = leader; sg < end; ++sg) > + if (sg->dma_address == 2 || sg->dma_address == -2) ^^^^ should be == 1
> + sg->dma_address = 0; > + > + /* Retry. */ > + return sg_fill(leader, end, out, arena, max_dma); > + } > > out->dma_address = arena->dma_base + dma_ofs*PAGE_SIZE + paddr; > out->dma_length = size;
I am going to merge this one (however it won't help on the big memory machines, it will only try to hide the problem on the machines with not much memory above 2G).
Andrea - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |