All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] genirq: Provide irq_gc_{lock_irqsave,unlock_irqrestore}() helpers
@ 2016-09-13 13:58 Boris Brezillon
  2016-09-13 13:58 ` [PATCH v3 2/2] irqchip/atmel-aic: Fix potential deadlock in ->xlate() Boris Brezillon
  2016-09-13 15:04 ` [tip:irq/urgent] genirq: Provide irq_gc_{lock_irqsave,unlock_irqrestore}() helpers tip-bot for Boris Brezillon
  0 siblings, 2 replies; 5+ messages in thread
From: Boris Brezillon @ 2016-09-13 13:58 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier
  Cc: Nicolas Ferre, Alexandre Belloni, linux-kernel, Boris Brezillon,
	stable

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.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: <stable@vger.kernel.org>
---
 include/linux/irq.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index b52424eaa0ed..b13668f97648 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -945,6 +945,12 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
 static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
 #endif
 
+#define irq_gc_lock_irqsave(gc, flags)	\
+	raw_spin_lock_irqsave(&(gc)->lock, flags)
+
+#define irq_gc_unlock_irqrestore(gc, flags)	\
+	raw_spin_unlock_irqrestore(&(gc)->lock, flags)
+
 static inline void irq_reg_writel(struct irq_chip_generic *gc,
 				  u32 val, int reg_offset)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-13 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-13 13:58 [PATCH v3 1/2] genirq: Provide irq_gc_{lock_irqsave,unlock_irqrestore}() helpers Boris Brezillon
2016-09-13 13:58 ` [PATCH v3 2/2] irqchip/atmel-aic: Fix potential deadlock in ->xlate() Boris Brezillon
2016-09-13 14:15   ` Boris Brezillon
2016-09-13 15:04   ` [tip:irq/urgent] " tip-bot for Boris Brezillon
2016-09-13 15:04 ` [tip:irq/urgent] genirq: Provide irq_gc_{lock_irqsave,unlock_irqrestore}() helpers tip-bot for Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.