mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	of/device: Set bus DMA mask as appropriate
When an explicit DMA limit is described by firmware, we need to remember it regardless of how drivers might subsequently update their devices' masks. The new bus_dma_mask field does that. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
		
							parent
							
								
									d74ea7100b
								
							
						
					
					
						commit
						6c2fb2ea76
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -149,6 +149,7 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
 | 
			
		|||
	 * set by the driver.
 | 
			
		||||
	 */
 | 
			
		||||
	mask = DMA_BIT_MASK(ilog2(dma_addr + size - 1) + 1);
 | 
			
		||||
	dev->bus_dma_mask = mask;
 | 
			
		||||
	dev->coherent_dma_mask &= mask;
 | 
			
		||||
	*dev->dma_mask &= mask;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue