diff mbox series

firmware: arm_scmi: Fix virtio transport Kconfig dependency

Message ID 20210816141609.41751-1-cristian.marussi@arm.com (mailing list archive)
State New
Headers show
Series firmware: arm_scmi: Fix virtio transport Kconfig dependency | expand

Commit Message

Cristian Marussi Aug. 16, 2021, 2:16 p.m. UTC
ARM_SCMI_TRANSPORT_VIRTIO is a 'bool' Kconfig used to include support for
the SCMI virtio transport inside the core SCMI stack; a bare transport
dependency attached here to this option, though, cannot be properly
propagated to the parent ARM_SCMI_PROTOCOL option and, as a result, it is
currently possible to configure a Kernel where SCMI core is builtin
and includes support for virtio while VirtIO core is =m.
This allowed combination breaks linking:

	ARM_SCMI_PROTOCOL=y
	ARM_SCMI_TRANSPORT_VIRTIO=y
	VIRTIO=m

Bind the dependency in ARM_SCMI_TRANSPORT_VIRTIO to the chosen kind of
compilation of ARM_SCMI_PROTOCOL.

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 drivers/firmware/arm_scmi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Aug. 16, 2021, 2:30 p.m. UTC | #1
On Mon, Aug 16, 2021 at 4:16 PM Cristian Marussi
<cristian.marussi@arm.com> wrote:
>
> ARM_SCMI_TRANSPORT_VIRTIO is a 'bool' Kconfig used to include support for
> the SCMI virtio transport inside the core SCMI stack; a bare transport
> dependency attached here to this option, though, cannot be properly
> propagated to the parent ARM_SCMI_PROTOCOL option and, as a result, it is
> currently possible to configure a Kernel where SCMI core is builtin
> and includes support for virtio while VirtIO core is =m.
> This allowed combination breaks linking:
>
>         ARM_SCMI_PROTOCOL=y
>         ARM_SCMI_TRANSPORT_VIRTIO=y
>         VIRTIO=m
>
> Bind the dependency in ARM_SCMI_TRANSPORT_VIRTIO to the chosen kind of
> compilation of ARM_SCMI_PROTOCOL.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Arnd Bergmann <arnd@kernel.org>
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

The description looks good

Acked-by: Arnd Bergmann <arnd@arndb.de>

> @@ -68,7 +68,7 @@ config ARM_SCMI_TRANSPORT_SMC
>
>  config ARM_SCMI_TRANSPORT_VIRTIO
>         bool "SCMI transport based on VirtIO"
> -       depends on VIRTIO
> +       depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
>         select ARM_SCMI_HAVE_TRANSPORT
>         select ARM_SCMI_HAVE_MSG

Looking at this again, I noticed that this still needs the explicit
'depends on VIRTIO' line you removed, otherwise the prompt
pops up when both VIRTIO and ARM_SCMI_PROTOCOL
are disabled.

       Arnd
Cristian Marussi Aug. 16, 2021, 2:47 p.m. UTC | #2
On Mon, Aug 16, 2021 at 04:30:10PM +0200, Arnd Bergmann wrote:
> On Mon, Aug 16, 2021 at 4:16 PM Cristian Marussi
> <cristian.marussi@arm.com> wrote:
> >
> > ARM_SCMI_TRANSPORT_VIRTIO is a 'bool' Kconfig used to include support for
> > the SCMI virtio transport inside the core SCMI stack; a bare transport
> > dependency attached here to this option, though, cannot be properly
> > propagated to the parent ARM_SCMI_PROTOCOL option and, as a result, it is
> > currently possible to configure a Kernel where SCMI core is builtin
> > and includes support for virtio while VirtIO core is =m.
> > This allowed combination breaks linking:
> >
> >         ARM_SCMI_PROTOCOL=y
> >         ARM_SCMI_TRANSPORT_VIRTIO=y
> >         VIRTIO=m
> >
> > Bind the dependency in ARM_SCMI_TRANSPORT_VIRTIO to the chosen kind of
> > compilation of ARM_SCMI_PROTOCOL.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Suggested-by: Arnd Bergmann <arnd@kernel.org>
> > Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
> 

Hi,

> The description looks good
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 
> > @@ -68,7 +68,7 @@ config ARM_SCMI_TRANSPORT_SMC
> >
> >  config ARM_SCMI_TRANSPORT_VIRTIO
> >         bool "SCMI transport based on VirtIO"
> > -       depends on VIRTIO
> > +       depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
> >         select ARM_SCMI_HAVE_TRANSPORT
> >         select ARM_SCMI_HAVE_MSG
> 
> Looking at this again, I noticed that this still needs the explicit
> 'depends on VIRTIO' line you removed, otherwise the prompt
> pops up when both VIRTIO and ARM_SCMI_PROTOCOL
> are disabled.

I checked this (VIRTIO=n with ARM_SCMI_PROTOCOL=n) and
ARM_SCMI_TRANSPORT_VIRTIO menu does not popup because the whole
menuconfig section under ARM_SCMI_PROTOCOL is already guarded by:

if ARM_SCMI_PROTOCOL

config ARM_SCMI_TRANSPORT_VIRTIO
...

endif

...if this was what you meant.

Thanks,
Cristian
Arnd Bergmann Aug. 16, 2021, 3:29 p.m. UTC | #3
On Mon, Aug 16, 2021 at 4:47 PM Cristian Marussi
<cristian.marussi@arm.com> wrote:
> On Mon, Aug 16, 2021 at 04:30:10PM +0200, Arnd Bergmann wrote:

>
> I checked this (VIRTIO=n with ARM_SCMI_PROTOCOL=n) and
> ARM_SCMI_TRANSPORT_VIRTIO menu does not popup because the whole
> menuconfig section under ARM_SCMI_PROTOCOL is already guarded by:
>
> if ARM_SCMI_PROTOCOL
>
> config ARM_SCMI_TRANSPORT_VIRTIO
> ...
>
> endif
>
> ...if this was what you meant.

Yes, your patch is fine then, ignore my previous comment.

        Arnd
Sudeep Holla Aug. 19, 2021, 5:39 a.m. UTC | #4
On Mon, 16 Aug 2021 15:16:09 +0100, Cristian Marussi wrote:
> ARM_SCMI_TRANSPORT_VIRTIO is a 'bool' Kconfig used to include support for
> the SCMI virtio transport inside the core SCMI stack; a bare transport
> dependency attached here to this option, though, cannot be properly
> propagated to the parent ARM_SCMI_PROTOCOL option and, as a result, it is
> currently possible to configure a Kernel where SCMI core is builtin
> and includes support for virtio while VirtIO core is =m.
> This allowed combination breaks linking:
> 
> [...]

Applied to sudeep.holla/linux (for-linux-next), thanks!

[1/1] firmware: arm_scmi: Fix virtio transport Kconfig dependency
      https://git.kernel.org/sudeep.holla/c/7b42623789
--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
index 7f4d2435503b..3d7081e84853 100644
--- a/drivers/firmware/arm_scmi/Kconfig
+++ b/drivers/firmware/arm_scmi/Kconfig
@@ -68,7 +68,7 @@  config ARM_SCMI_TRANSPORT_SMC
 
 config ARM_SCMI_TRANSPORT_VIRTIO
 	bool "SCMI transport based on VirtIO"
-	depends on VIRTIO
+	depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
 	select ARM_SCMI_HAVE_TRANSPORT
 	select ARM_SCMI_HAVE_MSG
 	help