From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Vladimir Kondratiev <Vladimir.Kondratiev@mobileye.com>
Cc: Anup Patel <anup@brainfault.org>,
Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Jessica Liu <liu.xuemei1@zte.com.cn>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH v3] irqchip/riscv-aplic: fix asynchronous probing
Date: Wed, 14 Oct 2026 12:53:12 +0200 [thread overview]
Message-ID: <20261014105312.xNkvgkGg@linutronix.de> (raw)
In-Reply-To: <5a8048ef-a241-4486-adc1-440721d3606a@mobileye.com>
On 2026-10-14 11:15:05 [+0300], Vladimir Kondratiev wrote:
> On 10/13/26 18:27, Sebastian Andrzej Siewior wrote:
> > EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.
> >
> > On 2026-10-12 12:12:59 [+0300], Vladimir Kondratiev wrote:
> >> boolean flag don't protect from race when probing several instances
> >> asynchronously. On system with multiple APLICs, if probed asynchronously,
> >> warning triggered as below.
> >
> > Why is this async? Doesn't __platform_driver_probe() set it to sync?
>
> Yes it does but aplic driver uses
>
> builtin_platform_driver(aplic_driver);
>
> that takes different route. Easy way to directly proof it: I boot with
>
> driver_async_probe=* dyndbg=\"func __driver_attach +p\"
>
> to request asynchronous probe and debug prints in the __driver_attach
> shows:
> [ 0.236483] platform 48760000.interrupt-controller: probing driver riscv-aplic asynchronously
> [ 0.236513] platform 674e0000.interrupt-controller: probing driver riscv-aplic asynchronously
> [ 0.236539] platform 67560000.interrupt-controller: probing driver riscv-aplic asynchronously
Does "driver_async_probe=*" mark _all_ drivers as safe and you run into
a problem where a driver isn't safe? Does the "dyndbg=" argument show
the driver is probed asynchronously if you omit the "driver_async_probe"
argument?
So the question is do we want to let it probe asynchronously or should
we force it to sync.
> > Would you mind providing a coherent description of the problem and
> > implemented solution instead of slapping console output?
>
> Sorry if it was not clear; shall I explain in details why pattern
>
> if (!done) {
> do_something();
> done = true;
> }
>
> is not SMP safe? Add detailed explanation to commit message and shorten console output?
No console output at all. You need to coherently explain the problem
without adding console output. This is a simple problem, there is no
need to for a huge commit message here. Also there is no need for SMP
here as we do have kernel preemption.
> Reason for asynchronous probing is simple - to reduce boot time, it is critical for embedded
> systems. Think of system managing car rear camera and proximity sensors, it should be ready when you
> start driving, this lefts very short time for the kernel to boot.
So the driver does not support async probing and you add it and call it
a fix? I don't mind async probing but it should be declared what the
actual intention is. And maybe the driver should be marked async in the
end.
> >> ---
> >> Changes in v3:
> >> - drop __ro_after_init attribute due to write to read-only page concern
> >
> > What concern? That __ro_after_init can stay. It is built-in only.
> See comment to v2 by sachiko-bot$kernel.org here
> https://lore.kernel.org/all/sashiko-outbox-167856@kernel.org/
> quote:
> ---cut---
> [Severity: High]
>
> Will this trigger a fatal page fault if the probe is deferred?
>
…
> Platform driver probes can be deferred (for instance, waiting for an MSI
>
> domain) and run in a workqueue after the init phase is done.
…
> and indeed, aplic_msi_setup() can return -EPROBE_DEFER so concern is valid and
> existed in original code, it is not related to asynchronous probing
I would not expect the MSI domain to be probed after kernel booting via
a module. This is the scenario where this would explode.
And if you consider this a problem you should address it and denote it
in the commit description as such and not silently changing it as part
of another change without any explanation.
Sebastian
next prev parent reply other threads:[~2026-10-14 10:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 9:12 Vladimir Kondratiev
2026-10-13 15:27 ` Sebastian Andrzej Siewior
2026-10-14 8:15 ` Vladimir Kondratiev
2026-10-14 10:53 ` Sebastian Andrzej Siewior [this message]
2026-10-15 6:19 ` Vladimir Kondratiev
2026-10-15 6:32 ` Sebastian Andrzej Siewior
2026-10-15 8:11 ` Vladimir Kondratiev
2026-10-15 9:56 ` Sebastian Andrzej Siewior
2026-10-15 13:52 ` Vladimir Kondratiev
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=20261014105312.xNkvgkGg@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=Vladimir.Kondratiev@mobileye.com \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=clrkwllms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=liu.xuemei1@zte.com.cn \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=radu@rendec.net \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®