[tip:irq/urgent] genirq: Provide a lockdep helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  d3e17deb1790ee2123e9d11420be6411d1768b47
Gitweb:     http://git.kernel.org/tip/d3e17deb1790ee2123e9d11420be6411d1768b47
Author:     Thomas Gleixner <tglx@xxxxxxxxxxxxx>
AuthorDate: Tue, 22 Mar 2011 17:08:15 +0100
Committer:  Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Wed, 23 Mar 2011 20:22:06 +0100

genirq: Provide a lockdep helper

Some irq chips need to call genirq functions for nested chips from
their callbacks. That upsets lockdep. So they need to set a different
lock class for those nested chips. Provide a helper function to avoid
open access to irq_desc.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
 include/linux/irqdesc.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 0b30662..1595f91 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -191,6 +191,15 @@ static inline void __set_irq_handler_unlocked(int irq,
 	desc->handle_irq = handler;
 }
 
+static inline void
+irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+
+	if (desc)
+		lockdep_set_class(&desc->lock, class);
+}
+
 #ifdef CONFIG_IRQ_PREFLOW_FASTEOI
 static inline void
 __irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux