* [PATCH] Revert "iommu/amd: Don't allocate with __GFP_ZERO in alloc_coherent"
@ 2015-06-02 6:45 Joerg Roedel
0 siblings, 0 replies; only message in thread
From: Joerg Roedel @ 2015-06-02 6:45 UTC (permalink / raw)
To: iommu; +Cc: linux-kernel, Joerg Roedel
From: Joerg Roedel <jroedel@suse.de>
This reverts commit 5fc872c7323534e8f7dc21bab635e7a9b9659e07.
The DMA-API does not strictly require that the memory
returned by dma_alloc_coherent is zeroed out. For that
another function (dma_zalloc_coherent) should be used. But
all other x86 DMA-API implementation I checked zero out the
memory, so that some drivers rely on it and break when it is
not.
It seems the (driver-)world is not yet ready for this
change, so revert it.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/amd_iommu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index e43d489..e1c7e9e 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2930,6 +2930,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
size = PAGE_ALIGN(size);
dma_mask = dev->coherent_dma_mask;
flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
+ flag |= __GFP_ZERO;
page = alloc_pages(flag | __GFP_NOWARN, get_order(size));
if (!page) {
--
1.8.4.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-02 6:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02 6:45 [PATCH] Revert "iommu/amd: Don't allocate with __GFP_ZERO in alloc_coherent" Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).