diff options
author | Christoph Hellwig <hch@lst.de> | 2018-03-28 15:35:35 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-03-28 17:34:23 +0200 |
commit | e89f5b37015309a8bdf0b21d08007580b92f92a4 (patch) | |
tree | 194c925657ddd394d26ccc1ae707ffdac31c8534 /include/linux | |
parent | ea2301b6220117398a1de4f4bc853fbe886d5e08 (diff) | |
download | linux-e89f5b37015309a8bdf0b21d08007580b92f92a4.tar.gz linux-e89f5b37015309a8bdf0b21d08007580b92f92a4.tar.bz2 linux-e89f5b37015309a8bdf0b21d08007580b92f92a4.zip |
dma-mapping: Don't clear GFP_ZERO in dma_alloc_attrs
Revert the clearing of __GFP_ZERO in dma_alloc_attrs and move it to
dma_direct_alloc for now. While most common architectures always zero dma
cohereny allocations (and x86 did so since day one) this is not documented
and at least arc and s390 do not zero without the explicit __GFP_ZERO
argument.
Fixes: 57bf5a8963f8 ("dma-mapping: clear harmful GFP_* flags in common code")
Reported-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Reported-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: iommu@lists.linux-foundation.org
Link: https://lkml.kernel.org/r/20180328133535.17302-2-hch@lst.de
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dma-mapping.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index eb9eab4ecd6d..12fedcba9a9a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -518,12 +518,8 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size, if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr)) return cpu_addr; - /* - * Let the implementation decide on the zone to allocate from, and - * decide on the way of zeroing the memory given that the memory - * returned should always be zeroed. - */ - flag &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM | __GFP_ZERO); + /* let the implementation decide on the zone to allocate from: */ + flag &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); if (!arch_dma_alloc_attrs(&dev, &flag)) return NULL; |