mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ARM: 6806/1: irq: introduce entry and exit functions for chained handlers
Some chained IRQ handlers are written to cope with primary chips of potentially different flow types. Whether this a sensible thing to do is a point of contention. This patch introduces entry/exit functions for chained handlers which infer the flow type of the primary chip as fasteoi or level-type by checking whether or not the ->irq_eoi function pointer is present and calling back to the primary chip as necessary. Other methods of flow control are not considered. Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									6f685c5cdd
								
							
						
					
					
						commit
						10a8c38398
					
				
					 1 changed files with 31 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -34,4 +34,35 @@ do {							\
 | 
			
		|||
	raw_spin_unlock(&desc->lock);			\
 | 
			
		||||
} while(0)
 | 
			
		||||
 | 
			
		||||
#ifndef __ASSEMBLY__
 | 
			
		||||
/*
 | 
			
		||||
 * Entry/exit functions for chained handlers where the primary IRQ chip
 | 
			
		||||
 * may implement either fasteoi or level-trigger flow control.
 | 
			
		||||
 */
 | 
			
		||||
static inline void chained_irq_enter(struct irq_chip *chip,
 | 
			
		||||
				     struct irq_desc *desc)
 | 
			
		||||
{
 | 
			
		||||
	/* FastEOI controllers require no action on entry. */
 | 
			
		||||
	if (chip->irq_eoi)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (chip->irq_mask_ack) {
 | 
			
		||||
		chip->irq_mask_ack(&desc->irq_data);
 | 
			
		||||
	} else {
 | 
			
		||||
		chip->irq_mask(&desc->irq_data);
 | 
			
		||||
		if (chip->irq_ack)
 | 
			
		||||
			chip->irq_ack(&desc->irq_data);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void chained_irq_exit(struct irq_chip *chip,
 | 
			
		||||
				    struct irq_desc *desc)
 | 
			
		||||
{
 | 
			
		||||
	if (chip->irq_eoi)
 | 
			
		||||
		chip->irq_eoi(&desc->irq_data);
 | 
			
		||||
	else
 | 
			
		||||
		chip->irq_unmask(&desc->irq_data);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue