All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency
@ 2021-09-20 10:02 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2021-09-20 10:02 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Igor Skalkin, Peter Hilber
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building with CONFIG_VIRTIO=m but CONFIG_ARM_SCMI_PROTOCOL=y leads to
a link error for the scmi virtio transport:

arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_send_message':
virtio.c:(.text+0x200): undefined reference to `virtqueue_add_sgs'
arm-linux-gnueabi-ld: virtio.c:(.text+0x280): undefined reference to `virtqueue_kick'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `scmi_vio_feed_vq_rx':
virtio.c:(.text+0x390): undefined reference to `virtqueue_add_inbuf'
arm-linux-gnueabi-ld: virtio.c:(.text+0x3dc): undefined reference to `virtqueue_kick'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_scmi_exit':
virtio.c:(.text+0x538): undefined reference to `unregister_virtio_driver'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_chan_available':

Prevent this configuration by making the Kconfig dependency a bit
stricter.

Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/firmware/arm_scmi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency
@ 2021-09-20 10:02 ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2021-09-20 10:02 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi, Igor Skalkin, Peter Hilber
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building with CONFIG_VIRTIO=m but CONFIG_ARM_SCMI_PROTOCOL=y leads to
a link error for the scmi virtio transport:

arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_send_message':
virtio.c:(.text+0x200): undefined reference to `virtqueue_add_sgs'
arm-linux-gnueabi-ld: virtio.c:(.text+0x280): undefined reference to `virtqueue_kick'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `scmi_vio_feed_vq_rx':
virtio.c:(.text+0x390): undefined reference to `virtqueue_add_inbuf'
arm-linux-gnueabi-ld: virtio.c:(.text+0x3dc): undefined reference to `virtqueue_kick'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_scmi_exit':
virtio.c:(.text+0x538): undefined reference to `unregister_virtio_driver'
arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_chan_available':

Prevent this configuration by making the Kconfig dependency a bit
stricter.

Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/firmware/arm_scmi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] firmware: arm_scmi: remove __exit annotation
  2021-09-20 10:02 ` Arnd Bergmann
@ 2021-09-20 10:02   ` Arnd Bergmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2021-09-20 10:02 UTC (permalink / raw)
  To: Sudeep Holla, Igor Skalkin, Peter Hilber, Cristian Marussi
  Cc: Arnd Bergmann, kernel test robot, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

virtio_scmi_exit() is only called from __exit function, so the annotation
is correct, but when the driver is built-in, the section gets discarded
and the reference from a callback pointer causes a link-time error:

`virtio_scmi_exit' referenced in section `.rodata' of drivers/firmware/arm_scmi/virtio.o: defined in discarded section `.exit.text' of drivers/firmware/arm_scmi/virtio.o

I could not figure out a better workaround, so let's just remove that
annotation even if it wastes a couple of bytes in .text.

Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/firmware/arm_scmi/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/virtio.c b/drivers/firmware/arm_scmi/virtio.c
index 224577f86928..8941bb40f2df 100644
--- a/drivers/firmware/arm_scmi/virtio.c
+++ b/drivers/firmware/arm_scmi/virtio.c
@@ -476,7 +476,7 @@ static int __init virtio_scmi_init(void)
 	return register_virtio_driver(&virtio_scmi_driver);
 }
 
-static void __exit virtio_scmi_exit(void)
+static void virtio_scmi_exit(void)
 {
 	unregister_virtio_driver(&virtio_scmi_driver);
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] firmware: arm_scmi: remove __exit annotation
@ 2021-09-20 10:02   ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2021-09-20 10:02 UTC (permalink / raw)
  To: Sudeep Holla, Igor Skalkin, Peter Hilber, Cristian Marussi
  Cc: Arnd Bergmann, kernel test robot, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

virtio_scmi_exit() is only called from __exit function, so the annotation
is correct, but when the driver is built-in, the section gets discarded
and the reference from a callback pointer causes a link-time error:

`virtio_scmi_exit' referenced in section `.rodata' of drivers/firmware/arm_scmi/virtio.o: defined in discarded section `.exit.text' of drivers/firmware/arm_scmi/virtio.o

I could not figure out a better workaround, so let's just remove that
annotation even if it wastes a couple of bytes in .text.

Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/firmware/arm_scmi/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/virtio.c b/drivers/firmware/arm_scmi/virtio.c
index 224577f86928..8941bb40f2df 100644
--- a/drivers/firmware/arm_scmi/virtio.c
+++ b/drivers/firmware/arm_scmi/virtio.c
@@ -476,7 +476,7 @@ static int __init virtio_scmi_init(void)
 	return register_virtio_driver(&virtio_scmi_driver);
 }
 
-static void __exit virtio_scmi_exit(void)
+static void virtio_scmi_exit(void)
 {
 	unregister_virtio_driver(&virtio_scmi_driver);
 }
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency
  2021-09-20 10:02 ` Arnd Bergmann
