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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-versatile/platsmp.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/arm/mach-versatile/platsmp.c (Version linux-6.12-rc7) and /arch/sparc/mach-versatile/platsmp.c (Version linux-6.7.12)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  *  Copyright (C) 2002 ARM Ltd.                   
  4  *  All Rights Reserved                           
  5  *                                                
  6  * This code is specific to the hardware found    
  7  * Versatile Express platforms where the CPUs     
  8  * woken, and where there is no way to hot-unp    
  9  * should not copy this code.                     
 10  */                                               
 11 #include <linux/init.h>                           
 12 #include <linux/errno.h>                          
 13 #include <linux/delay.h>                          
 14 #include <linux/device.h>                         
 15 #include <linux/jiffies.h>                        
 16 #include <linux/smp.h>                            
 17                                                   
 18 #include <asm/cacheflush.h>                       
 19 #include <asm/smp_plat.h>                         
 20                                                   
 21 #include "platsmp.h"                              
 22                                                   
 23 /*                                                
 24  * versatile_cpu_release controls the release     
 25  * pen in headsmp.S, which exists because we a    
 26  * control the release of individual CPUs from    
 27  * Production platforms do not need this.         
 28  */                                               
 29 volatile int versatile_cpu_release = -1;          
 30                                                   
 31 /*                                                
 32  * Write versatile_cpu_release in a way that i    
 33  * all observers, irrespective of whether they    
 34  * or not.  This is necessary for the hotplug     
 35  */                                               
 36 static void versatile_write_cpu_release(int va    
 37 {                                                 
 38         versatile_cpu_release = val;              
 39         smp_wmb();                                
 40         sync_cache_w(&versatile_cpu_release);     
 41 }                                                 
 42                                                   
 43 /*                                                
 44  * versatile_lock exists to avoid running the     
 45  * calibrations on the secondary CPU while the    
 46  * the limited-bandwidth bus - which affects t    
 47  * Production platforms do not need this.         
 48  */                                               
 49 static DEFINE_RAW_SPINLOCK(versatile_lock);       
 50                                                   
 51 void versatile_secondary_init(unsigned int cpu    
 52 {                                                 
 53         /*                                        
 54          * let the primary processor know we'r    
 55          * pen, then head off into the C entry    
 56          */                                       
 57         versatile_write_cpu_release(-1);          
 58                                                   
 59         /*                                        
 60          * Synchronise with the boot thread.      
 61          */                                       
 62         raw_spin_lock(&versatile_lock);           
 63         raw_spin_unlock(&versatile_lock);         
 64 }                                                 
 65                                                   
 66 int versatile_boot_secondary(unsigned int cpu,    
 67 {                                                 
 68         unsigned long timeout;                    
 69                                                   
 70         /*                                        
 71          * Set synchronisation state between t    
 72          * and the secondary one                  
 73          */                                       
 74         raw_spin_lock(&versatile_lock);           
 75                                                   
 76         /*                                        
 77          * This is really belt and braces; we     
 78          * CPUs in the holding pen until we're    
 79          * since we haven't sent them a soft i    
 80          * be there.                              
 81          */                                       
 82         versatile_write_cpu_release(cpu_logica    
 83                                                   
 84         /*                                        
 85          * Send the secondary CPU a soft inter    
 86          * the boot monitor to read the system    
 87          * and branch to the address found the    
 88          */                                       
 89         arch_send_wakeup_ipi_mask(cpumask_of(c    
 90                                                   
 91         timeout = jiffies + (1 * HZ);             
 92         while (time_before(jiffies, timeout))     
 93                 smp_rmb();                        
 94                 if (versatile_cpu_release == -    
 95                         break;                    
 96                                                   
 97                 udelay(10);                       
 98         }                                         
 99                                                   
100         /*                                        
101          * now the secondary core is starting     
102          * calibrations, then wait for it to f    
103          */                                       
104         raw_spin_unlock(&versatile_lock);         
105                                                   
106         return versatile_cpu_release != -1 ? -    
107 }                                                 
108                                                   

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