lkml.org 
[lkml]   [2009]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough
From
Date
On Tue, 2009-11-10 at 01:01 +0000, David Woodhouse wrote:
> On Tue, 2009-11-10 at 00:46 +0000, David Woodhouse wrote:
> >
> > if (iommu_no_mapping(hwdev))
> > - return paddr;
> > + return paddr > dma_mask - size ? 0 : paddr;
>
> Hm, that's still wrong. If your mask is 0xffffffff and you map
> 0xfffff000 + 0x1000, that should be allowed, right? How about:
>
> return paddr <= dma_mask - size + 1 ? paddr : 0;

Ok, I was going to suggest that there was probably a -1 missing from my
patch. I'd also be surprised if you could actually get a paddr + size -
1 from a single allocation that would wrap. Would a device even be able
to handle that for DMA?

> And is this strictly necessary as part of the patch we're discussing?

Yeah, we could probably do without it. As for the commit comment, it's
rather scathing, but I can live with it. Thanks,

Alex



\
 
 \ /
  Last update: 2009-11-10 02:31    [W:0.056 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site