Skip to contentSkip to conversation

cobalt/intr: Restore support for IRQ sharing

PATCH In review Jan Kiszka 3 participants 4 messages Feb 26, 2025

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cobalt/intr: Restore support for IRQ sharing

From: Jan Kiszka <[email protected]>

This was lost while porting to dovetail: Sharing between OOB interrupts is also with dovetail still possible, we only need to request the right type from the interrupt core.

Fixes b1daf55bdfef ("cobalt/intr: dovetail: implement interrupt management, handling")
---
 kernel/cobalt/dovetail/intr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/cobalt/dovetail/intr.c +5 -2
index 88116c7c89..342eb4cafd 100644
@@ -86,6 +86,7 @@ EXPORT_SYMBOL_GPL(xnintr_destroy);
 int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask)
 {
 	cpumask_t tmp_mask, *effective_mask;
+	unsigned long flags = IRQF_OOB;
 	int ret;
 
 	secondary_mode_only();
@@ -105,9 +106,11 @@ int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask)
 	if (ret)
 		return ret;
 #endif
+	if (intr->flags & XN_IRQTYPE_SHARED)
+		flags |= IRQF_PROBE_SHARED;
 
-	return request_irq(intr->irq, xnintr_irq_handler, IRQF_OOB,
-			intr->name, intr);
+	return request_irq(intr->irq, xnintr_irq_handler, flags,
+			   intr->name, intr);
 }
 EXPORT_SYMBOL_GPL(xnintr_attach);
 
Signature · 1 line
2.43.0
#1 lore raw

Hi,

Quoted 7 lines

-----Ursprüngliche Nachricht-----
Von: Jan Kiszka <[email protected]>
Gesendet: Mittwoch, 26. Februar 2025 06:48
An: Xenomai <[email protected]>
Cc: Johann Obermayr <[email protected]>
Betreff: [PATCH] cobalt/intr: Restore support for IRQ sharing

Quoted 7 lines

CAUTION: External E-Mail !

From: Jan Kiszka <[email protected]>

This was lost while porting to dovetail: Sharing between OOB interrupts is also with dovetail still possible, we only need to request the right type from the interrupt core.

Thanks, i will test your patch.

Johann

Quoted 37 lines
Fixes b1daf55bdfef ("cobalt/intr: dovetail: implement interrupt management,

handling")

---
 kernel/cobalt/dovetail/intr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/cobalt/dovetail/intr.c index renamed from kernel/cobalt/dovetail/intr.c +0 -0

88116c7c89..342eb4cafd 100644

kernel/cobalt/dovetail/intr.c +5 -3
@@ -86,6 +86,7 @@ EXPORT_SYMBOL_GPL(xnintr_destroy);
 int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask)
 {
        cpumask_t tmp_mask, *effective_mask;
+       unsigned long flags = IRQF_OOB;
        int ret;
 
        secondary_mode_only();
@@ -105,9 +106,11 @@ int xnintr_attach(struct xnintr *intr, void *cookie,
 const cpumask_t *cpumask)
        if (ret)
                return ret;
 #endif
+       if (intr->flags & XN_IRQTYPE_SHARED)
+               flags |= IRQF_PROBE_SHARED;
 
-       return request_irq(intr->irq, xnintr_irq_handler, IRQF_OOB,
-                       intr->name, intr);
+       return request_irq(intr->irq, xnintr_irq_handler, flags,
+                          intr->name, intr);
 }
 EXPORT_SYMBOL_GPL(xnintr_attach);
 
--

2.43.0

#2 lore raw
In reply to Jan Kiszka

kernel/cobalt/dovetail/intr.c int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask) · line 110

Quoted 2 lines · Jan Kiszka
kernel/cobalt/dovetail/intr.c +2 -0
+       if (intr->flags & XN_IRQTYPE_SHARED)
+               flags |= IRQF_PROBE_SHARED;

Hmm, I expected IRQF_SHARED | IRQF_PROBE_SHARED.
Why is IRQF_PROBE_SHARED alone sufficient?

Signature · 2 lines
Thanks,
//richard
author
#3 lore raw
Quoted 7 lines · Richard Weinberger

kernel/cobalt/dovetail/intr.c int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask) · line 110

Quoted 2 lines · Jan Kiszka
kernel/cobalt/dovetail/intr.c +2 -0
+       if (intr->flags & XN_IRQTYPE_SHARED)
+               flags |= IRQF_PROBE_SHARED;

Hmm, I expected IRQF_SHARED | IRQF_PROBE_SHARED.
Why is IRQF_PROBE_SHARED alone sufficient?

Look at the time when I sent the patch...

I only looked at the line that threw the error in Johann's case, rather than at the semantic of the IRQF bits.

V2 on the way.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center