[lkml]   [2008]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH]: PCI: GART iommu alignment fixes [v2]

Muli Ben-Yehuda wrote:
> On Thu, Aug 07, 2008 at 01:41:40PM -0400, Prarit Bhargava wrote:
>> As for Calgary, I'm looking into it ATM. I think I can get my hands
>> on one.
> Feel free to ping me if Calgary testing is needed.

Muli -- I just ran tests on an IBM system with a Calgary iommu that Ed
Pollard pointed me at.

dma_ops_alloc_addresses() does not have the option to return
size-aligned values. This means that
pci_alloc_consistent()/dma_alloc_coherent() will return unaligned values
to callers when the lower 4G of memory not available.

Additionally, a quick test shows that in dma_ops_alloc_addresses()

boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,

may return 0 in the same manner I've been pointing out -- if
dma_get_seg_boundary(dev) returns 0xffffffff and 1 is added to that
result, boundary_size = 0. Then you BUG() in the iommu-helper code.

Jesse pointed out to me that my fix on that line is incorrect. _If_
this is not a compiler issue (I've emailed jakub privately and cc'd him
on this email) then a better fix would be to do (sorry for the

--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -78,7 +78,7 @@ static inline unsigned int dma_set_max_seg_size(struct
static inline unsigned long dma_get_seg_boundary(struct device *dev)
return dev->dma_parms ?
- dev->dma_parms->segment_boundary_mask : 0xffffffff;
+ dev->dma_parms->segment_boundary_mask : 0xffffffffUL;

However, I'm still waiting for clarification from jakub before
submitting again with that chunk.


> Cheers,
> Muli

 \ /
  Last update: 2008-08-08 17:25    [W:0.100 / U:18.260 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site