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

TOMOYO Linux Cross Reference
Linux/arch/riscv/kernel/sbi-ipi.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/riscv/kernel/sbi-ipi.c (Version linux-6.12-rc7) and /arch/sparc/kernel/sbi-ipi.c (Version linux-6.6.58)


** Warning: Cannot open xref database.

  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * Multiplex several IPIs over a single HW IPI    
  4  *                                                
  5  * Copyright (c) 2022 Ventana Micro Systems In    
  6  */                                               
  7                                                   
  8 #define pr_fmt(fmt) "riscv: " fmt                 
  9 #include <linux/cpu.h>                            
 10 #include <linux/init.h>                           
 11 #include <linux/irq.h>                            
 12 #include <linux/irqchip/chained_irq.h>            
 13 #include <linux/irqdomain.h>                      
 14 #include <asm/sbi.h>                              
 15                                                   
 16 DEFINE_STATIC_KEY_FALSE(riscv_sbi_for_rfence);    
 17 EXPORT_SYMBOL_GPL(riscv_sbi_for_rfence);          
 18                                                   
 19 static int sbi_ipi_virq;                          
 20                                                   
 21 static void sbi_ipi_handle(struct irq_desc *de    
 22 {                                                 
 23         struct irq_chip *chip = irq_desc_get_c    
 24                                                   
 25         chained_irq_enter(chip, desc);            
 26                                                   
 27         csr_clear(CSR_IP, IE_SIE);                
 28         ipi_mux_process();                        
 29                                                   
 30         chained_irq_exit(chip, desc);             
 31 }                                                 
 32                                                   
 33 static int sbi_ipi_starting_cpu(unsigned int c    
 34 {                                                 
 35         enable_percpu_irq(sbi_ipi_virq, irq_ge    
 36         return 0;                                 
 37 }                                                 
 38                                                   
 39 void __init sbi_ipi_init(void)                    
 40 {                                                 
 41         int virq;                                 
 42         struct irq_domain *domain;                
 43                                                   
 44         if (riscv_ipi_have_virq_range())          
 45                 return;                           
 46                                                   
 47         domain = irq_find_matching_fwnode(risc    
 48                                           DOMA    
 49         if (!domain) {                            
 50                 pr_err("unable to find INTC IR    
 51                 return;                           
 52         }                                         
 53                                                   
 54         sbi_ipi_virq = irq_create_mapping(doma    
 55         if (!sbi_ipi_virq) {                      
 56                 pr_err("unable to create INTC     
 57                 return;                           
 58         }                                         
 59                                                   
 60         virq = ipi_mux_create(BITS_PER_BYTE, s    
 61         if (virq <= 0) {                          
 62                 pr_err("unable to create muxed    
 63                 irq_dispose_mapping(sbi_ipi_vi    
 64                 return;                           
 65         }                                         
 66                                                   
 67         irq_set_chained_handler(sbi_ipi_virq,     
 68                                                   
 69         /*                                        
 70          * Don't disable IPI when CPU goes off    
 71          * the masking/unmasking of virtual IP    
 72          * via generic IPI-Mux                    
 73          */                                       
 74         cpuhp_setup_state(CPUHP_AP_IRQ_RISCV_S    
 75                           "irqchip/sbi-ipi:sta    
 76                           sbi_ipi_starting_cpu    
 77                                                   
 78         riscv_ipi_set_virq_range(virq, BITS_PE    
 79         pr_info("providing IPIs using SBI IPI     
 80                                                   
 81         /*                                        
 82          * Use the SBI remote fence extension     
 83          * the extra context switch needed to     
 84          */                                       
 85         static_branch_enable(&riscv_sbi_for_rf    
 86 }                                                 
 87                                                   

~ [ 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