Re: [PATCH] virtio: console: Prepare for making REMOTEPROC modular

From: Amit Shah
Date: Fri Feb 14 2025 - 11:56:01 EST


On Fri, 2025-02-14 at 17:52 +0100, Uwe Kleine-König wrote:
> Hello Amit,
>
> On Fri, Feb 14, 2025 at 05:37:52PM +0100, Amit Shah wrote:
> > I'm thinking of the two combinations of interest: REMOTEPROC=m,
> > VIRTIO_CONSOLE can be y or m.  Say virtcons_probe() happens when
> > the
> > remoteproc module isn't yet loaded.  Even after later loading
> > remoteproc, virtio console won't do anything interesting with
> > remoteproc.
>
> Where does the interesting thing happen if remoteproc is already
> loaded
> at that time? I'm not seeing anything interesting in that case either
> ...

The code I pointed to,

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/virtio_console.c#n1993

either enables remoteproc if the module is present; or it enables
multiport, but not both at the same time. If remoteproc isn't present
when this probe routine is executed, multiport might get enabled. And
then there's no chance for remoteproc to get enabled.

Amit