@ 2021-09-20 10:48   ` Sudeep Holla
  -1 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2021-09-20 10:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Cristian Marussi, Igor Skalkin, Peter Hilber, Arnd Bergmann,
	linux-arm-kernel, linux-kernel

On Mon, Sep 20, 2021 at 12:02:51PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Building with CONFIG_VIRTIO=m but CONFIG_ARM_SCMI_PROTOCOL=y leads to
> a link error for the scmi virtio transport:
> 
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_send_message':
> virtio.c:(.text+0x200): undefined reference to `virtqueue_add_sgs'
> arm-linux-gnueabi-ld: virtio.c:(.text+0x280): undefined reference to `virtqueue_kick'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `scmi_vio_feed_vq_rx':
> virtio.c:(.text+0x390): undefined reference to `virtqueue_add_inbuf'
> arm-linux-gnueabi-ld: virtio.c:(.text+0x3dc): undefined reference to `virtqueue_kick'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_scmi_exit':
> virtio.c:(.text+0x538): undefined reference to `unregister_virtio_driver'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_chan_available':
> 
> Prevent this configuration by making the Kconfig dependency a bit
> stricter.
> 
> Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/firmware/arm_scmi/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Hi Arnd,

I have already queued similar fix by Cristain[1] a while ago. I was waiting
to get other possible fixes sorted before sending pull request. Sorry for
that, will do that soon.

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/all/20210816141609.41751-1-cristian.marussi@arm.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency
@ 2021-09-20 10:48   ` Sudeep Holla
  0 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2021-09-20 10:48 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Cristian Marussi, Igor Skalkin, Peter Hilber, Arnd Bergmann,
	linux-arm-kernel, linux-kernel

On Mon, Sep 20, 2021 at 12:02:51PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Building with CONFIG_VIRTIO=m but CONFIG_ARM_SCMI_PROTOCOL=y leads to
> a link error for the scmi virtio transport:
> 
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_send_message':
> virtio.c:(.text+0x200): undefined reference to `virtqueue_add_sgs'
> arm-linux-gnueabi-ld: virtio.c:(.text+0x280): undefined reference to `virtqueue_kick'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `scmi_vio_feed_vq_rx':
> virtio.c:(.text+0x390): undefined reference to `virtqueue_add_inbuf'
> arm-linux-gnueabi-ld: virtio.c:(.text+0x3dc): undefined reference to `virtqueue_kick'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_scmi_exit':
> virtio.c:(.text+0x538): undefined reference to `unregister_virtio_driver'
> arm-linux-gnueabi-ld: drivers/firmware/arm_scmi/virtio.o: in function `virtio_chan_available':
> 
> Prevent this configuration by making the Kconfig dependency a bit
> stricter.
> 
> Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/firmware/arm_scmi/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Hi Arnd,

I have already queued similar fix by Cristain[1] a while ago. I was waiting
to get other possible fixes sorted before sending pull request. Sorry for
that, will do that soon.

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/all/20210816141609.41751-1-cristian.marussi@arm.com/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] firmware: arm_scmi: remove __exit annotation
  2021-09-20 10:02   ` Arnd Bergmann
@ 2021-09-20 11:06     ` Sudeep Holla
  -1 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2021-09-20 11:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Igor Skalkin, Peter Hilber, Cristian Marussi, Sudeep Holla,
	Arnd Bergmann, kernel test robot, linux-arm-kernel, linux-kernel

On Mon, Sep 20, 2021 at 12:02:52PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> virtio_scmi_exit() is only called from __exit function, so the annotation
> is correct, but when the driver is built-in, the section gets discarded
> and the reference from a callback pointer causes a link-time error:
>
> `virtio_scmi_exit' referenced in section `.rodata' of drivers/firmware/arm_scmi/virtio.o: defined in discarded section `.exit.text' of drivers/firmware/arm_scmi/virtio.o
>
> I could not figure out a better workaround, so let's just remove that
> annotation even if it wastes a couple of bytes in .text.
>

[...]

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

[2/2] firmware: arm_scmi: remove __exit annotation
      https://git.kernel.org/sudeep.holla/c/1cd73200da

--
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] firmware: arm_scmi: remove __exit annotation
@ 2021-09-20 11:06     ` Sudeep Holla
  0 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2021-09-20 11:06 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Igor Skalkin, Peter Hilber, Cristian Marussi, Sudeep Holla,
	Arnd Bergmann, kernel test robot, linux-arm-kernel, linux-kernel

On Mon, Sep 20, 2021 at 12:02:52PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> virtio_scmi_exit() is only called from __exit function, so the annotation
> is correct, but when the driver is built-in, the section gets discarded
> and the reference from a callback pointer causes a link-time error:
>
> `virtio_scmi_exit' referenced in section `.rodata' of drivers/firmware/arm_scmi/virtio.o: defined in discarded section `.exit.text' of drivers/firmware/arm_scmi/virtio.o
>
> I could not figure out a better workaround, so let's just remove that
> annotation even if it wastes a couple of bytes in .text.
>

[...]

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

[2/2] firmware: arm_scmi: remove __exit annotation
      https://git.kernel.org/sudeep.holla/c/1cd73200da

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-20 11:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 10:02 [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency Arnd Bergmann
2021-09-20 10:02 ` Arnd Bergmann
2021-09-20 10:02 ` [PATCH 2/2] firmware: arm_scmi: remove __exit annotation Arnd Bergmann
2021-09-20 10:02   ` Arnd Bergmann
2021-09-20 11:06   ` Sudeep Holla
2021-09-20 11:06     ` Sudeep Holla
2021-09-20 10:48 ` [PATCH 1/2] firmware: arm_scmi: fix VIRTIO dependency Sudeep Holla
2021-09-20 10:48   ` Sudeep Holla

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.