Thread (9 messages) 9 messages, 2 authors, 2024-06-18

Re: [PATCH RFC v2 4/5] dma-direct: add base offset to zone_dma_bits

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2024-06-18 21:40:45
Also in: linux-arm-kernel, linux-devicetree, linux-iommu, linux-s390, lkml

On Tue, Apr 09, 2024 at 09:17:57AM +0300, Baruch Siach wrote:
Current code using zone_dma_bits assume that all addresses range in the
bits mask are suitable for DMA. For some existing platforms this
assumption is not correct. DMA range might have non zero lower limit.
[...]
quoted hunk ↗ jump to hunk
@@ -59,7 +60,7 @@ static gfp_t dma_direct_optimal_gfp_mask(struct device *dev, u64 *phys_limit)
 	 * zones.
 	 */
 	*phys_limit = dma_to_phys(dev, dma_limit);
-	if (*phys_limit <= zone_dma_limit)
+	if (*phys_limit <= zone_dma_base + zone_dma_limit)
 		return GFP_DMA;
 	if (*phys_limit <= DMA_BIT_MASK(32))
 		return GFP_DMA32;
As I said previously, we no longer have zone_dma_bits after the first
patch, so adding this limit no longer make sense. In v1, you wanted a
limit like 32G to be added to the 30-bit zone_dma_bits to give you 33G
upper limit for ZONE_DMA. But since the first patch sets zone_dma_limit
to 33G already, this is no longer needed.

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