Re: [PATCH]: PCI: GART iommu alignment fixes [v2]

From: Ingo Molnar
Date: Sun Aug 17 2008 - 08:56:46 EST



* FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> wrote:

> > Config is:
> >
> > http://redhat.com/~mingo/misc/config-Fri_Aug_15_18_30_56_CEST_2008.bad
> >
> > Any idea why that is so? Apparently the alignment change wasnt as benign
> > as assumed.
>
> Ah, sorry,
>
> @@ -262,7 +264,11 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
> static dma_addr_t
> gart_map_simple(struct device *dev, phys_addr_t paddr, size_t size, int dir)
> {
> - dma_addr_t map = dma_map_area(dev, paddr, size, dir);
> + dma_addr_t map;
> + unsigned long align_mask;
> +
> + align_mask = (roundup_pow_of_two(size) >> PAGE_SHIFT) - 1;
> + map = dma_map_area(dev, paddr, size, dir, align_mask);
>
> This code doesn't work with the case size < PAGE_SIZE.
>
> I think that dmam_alloc_consistent in libata-core fails due to this
> bug.
>
> Can you try this?

ok - merged the commit below in tip/x86/iommu.

> BTW, I think that this is not urgent stuff at all.

ok - i've queued it up for v2.6.28.

Ingo

-------------->