Thread (35 messages) 35 messages, 7 authors, 2025-03-31

Re: [PATCH v4 12/14] swiotlb: Add restricted DMA alloc/free support.

From: Claire Chang <hidden>
Date: 2021-02-26 04:19:03
Also in: linux-devicetree, linux-iommu, lkml, xen-devel

quoted hunk ↗ jump to hunk
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index fd9c1bd183ac..8b77fd64199e 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -836,6 +836,40 @@ late_initcall(swiotlb_create_default_debugfs);
 #endif

 #ifdef CONFIG_DMA_RESTRICTED_POOL
+struct page *dev_swiotlb_alloc(struct device *dev, size_t size, gfp_t gfp)
+{
+       struct swiotlb *swiotlb;
+       phys_addr_t tlb_addr;
+       unsigned int index;
+
+       /* dev_swiotlb_alloc can be used only in the context which permits sleeping. */
+       if (!dev->dev_swiotlb || !gfpflags_allow_blocking(gfp))
Just noticed that !gfpflags_allow_blocking(gfp) shouldn't be here.

Hi Christoph,

Do you think I should fix this and rebase on the latest linux-next
now? I wonder if there are more factor and clean up coming and I
should wait after that.

Thanks,
Claire
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help