All of lore.kernel.org
 help / color / mirror / Atom feed
* [ipipe 4.19][RFC PATCH] ipipe: Do not report spurious interrupts by using printk
@ 2022-11-25  9:08 Florian Bezdeka
  2022-11-25 10:53 ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Bezdeka @ 2022-11-25  9:08 UTC (permalink / raw)
  To: xenomai; +Cc: Jan Kiszka, Greg Gallagher, Florian Bezdeka

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---

Hi all,

I need this patch to get the Hikey board (part of the Xenomai CI lab) up
and running. The problem appeared when updating the test images from
Debian 11 to Debian 12 and with that from gcc 10 to gcc 12.

My understanding is:
 - During boot a UART hangup occurs, so we release the IRQ
 - While that happens there is still on IRQ in flight on a different CPU
 - The in-flight IRQ is detected as spurious interrupt
 - We try to report that using printk()

printk() internally calls ipipe_unstall_root() - by using one of the 
_irqrestore() macros/functions - which unconditionally calls 
hard_local_irq_enable() so HW IRQs are enabled now.

I end up in an IRQ stack overflow.

I assume this happens because the UART IRQ is a level-triggered IRQ. So
it simply fires again.

Does that make sense?

How to fix that properly? Ideas welcome...

The problem can be reproduced on the hikey board quite well. Nearly
every boot ends up in the IRQ stack overflow.

Best regards,
Florian
 

 kernel/ipipe/core.c | 2 +-
 kernel/irq/handle.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
index d12e71103424..17ad6f2841f9 100644
--- a/kernel/ipipe/core.c
+++ b/kernel/ipipe/core.c
@@ -1491,7 +1491,7 @@ void __ipipe_dispatch_irq(unsigned int irq, int flags) /* hw interrupts off */
 
 #ifdef CONFIG_IPIPE_DEBUG
 	if (irq >= IPIPE_NR_IRQS) {
-		pr_err("I-pipe: spurious interrupt %u\n", irq);
+		//pr_err("I-pipe: spurious interrupt %u\n", irq);
 		return;
 	}
 #endif
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index e2f7afcb1ae6..1c3221c72977 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -32,7 +32,7 @@ void handle_bad_irq(struct irq_desc *desc)
 {
 	unsigned int irq = irq_desc_get_irq(desc);
 
-	print_irq_desc(irq, desc);
+	//print_irq_desc(irq, desc);
 	kstat_incr_irqs_this_cpu(desc);
 	ack_bad_irq(irq);
 }
-- 
2.35.1


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

end of thread, other threads:[~2022-11-29 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-25  9:08 [ipipe 4.19][RFC PATCH] ipipe: Do not report spurious interrupts by using printk Florian Bezdeka
2022-11-25 10:53 ` Jan Kiszka
2022-11-25 11:11   ` Florian Bezdeka
2022-11-25 12:59   ` Philippe Gerum
2022-11-29 12:54     ` Florian Bezdeka

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.