All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <philippe.gerum@gmail.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>,  xenomai@lists.linux.dev
Subject: Re: [PATCH] cobalt/pipe: Fix invalid wait context in xnpipe_wakeup_proc()
Date: Mon, 01 Sep 2025 17:28:12 +0200	[thread overview]
Message-ID: <87zfbe19bn.fsf@xenomai.org> (raw)
In-Reply-To: <bc5c15c2-3423-4d6e-b296-63797ef7ff31@siemens.com> (Jan Kiszka's message of "Mon, 1 Sep 2025 15:51:52 +0200")

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

> On 29.08.25 17:59, Florian Bezdeka wrote:
>> Recent Dovetail versions complained about an invalid wait context in
>> xnpipe_wakeup_proc(). It turned out that this warning is correct as this
>> function is called from the inband IRQ context (while syncing the IRQ
>> log) with hard IRQs enabled and inband stage stalled.
>> 
>> The call graph looks like that:
>> xnpipe_wakeup_proc()
>>     wake_up_interruptible()
>>         __wake_up_common_lock()
>> 	    spin_lock_irqsave() <-- might sleep on PREEMPT_RT
>> 
>
> So, the warning is issued independent of PREEMPT_RT being enabled but
> the bug would be limited to that configuration, right?
>
> Since when is the kernel complaining? It is wrong since PREEMPT_RT is
> available, officially 6.12 then. Then this should go into 3.3-stable as
> well - noted.
>
>> As confirmed by Philippe in the discussion linked below, we have to
>> migrate the wakeup code from using a synthetic IRQ to irq_work to address
>> that issue.
>> 
>
> Hmm, can't we use something that is a thread when needed and an IRQ
> otherwise?
>

Unless PREEMPT_RT is enabled, we can't guarantee threaded handling, but
we can always guarantee irq-based handling by setting IRQ_WORK_HARD_IRQ
for the irq_work struct.

-- 
Philippe.

  reply	other threads:[~2025-09-01 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 15:59 [PATCH] cobalt/pipe: Fix invalid wait context in xnpipe_wakeup_proc() Florian Bezdeka
2025-09-01 13:51 ` Jan Kiszka
2025-09-01 15:28   ` Philippe Gerum [this message]
2025-09-01 16:49     ` Jan Kiszka
2025-09-02  9:13       ` Philippe Gerum
2025-09-02 15:38         ` Jan Kiszka
2025-09-02 21:15   ` Florian Bezdeka
2025-09-02 15:40 ` Jan Kiszka

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=87zfbe19bn.fsf@xenomai.org \
    --to=philippe.gerum@gmail.com \
    --cc=florian.bezdeka@siemens.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.