~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arc/mm/dma.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arc/mm/dma.c (Version linux-6.11.5) and /arch/i386/mm/dma.c (Version linux-5.19.17)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * Copyright (C) 2004, 2007-2010, 2011-2012 Sy    
  4  */                                               
  5                                                   
  6 #include <linux/dma-map-ops.h>                    
  7 #include <asm/cache.h>                            
  8 #include <asm/cacheflush.h>                       
  9                                                   
 10 /*                                                
 11  * ARCH specific callbacks for generic noncohe    
 12  *  - hardware IOC not available (or "dma-cohe    
 13  *  - But still handle both coherent and non-c    
 14  *                                                
 15  * For DMA coherent hardware (IOC) generic cod    
 16  */                                               
 17                                                   
 18 void arch_dma_prep_coherent(struct page *page,    
 19 {                                                 
 20         /*                                        
 21          * Evict any existing L1 and/or L2 lin    
 22          * in case it was used earlier as a no    
 23          * Yeah this bit us - STAR 9000898266     
 24          *                                        
 25          * Although core does call flush_cache    
 26          * can't be used to efficiently flush     
 27          * Currently flush_cache_vmap nukes th    
 28          * will be optimized as a separate com    
 29          */                                       
 30         dma_cache_wback_inv(page_to_phys(page)    
 31 }                                                 
 32                                                   
 33 /*                                                
 34  * Cache operations depending on function and     
 35  * https://lore.kernel.org/lkml/20180518175004    
 36  * "dma_sync_*_for_cpu and direction=TO_DEVICE    
 37  * dma-mapping: provide a generic dma-noncoher    
 38  *                                                
 39  *          |   map          ==  for_device       
 40  *          |---------------------------------    
 41  * TO_DEV   |   writeback        writeback        
 42  * FROM_DEV |   invalidate       invalidate       
 43  * BIDIR    |   writeback+inv    writeback+inv    
 44  *                                                
 45  *     [*] needed for CPU speculative prefetch    
 46  *                                                
 47  * NOTE: we don't check the validity of direct    
 48  * upper layer functions (in include/linux/dma    
 49  */                                               
 50                                                   
 51 void arch_sync_dma_for_device(phys_addr_t padd    
 52                 enum dma_data_direction dir)      
 53 {                                                 
 54         switch (dir) {                            
 55         case DMA_TO_DEVICE:                       
 56                 dma_cache_wback(paddr, size);     
 57                 break;                            
 58                                                   
 59         case DMA_FROM_DEVICE:                     
 60                 dma_cache_inv(paddr, size);       
 61                 break;                            
 62                                                   
 63         case DMA_BIDIRECTIONAL:                   
 64                 dma_cache_wback_inv(paddr, siz    
 65                 break;                            
 66                                                   
 67         default:                                  
 68                 break;                            
 69         }                                         
 70 }                                                 
 71                                                   
 72 void arch_sync_dma_for_cpu(phys_addr_t paddr,     
 73                 enum dma_data_direction dir)      
 74 {                                                 
 75         switch (dir) {                            
 76         case DMA_TO_DEVICE:                       
 77                 break;                            
 78                                                   
 79         /* FROM_DEVICE invalidate needed if sp    
 80         case DMA_FROM_DEVICE:                     
 81         case DMA_BIDIRECTIONAL:                   
 82                 dma_cache_inv(paddr, size);       
 83                 break;                            
 84                                                   
 85         default:                                  
 86                 break;                            
 87         }                                         
 88 }                                                 
 89                                                   
 90 /*                                                
 91  * Plug in direct dma map ops.                    
 92  */                                               
 93 void arch_setup_dma_ops(struct device *dev, bo    
 94 {                                                 
 95         /*                                        
 96          * IOC hardware snoops all DMA traffic    
 97          * with memory - eliding need for any     
 98          * DMA buffers.                           
 99          */                                       
100         if (is_isa_arcv2() && ioc_enable && co    
101                 dev->dma_coherent = true;         
102                                                   
103         dev_info(dev, "use %scoherent DMA ops\    
104                  dev->dma_coherent ? "" : "non    
105 }                                                 
106                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php