linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* remove dma_zalloc_coherent
@ 2019-01-08 13:06 Christoph Hellwig
  2019-01-08 13:06 ` [PATCH 1/3] cross-tree: phase out dma_zalloc_coherent() Christoph Hellwig
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Christoph Hellwig @ 2019-01-08 13:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Luis Chamberlain, Julia Lawall, iommu, linux-kernel

Hi Linus and world,

We've always had a weird situation around dma_zalloc_coherent.  To
safely support mapping the allocations to userspace major architectures
like x86 and arm have always zeroed allocations from dma_alloc_coherent,
but a couple other architectures were missing that zeroing either always
or in corner cases.  Then later we grew anothe dma_zalloc_coherent
interface to explicitly request zeroing, but that just added __GFP_ZERO
to the allocation flags, which for some allocators that didn't end
up using the page allocator ended up being a no-op and still not
zeroing the allocations.

So for this merge window I fixed up all remaining architectures to zero
the memory in dma_alloc_coherent, and made dma_zalloc_coherent a no-op
wrapper around dma_alloc_coherent, which fixes all of the above issues.

dma_zalloc_coherent is now pointless and can go away, and Luis helped
me writing a cocchinelle script and patch series to kill it, which I
think we should apply now just after -rc1 to finally settle these
issue.

The script that generated the first patch is included here:

@ replace_dma_zalloc_coherent @
expression dev, size, data, handle, flags;
@@

-dma_zalloc_coherent(dev, size, handle, flags)
+dma_alloc_coherent(dev, size, handle, flags)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-01-11 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 13:06 remove dma_zalloc_coherent Christoph Hellwig
2019-01-08 13:06 ` [PATCH 1/3] cross-tree: phase out dma_zalloc_coherent() Christoph Hellwig
2019-01-08 13:07 ` [PATCH 2/3] cross-tree: phase out dma_zalloc_coherent() on headers Christoph Hellwig
2019-01-08 14:30   ` Julia Lawall
2019-01-08 13:07 ` [PATCH 3/3] dma-mapping: remove dma_zalloc_coherent() Christoph Hellwig
2019-01-08 14:29   ` Julia Lawall
2019-01-08 13:55 ` remove dma_zalloc_coherent Julia Lawall
2019-01-08 13:56   ` Julia Lawall
2019-01-11 18:16 ` Christoph Hellwig

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).