mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	irqchip/sifive-plic: Fix syscore registration for multi-socket systems
Multi-socket systems have a separate PLIC in each socket, so __plic_init()
is invoked for each PLIC. __plic_init() registers syscore operations, which
obviously fails on the second invocation.
Move it into the already existing condition for installing the CPU hotplug
state so it is only invoked once when the first PLIC is initialized.
[ tglx: Massaged changelog ]
Fixes: e80f0b6a2c ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20231025142820.390238-4-apatel@ventanamicro.com
			
			
This commit is contained in:
		
							parent
							
								
									08d4c17482
								
							
						
					
					
						commit
						f99b926f65
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -532,17 +532,18 @@ static int __init __plic_init(struct device_node *node,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * We can have multiple PLIC instances so setup cpuhp state only
 | 
						 * We can have multiple PLIC instances so setup cpuhp state
 | 
				
			||||||
	 * when context handler for current/boot CPU is present.
 | 
						 * and register syscore operations only when context handler
 | 
				
			||||||
 | 
						 * for current/boot CPU is present.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	handler = this_cpu_ptr(&plic_handlers);
 | 
						handler = this_cpu_ptr(&plic_handlers);
 | 
				
			||||||
	if (handler->present && !plic_cpuhp_setup_done) {
 | 
						if (handler->present && !plic_cpuhp_setup_done) {
 | 
				
			||||||
		cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
 | 
							cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
 | 
				
			||||||
				  "irqchip/sifive/plic:starting",
 | 
									  "irqchip/sifive/plic:starting",
 | 
				
			||||||
				  plic_starting_cpu, plic_dying_cpu);
 | 
									  plic_starting_cpu, plic_dying_cpu);
 | 
				
			||||||
 | 
							register_syscore_ops(&plic_irq_syscore_ops);
 | 
				
			||||||
		plic_cpuhp_setup_done = true;
 | 
							plic_cpuhp_setup_done = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	register_syscore_ops(&plic_irq_syscore_ops);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pr_info("%pOFP: mapped %d interrupts with %d handlers for"
 | 
						pr_info("%pOFP: mapped %d interrupts with %d handlers for"
 | 
				
			||||||
		" %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts);
 | 
							" %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue