Skip to contentSkip to conversation

kernel: irq: add releases() notation

PATCH Applied Jules Irenge 2 participants 4 messages Dec 16, 2019 – Jan 9, 2020 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kernel: irq: add releases() notation

Add releases() notation to remove issue detected by sparse tool.
warning: context imbalance in __irq_put_desc_unlock() - unexpected unlock

---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
index 5b8fdd659e54..98a5f10d1900 100644
@@ -891,6 +891,7 @@ __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
 }
 
 void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
+	__releases(&desc->lock)
 {
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	if (bus)
Signature · 1 line
2.23.0
#1 lore raw

PATCH 2/2 kernel: irq: add must_hold() annotation

Add __must_hold() annotation to remove issue detected by sparse tool.
warning: context imbalance in irq_wait_for_poll - unexpected unlock

---
 kernel/irq/spurious.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/spurious.c +1 -0
index 2ed97a7c9b2a..f865e5f4d382 100644
@@ -34,6 +34,7 @@ static atomic_t irq_poll_active;
  * true and let the handler run.
  */
 bool irq_wait_for_poll(struct irq_desc *desc)
+	__must_hold(&desc->lock)
 {
 	if (WARN_ONCE(irq_poll_cpu == smp_processor_id(),
 		      "irq poll in progress on cpu %d for irq %d\n",
Signature · 1 line
2.23.0
merge bot Applied
#2 lore raw

[tip: irq/core] genirq: Add missing __must_hold() sparse annotation

The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     099368bb10c0e340f0b236b169e8b13235e0907c
Gitweb:        https://git.kernel.org/tip/099368bb10c0e340f0b236b169e8b13235e0907c
Author:        Jules Irenge <[email protected]>
AuthorDate:    Mon, 16 Dec 2019 14:42:08 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 09 Jan 2020 18:03:37 +01:00

genirq: Add missing __must_hold() sparse annotation

Add __must_hold() annotation to address the following sparse warning:

warning: context imbalance in irq_wait_for_poll - unexpected unlock

---
 kernel/irq/spurious.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/spurious.c +1 -0
index 2ed97a7..f865e5f 100644
@@ -34,6 +34,7 @@ static atomic_t irq_poll_active;
  * true and let the handler run.
  */
 bool irq_wait_for_poll(struct irq_desc *desc)
+	__must_hold(&desc->lock)
 {
 	if (WARN_ONCE(irq_poll_cpu == smp_processor_id(),
 		      "irq poll in progress on cpu %d for irq %d\n",
merge bot Applied
#3 lore raw

[tip: irq/core] genirq: Add missing __releases() sparse annotation

In reply to Jules Irenge
The following commit has been merged into the irq/core branch of tip:

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     8b3b54799b99de59d25a3947d539662f47300ced
Gitweb:        https://git.kernel.org/tip/8b3b54799b99de59d25a3947d539662f47300ced
Author:        Jules Irenge <[email protected]>
AuthorDate:    Mon, 16 Dec 2019 14:42:07 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 09 Jan 2020 18:03:24 +01:00

genirq: Add missing __releases() sparse annotation

Add __releases() annotation to address the following sparse warning:

warning: context imbalance in __irq_put_desc_unlock() - unexpected unlock

---
 kernel/irq/irqdesc.c | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
index 5b8fdd6..98a5f10 100644
@@ -891,6 +891,7 @@ __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
 }
 
 void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus)
+	__releases(&desc->lock)
 {
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	if (bus)