All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>,
	xenomai@lists.linux.dev, Greg Gallagher <greg@embeddedgreg.com>
Subject: Re: [ipipe 4.19][RFC PATCH] ipipe: Do not report spurious interrupts by using printk
Date: Fri, 25 Nov 2022 13:59:16 +0100	[thread overview]
Message-ID: <878rjzmbm2.fsf@xenomai.org> (raw)
In-Reply-To: <8e95dbd6-b120-11a0-8c30-ce4f29b1ec84@siemens.com>


Jan Kiszka <jan.kiszka@siemens.com> writes:

> On 25.11.22 10:08, Florian Bezdeka wrote:
>> 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);
>>  }
>
> Is this issue 4.19-specific, resolved in 5.4? Or in dovetail?

Dovetail has no such issue because unstalling the in-band stage does not
re-enable hard irqs.

-- 
Philippe.

  parent reply	other threads:[~2022-11-25 13:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-11-29 12:54     ` Florian Bezdeka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rjzmbm2.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=florian.bezdeka@siemens.com \
    --cc=greg@embeddedgreg.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.