From: Amit Shah <amit@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] virtio: console: Prepare for making REMOTEPROC modular
Date: Fri, 14 Feb 2025 11:58:44 +0100 [thread overview]
Message-ID: <34cb36503dae7a2d0ba94d1c367004a2d901e13b.camel@kernel.org> (raw)
In-Reply-To: <20250213115517.82975-2-u.kleine-koenig@baylibre.com>
On Thu, 2025-02-13 at 12:55 +0100, Uwe Kleine-König wrote:
> virtio_console.c can make use of REMOTEPROC. Therefore it has several
> tests evaluating
>
> IS_ENABLED(CONFIG_REMOTEPROC)
>
> . This currently only does the right thing because CONFIG_REMOTEPROC
> cannot be modular. Otherwise the configuration
>
> CONFIG_REMOTEPROC=m
> CONFIG_VIRTIO_CONSOLE=y
>
> would result in a build failure because then
> IS_ENABLED(CONFIG_REMOTEPROC) evaluates to true but still the built-
> in
> virtio_console.o must not use symbols from the remoteproc module.
>
> To prepare for making REMOTEPROC modular change the tests to use
> IS_REACHABLE() instead of IS_ENABLED() which copes correctly for the
> above case as it evaluates to false then.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> Hello,
>
> I didn't check what else needs to be done to make CONFIG_REMOTEPROC
> tristate but even if it stays a bool using IS_REACHABLE() is still
> the
> better choice.
It might lead to a false sense of "better" -- the value of IS_ENABLED
is cached in a variable which is determined at compile-time. That
caching, after this change, moves to driver init-time. If the rproc
module is loaded after virtio-console is initialized, there's no way
it's going to be used. Only if the rproc module is loaded before
virtio-console will the rproc functionality be used -- which means that
nothing changed in reality..
To properly detect and use rproc if available would need the rproc
initialization out of virtcons_probe() and into something that happens
either via sysfs for existing ports, or when adding a new port to a
device. However, the current spec doesn't allow for that, so some more
changes will need to be made to ensure current backwards compat, and a
new specification that allows for a late init of rproc.
Amit
next prev parent reply other threads:[~2025-02-14 10:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 11:55 [PATCH] virtio: console: Prepare for making REMOTEPROC modular Uwe Kleine-König
2025-02-14 10:58 ` Amit Shah [this message]
2025-02-14 11:14 ` Uwe Kleine-König
2025-02-14 13:32 ` Amit Shah
2025-02-14 16:13 ` Uwe Kleine-König
2025-02-14 16:37 ` Amit Shah
2025-02-14 16:52 ` Uwe Kleine-König
2025-02-14 16:55 ` Amit Shah
2025-02-14 17:47 ` Uwe Kleine-König
2025-02-17 10:53 ` Amit Shah
2025-02-17 10:59 ` Amit Shah
2025-02-18 9:49 ` Amit Shah
2025-02-17 16:06 ` Uwe Kleine-König
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=34cb36503dae7a2d0ba94d1c367004a2d901e13b.camel@kernel.org \
--to=amit@kernel.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=u.kleine-koenig@baylibre.com \
--cc=virtualization@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox