lkml.org 
[lkml]   [2009]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/9] xen/swiotlb: improve comment on gfp flags in xen_alloc_coherent()
Date
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

Impact: cleanup

Clarify why we don't care about the kernel's pseudo-phys restrictions,
so long as the underlying pages are in the right place.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
drivers/pci/xen-iommu.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/xen-iommu.c b/drivers/pci/xen-iommu.c
index 9d01be6..492ef42 100644
--- a/drivers/pci/xen-iommu.c
+++ b/drivers/pci/xen-iommu.c
@@ -199,15 +199,17 @@ static void *xen_alloc_coherent(struct device *dev, size_t size,
unsigned long vstart;
u64 mask;

- /* ignore region specifiers */
+ /*
+ * Ignore region specifiers - the kernel's ideas of
+ * pseudo-phys memory layout has nothing to do with the
+ * machine physical layout. We can't allocate highmem
+ * because we can't return a pointer to it.
+ */
gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
return ret;

- if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
- gfp |= GFP_DMA;
-
vstart = __get_free_pages(gfp, order);
ret = (void *)vstart;

--
1.6.0.6


\
 
 \ /
  Last update: 2009-05-08 02:43    [from the cache]
©2003-2011 Jasper Spaans