mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-03 18:20:25 +02:00 
			
		
		
		
	genirq/manage: Rework enable_percpu_irq()
Use the new guards to get and lock the interrupt descriptor and tidy up the code. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065422.315844964@linutronix.de
This commit is contained in:
		
							parent
							
								
									90140d08ac
								
							
						
					
					
						commit
						508bd94c3a
					
				
					 1 changed files with 15 additions and 25 deletions
				
			
		| 
						 | 
					@ -2286,12 +2286,8 @@ int request_nmi(unsigned int irq, irq_handler_t handler,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void enable_percpu_irq(unsigned int irq, unsigned int type)
 | 
					void enable_percpu_irq(unsigned int irq, unsigned int type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	unsigned int cpu = smp_processor_id();
 | 
						scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_PERCPU) {
 | 
				
			||||||
	unsigned long flags;
 | 
							struct irq_desc *desc = scoped_irqdesc;
 | 
				
			||||||
	struct irq_desc *desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (!desc)
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * If the trigger type is not specified by the caller, then
 | 
							 * If the trigger type is not specified by the caller, then
 | 
				
			||||||
| 
						 | 
					@ -2302,19 +2298,13 @@ void enable_percpu_irq(unsigned int irq, unsigned int type)
 | 
				
			||||||
			type = irqd_get_trigger_type(&desc->irq_data);
 | 
								type = irqd_get_trigger_type(&desc->irq_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (type != IRQ_TYPE_NONE) {
 | 
							if (type != IRQ_TYPE_NONE) {
 | 
				
			||||||
		int ret;
 | 
								if (__irq_set_trigger(desc, type)) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
		ret = __irq_set_trigger(desc, type);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (ret) {
 | 
					 | 
				
			||||||
				WARN(1, "failed to set type for IRQ%d\n", irq);
 | 
									WARN(1, "failed to set type for IRQ%d\n", irq);
 | 
				
			||||||
			goto out;
 | 
									return;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							irq_percpu_enable(desc, smp_processor_id());
 | 
				
			||||||
	irq_percpu_enable(desc, cpu);
 | 
						}
 | 
				
			||||||
out:
 | 
					 | 
				
			||||||
	irq_put_desc_unlock(desc, flags);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(enable_percpu_irq);
 | 
					EXPORT_SYMBOL_GPL(enable_percpu_irq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue