Some irqchip drivers need to take the generic chip lock outside of the irq context. Provide the irq_gc_{lock_irqsave,unlock_irqrestore}() helpers to allow one to disable irqs while entering a critical section protected by gc->lock. Note that we do not provide optimized version of these helpers for !SMP, because they are not called from the hot-path. [ tglx: Added a comment when these helpers should be [not] used ]
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -945,6 +945,16 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { } · 944 unmodified lines | |||
| 945 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } | 945 | static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } |
| 946 | #endif | 946 | #endif |
| 947 | 947 | ||
| 948 | /* | ||
| 949 | * The irqsave variants are for usage in non interrupt code. Do not use | ||
| 950 | * them in irq_chip callbacks. Use irq_gc_lock() instead. | ||
| 951 | */ | ||
| 952 | #define irq_gc_lock_irqsave(gc, flags) \ | ||
| 953 | raw_spin_lock_irqsave(&(gc)->lock, flags) | ||
| 954 | |||
| 955 | #define irq_gc_unlock_irqrestore(gc, flags) \ | ||
| 956 | raw_spin_unlock_irqrestore(&(gc)->lock, flags) | ||
| 957 | |||
| 948 | static inline void irq_reg_writel(struct irq_chip_generic *gc, | 958 | static inline void irq_reg_writel(struct irq_chip_generic *gc, |
| 949 | u32 val, int reg_offset) | 959 | u32 val, int reg_offset) |
| 950 | { | 960 | { |