linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* arm swiotlb fix
@ 2019-08-05  7:56 Christoph Hellwig
  2019-08-05  7:56 ` [PATCH] arm: initialize the dma-remap atomic pool for LPAE configs Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2019-08-05  7:56 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Vignesh Raghavendra, Konrad Rzeszutek Wilk, linux-kernel, iommu,
	linux-arm-kernel, Roger Quadros

Hi all,

my commit to add swiotlb to arm failed to initialize the atomic pool,
which is needed for GFP_ATOMIC allocations on non-coherent devices.
These are fairly rare, but exist so we should wire it up.  For 5.4
I plan to move the initilization to the common dma-remap code so it
won't be missed for other architectures.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] arm: initialize the dma-remap atomic pool for LPAE configs
  2019-08-05  7:56 arm swiotlb fix Christoph Hellwig
@ 2019-08-05  7:56 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2019-08-05  7:56 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Vignesh Raghavendra, Konrad Rzeszutek Wilk, linux-kernel, iommu,
	linux-arm-kernel, Roger Quadros

When we use the generic dma-direct + remap code we also need to
initialize the atomic pool that is used for GFP_ATOMIC allocations on
non-coherent devices.

Fixes: ad3c7b18c5b3 ("arm: use swiotlb for bounce buffering on LPAE configs")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/arm/mm/dma-mapping.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 6774b03aa405..e509365cc9ca 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2423,4 +2423,10 @@ void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
 {
 	__arm_dma_free(dev, size, cpu_addr, dma_handle, attrs, false);
 }
+
+static int __init atomic_pool_init(void)
+{
+	return dma_atomic_pool_init(GFP_DMA, pgprot_noncached(PAGE_KERNEL));
+}
+postcore_initcall(atomic_pool_init);
 #endif /* CONFIG_SWIOTLB */
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-08-05  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05  7:56 arm swiotlb fix Christoph Hellwig
2019-08-05  7:56 ` [PATCH] arm: initialize the dma-remap atomic pool for LPAE configs 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).