mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	genirq: Introduce helper functions to support stacked irq_chip
Now we already support hierarchy irq_data, so introduce several helpers to support stacked irq_chips. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Yingjoe Chen <yingjoe.chen@mediatek.com> Cc: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
		
							parent
							
								
									0cc01abab6
								
							
						
					
					
						commit
						85f08c17de
					
				
					 2 changed files with 33 additions and 0 deletions
				
			
		| 
						 | 
					@ -443,6 +443,11 @@ extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
 | 
				
			||||||
extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
 | 
					extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
 | 
				
			||||||
extern void handle_nested_irq(unsigned int irq);
 | 
					extern void handle_nested_irq(unsigned int irq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
 | 
				
			||||||
 | 
					extern void irq_chip_ack_parent(struct irq_data *data);
 | 
				
			||||||
 | 
					extern int irq_chip_retrigger_hierarchy(struct irq_data *data);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handling of unhandled and spurious interrupts: */
 | 
					/* Handling of unhandled and spurious interrupts: */
 | 
				
			||||||
extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
 | 
					extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
 | 
				
			||||||
			   irqreturn_t action_ret);
 | 
								   irqreturn_t action_ret);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -850,3 +850,31 @@ void irq_cpu_offline(void)
 | 
				
			||||||
		raw_spin_unlock_irqrestore(&desc->lock, flags);
 | 
							raw_spin_unlock_irqrestore(&desc->lock, flags);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * irq_chip_ack_parent - Acknowledge the parent interrupt
 | 
				
			||||||
 | 
					 * @data:	Pointer to interrupt specific data
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					void irq_chip_ack_parent(struct irq_data *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						data = data->parent_data;
 | 
				
			||||||
 | 
						data->chip->irq_ack(data);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * irq_chip_retrigger_hierarchy - Retrigger an interrupt in hardware
 | 
				
			||||||
 | 
					 * @data:	Pointer to interrupt specific data
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Iterate through the domain hierarchy of the interrupt and check
 | 
				
			||||||
 | 
					 * whether a hw retrigger function exists. If yes, invoke it.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					int irq_chip_retrigger_hierarchy(struct irq_data *data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						for (data = data->parent_data; data; data = data->parent_data)
 | 
				
			||||||
 | 
							if (data->chip && data->chip->irq_retrigger)
 | 
				
			||||||
 | 
								return data->chip->irq_retrigger(data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return -ENOSYS;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue