linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch
@ 2024-03-29 21:54 Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kbuild, kernel

As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warning

	WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/input/mouse/amimouse.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c
index cda0c3ff5a28..2fbbaeb76d70 100644
--- a/drivers/input/mouse/amimouse.c
+++ b/drivers/input/mouse/amimouse.c
@@ -132,7 +132,13 @@ static void __exit amimouse_remove(struct platform_device *pdev)
 	input_unregister_device(dev);
 }
 
-static struct platform_driver amimouse_driver = {
+/*
+ * amimouse_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver amimouse_driver __refdata = {
 	.remove_new = __exit_p(amimouse_remove),
 	.driver   = {
 		.name	= "amiga-mouse",

base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* [PATCH] parport: amiga: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
@ 2024-03-29 21:54 ` Uwe Kleine-König
  2024-04-15 14:37   ` Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] serial: ami: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kbuild, linux-kernel, kernel

As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warning

	WARNING: modpost: drivers/parport/parport_amiga: section mismatch in reference: amiga_parallel_driver+0x8 (section: .data) -> amiga_parallel_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/parport/parport_amiga.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c
index e6dc857aac3f..e06c7b2aac5c 100644
--- a/drivers/parport/parport_amiga.c
+++ b/drivers/parport/parport_amiga.c
@@ -229,7 +229,13 @@ static void __exit amiga_parallel_remove(struct platform_device *pdev)
 	parport_put_port(port);
 }
 
-static struct platform_driver amiga_parallel_driver = {
+/*
+ * amiga_parallel_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver amiga_parallel_driver __refdata = {
 	.remove_new = __exit_p(amiga_parallel_remove),
 	.driver   = {
 		.name	= "amiga-parallel",
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* [PATCH] serial: ami: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
@ 2024-03-29 21:54 ` Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-kbuild, linux-serial, kernel

As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warning

	WARNING: modpost: drivers/tty/amiserial: section mismatch in reference: amiga_serial_driver+0x8 (section: .data) -> amiga_serial_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/tty/amiserial.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index e27360652d9b..8c964da75f2d 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1578,7 +1578,13 @@ static void __exit amiga_serial_remove(struct platform_device *pdev)
 	free_irq(IRQ_AMIGA_RBF, state);
 }
 
-static struct platform_driver amiga_serial_driver = {
+/*
+ * amiga_serial_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver amiga_serial_driver __refdata = {
 	.remove_new = __exit_p(amiga_serial_remove),
 	.driver   = {
 		.name	= "amiga-serial",
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* [PATCH] virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
  2024-03-29 21:54 ` [PATCH] serial: ami: " Uwe Kleine-König
@ 2024-03-29 21:54 ` Uwe Kleine-König
  2024-03-30  0:16   ` Kuppuswamy Sathyanarayanan
                     ` (2 more replies)
  2024-03-29 21:54 ` [PATCH] OSS: dmasound/paula: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  6 siblings, 3 replies; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Tom Lendacky, Dan Williams, Kuppuswamy Sathyanarayanan,
	Borislav Petkov (AMD)
  Cc: linux-kbuild, kernel

As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warning

	WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/virt/coco/sev-guest/sev-guest.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
index 87f241825bc3..1af68065b3d9 100644
--- a/drivers/virt/coco/sev-guest/sev-guest.c
+++ b/drivers/virt/coco/sev-guest/sev-guest.c
@@ -1009,8 +1009,13 @@ static void __exit sev_guest_remove(struct platform_device *pdev)
  * This driver is meant to be a common SEV guest interface driver and to
  * support any SEV guest API. As such, even though it has been introduced
  * with the SEV-SNP support, it is named "sev-guest".
+ *
+ * sev_guest_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
  */
-static struct platform_driver sev_guest_driver = {
+static struct platform_driver sev_guest_driver __refdata = {
 	.remove_new	= __exit_p(sev_guest_remove),
 	.driver		= {
 		.name = "sev-guest",
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* [PATCH] OSS: dmasound/paula: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
@ 2024-03-29 21:54 ` Uwe Kleine-König
  2024-04-01 11:47   ` Takashi Iwai
  2024-03-29 21:54 ` [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe() Uwe Kleine-König
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: linux-sound, linux-kbuild, kernel

As described in the added code comment, a reference to .exit.text is ok
for drivers registered via module_platform_driver_probe(). Make this
explicit to prevent the following section mismatch warning

	WARNING: modpost: sound/oss/dmasound/dmasound_paula: section mismatch in reference: amiga_audio_driver+0x8 (section: .data) -> amiga_audio_remove (section: .exit.text)

that triggers on an allmodconfig W=1 build.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 sound/oss/dmasound/dmasound_paula.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c
index 0ba8f0c4cd99..3a593da09280 100644
--- a/sound/oss/dmasound/dmasound_paula.c
+++ b/sound/oss/dmasound/dmasound_paula.c
@@ -725,7 +725,13 @@ static void __exit amiga_audio_remove(struct platform_device *pdev)
 	dmasound_deinit();
 }
 
-static struct platform_driver amiga_audio_driver = {
+/*
+ * amiga_audio_remove() lives in .exit.text. For drivers registered via
+ * module_platform_driver_probe() this is ok because they cannot get unbound at
+ * runtime. So mark the driver struct with __refdata to prevent modpost
+ * triggering a section mismatch warning.
+ */
+static struct platform_driver amiga_audio_driver __refdata = {
 	.remove_new = __exit_p(amiga_audio_remove),
 	.driver = {
 		.name	= "amiga-audio",
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe()
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2024-03-29 21:54 ` [PATCH] OSS: dmasound/paula: " Uwe Kleine-König
@ 2024-03-29 21:54 ` Uwe Kleine-König
  2024-04-03  5:15   ` Michael Ellerman
  2024-04-15 14:34 ` [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
  2024-04-30 20:58 ` Dmitry Torokhov
  6 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-03-29 21:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Michael Ellerman, Dawei Li,
	Damien Le Moal, Jakub Kicinski, Thomas Gleixner
  Cc: Nicholas Piggin, Christophe Leroy, Aneesh Kumar K.V,
	Naveen N. Rao, linux-kbuild, linux-serial, linuxppc-dev, kernel

There are considerations to drop platform_driver_probe() as a concept
that isn't relevant any more today. It comes with an added complexity
that makes many users hold it wrong. (E.g. this driver should have
marked the driver struct with __refdata to prevent the below mentioned
false positive section mismatch warning.)

This fixes a W=1 build warning:

	WARNING: modpost: drivers/tty/serial/pmac_zilog: section mismatch in reference: pmz_driver+0x8 (section: .data) -> pmz_detach (section: .exit.text)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/tty/serial/pmac_zilog.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 05d97e89511e..e44621218248 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1695,7 +1695,7 @@ static void pmz_dispose_port(struct uart_pmac_port *uap)
 	memset(uap, 0, sizeof(struct uart_pmac_port));
 }
 
-static int __init pmz_attach(struct platform_device *pdev)
+static int pmz_attach(struct platform_device *pdev)
 {
 	struct uart_pmac_port *uap;
 	int i;
@@ -1714,7 +1714,7 @@ static int __init pmz_attach(struct platform_device *pdev)
 	return uart_add_one_port(&pmz_uart_reg, &uap->port);
 }
 
-static void __exit pmz_detach(struct platform_device *pdev)
+static void pmz_detach(struct platform_device *pdev)
 {
 	struct uart_pmac_port *uap = platform_get_drvdata(pdev);
 
@@ -1789,7 +1789,8 @@ static struct macio_driver pmz_driver = {
 #else
 
 static struct platform_driver pmz_driver = {
-	.remove_new	= __exit_p(pmz_detach),
+	.probe		= pmz_attach,
+	.remove_new	= pmz_detach,
 	.driver		= {
 		.name		= "scc",
 	},
@@ -1837,7 +1838,7 @@ static int __init init_pmz(void)
 #ifdef CONFIG_PPC_PMAC
 	return macio_register_driver(&pmz_driver);
 #else
-	return platform_driver_probe(&pmz_driver, pmz_attach);
+	return platform_driver_register(&pmz_driver);
 #endif
 }
 
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
-- 
2.43.0


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

* Re: [PATCH] virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
@ 2024-03-30  0:16   ` Kuppuswamy Sathyanarayanan
  2024-04-15 14:39   ` Uwe Kleine-König
  2024-04-15 21:53   ` Tom Lendacky
  2 siblings, 0 replies; 18+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2024-03-30  0:16 UTC (permalink / raw)
  To: Uwe Kleine-König, Tom Lendacky, Dan Williams, Borislav Petkov (AMD)
  Cc: linux-kbuild, kernel


On 3/29/24 2:54 PM, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
>
> 	WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)
>
> that triggers on an allmodconfig W=1 build.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

LGTM

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>  drivers/virt/coco/sev-guest/sev-guest.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
> index 87f241825bc3..1af68065b3d9 100644
> --- a/drivers/virt/coco/sev-guest/sev-guest.c
> +++ b/drivers/virt/coco/sev-guest/sev-guest.c
> @@ -1009,8 +1009,13 @@ static void __exit sev_guest_remove(struct platform_device *pdev)
>   * This driver is meant to be a common SEV guest interface driver and to
>   * support any SEV guest API. As such, even though it has been introduced
>   * with the SEV-SNP support, it is named "sev-guest".
> + *
> + * sev_guest_remove() lives in .exit.text. For drivers registered via
> + * module_platform_driver_probe() this is ok because they cannot get unbound at
> + * runtime. So mark the driver struct with __refdata to prevent modpost
> + * triggering a section mismatch warning.
>   */
> -static struct platform_driver sev_guest_driver = {
> +static struct platform_driver sev_guest_driver __refdata = {
>  	.remove_new	= __exit_p(sev_guest_remove),
>  	.driver		= {
>  		.name = "sev-guest",
> base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


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

* Re: [PATCH] OSS: dmasound/paula: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 ` [PATCH] OSS: dmasound/paula: " Uwe Kleine-König
@ 2024-04-01 11:47   ` Takashi Iwai
  0 siblings, 0 replies; 18+ messages in thread
From: Takashi Iwai @ 2024-04-01 11:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kbuild, kernel

On Fri, 29 Mar 2024 22:54:42 +0100,
Uwe Kleine-König wrote:
> 
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: sound/oss/dmasound/dmasound_paula: section mismatch in reference: amiga_audio_driver+0x8 (section: .data) -> amiga_audio_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks, applied.


Takashi

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

* Re: [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe()
  2024-03-29 21:54 ` [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe() Uwe Kleine-König
@ 2024-04-03  5:15   ` Michael Ellerman
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Ellerman @ 2024-04-03  5:15 UTC (permalink / raw)
  To: Uwe Kleine-König, Greg Kroah-Hartman, Jiri Slaby, Dawei Li,
	Damien Le Moal, Jakub Kicinski, Thomas Gleixner
  Cc: Nicholas Piggin, Christophe Leroy, Aneesh Kumar K.V,
	Naveen N. Rao, linux-kbuild, linux-serial, linuxppc-dev, kernel

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> There are considerations to drop platform_driver_probe() as a concept
> that isn't relevant any more today. It comes with an added complexity
> that makes many users hold it wrong. (E.g. this driver should have
> marked the driver struct with __refdata to prevent the below mentioned
> false positive section mismatch warning.)
>
> This fixes a W=1 build warning:
>
> 	WARNING: modpost: drivers/tty/serial/pmac_zilog: section mismatch in reference: pmz_driver+0x8 (section: .data) -> pmz_detach (section: .exit.text)
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/tty/serial/pmac_zilog.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

I gave it a quick spin in qemu, no issues.

Tested-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

> diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
> index 05d97e89511e..e44621218248 100644
> --- a/drivers/tty/serial/pmac_zilog.c
> +++ b/drivers/tty/serial/pmac_zilog.c
> @@ -1695,7 +1695,7 @@ static void pmz_dispose_port(struct uart_pmac_port *uap)
>  	memset(uap, 0, sizeof(struct uart_pmac_port));
>  }
>  
> -static int __init pmz_attach(struct platform_device *pdev)
> +static int pmz_attach(struct platform_device *pdev)
>  {
>  	struct uart_pmac_port *uap;
>  	int i;
> @@ -1714,7 +1714,7 @@ static int __init pmz_attach(struct platform_device *pdev)
>  	return uart_add_one_port(&pmz_uart_reg, &uap->port);
>  }
>  
> -static void __exit pmz_detach(struct platform_device *pdev)
> +static void pmz_detach(struct platform_device *pdev)
>  {
>  	struct uart_pmac_port *uap = platform_get_drvdata(pdev);
>  
> @@ -1789,7 +1789,8 @@ static struct macio_driver pmz_driver = {
>  #else
>  
>  static struct platform_driver pmz_driver = {
> -	.remove_new	= __exit_p(pmz_detach),
> +	.probe		= pmz_attach,
> +	.remove_new	= pmz_detach,
>  	.driver		= {
>  		.name		= "scc",
>  	},
> @@ -1837,7 +1838,7 @@ static int __init init_pmz(void)
>  #ifdef CONFIG_PPC_PMAC
>  	return macio_register_driver(&pmz_driver);
>  #else
> -	return platform_driver_probe(&pmz_driver, pmz_attach);
> +	return platform_driver_register(&pmz_driver);
>  #endif
>  }
>  
> base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
> -- 
> 2.43.0

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

* Re: [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2024-03-29 21:54 ` [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe() Uwe Kleine-König
@ 2024-04-15 14:34 ` Uwe Kleine-König
  2024-04-29 20:29   ` Uwe Kleine-König
  2024-04-30 20:58 ` Dmitry Torokhov
  6 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-15 14:34 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kbuild, kernel, linux-input

[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]

Hello,

On Fri, Mar 29, 2024 at 10:54:38PM +0100, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

I'd like to enable these warnings even for W=0 builds, so it would be
great to get it into the main line soon.

If you apply it, please notice that I fat-fingered the parameters to git
send-email and it was sent in a thread. So (assuming you're using b4)
you'd need:

	b4 am -P _ -v1 2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] parport: amiga: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
@ 2024-04-15 14:37   ` Uwe Kleine-König
  2024-04-29 20:30     ` Uwe Kleine-König
  0 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-15 14:37 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

Hello,

On Fri, Mar 29, 2024 at 10:54:39PM +0100, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: drivers/parport/parport_amiga: section mismatch in reference: amiga_parallel_driver+0x8 (section: .data) -> amiga_parallel_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

I'd like to enable these warnings even for W=0 builds, so it would be
great to get it into the main line soon.

If you apply it, please notice that I fat-fingered the parameters to git
send-email and it was sent in a thread. So (assuming you're using b4)
you'd need:

        b4 am -P _ -v1 49ab91032bf9b57cd5fb6d306c38884d059dce2f.1711748999.git.u.kleine-koenig@pengutronix.de

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
  2024-03-30  0:16   ` Kuppuswamy Sathyanarayanan
@ 2024-04-15 14:39   ` Uwe Kleine-König
  2024-04-29 20:32     ` Uwe Kleine-König
  2024-04-15 21:53   ` Tom Lendacky
  2 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-15 14:39 UTC (permalink / raw)
  To: Tom Lendacky, Dan Williams, Kuppuswamy Sathyanarayanan,
	Borislav Petkov (AMD)
  Cc: kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

Hello,

On Fri, Mar 29, 2024 at 10:54:41PM +0100, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

I'd like to enable these warnings even for W=0 builds, so it would be
great to get it into the main line soon.

If you apply it, please notice that I fat-fingered the parameters to git
send-email and it was sent in a thread. So (assuming you're using b4)
you'd need:

        b4 am -P _ 4a81b0e87728a58904283e2d1f18f73abc69c2a1.1711748999.git.u.kleine-koenig@pengutronix.de

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
  2024-03-30  0:16   ` Kuppuswamy Sathyanarayanan
  2024-04-15 14:39   ` Uwe Kleine-König
@ 2024-04-15 21:53   ` Tom Lendacky
  2 siblings, 0 replies; 18+ messages in thread
From: Tom Lendacky @ 2024-04-15 21:53 UTC (permalink / raw)
  To: Uwe Kleine-König, Dan Williams, Kuppuswamy Sathyanarayanan,
	Borislav Petkov (AMD)
  Cc: linux-kbuild, kernel

On 3/29/24 16:54, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>

> ---
>   drivers/virt/coco/sev-guest/sev-guest.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c
> index 87f241825bc3..1af68065b3d9 100644
> --- a/drivers/virt/coco/sev-guest/sev-guest.c
> +++ b/drivers/virt/coco/sev-guest/sev-guest.c
> @@ -1009,8 +1009,13 @@ static void __exit sev_guest_remove(struct platform_device *pdev)
>    * This driver is meant to be a common SEV guest interface driver and to
>    * support any SEV guest API. As such, even though it has been introduced
>    * with the SEV-SNP support, it is named "sev-guest".
> + *
> + * sev_guest_remove() lives in .exit.text. For drivers registered via
> + * module_platform_driver_probe() this is ok because they cannot get unbound at
> + * runtime. So mark the driver struct with __refdata to prevent modpost
> + * triggering a section mismatch warning.
>    */
> -static struct platform_driver sev_guest_driver = {
> +static struct platform_driver sev_guest_driver __refdata = {
>   	.remove_new	= __exit_p(sev_guest_remove),
>   	.driver		= {
>   		.name = "sev-guest",
> base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2

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

* Re: [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch
  2024-04-15 14:34 ` [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
@ 2024-04-29 20:29   ` Uwe Kleine-König
  2024-04-30 20:59     ` Dmitry Torokhov
  0 siblings, 1 reply; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-29 20:29 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

Hello Dmitry,

On Mon, Apr 15, 2024 at 04:34:53PM +0200, Uwe Kleine-König wrote:
> On Fri, Mar 29, 2024 at 10:54:38PM +0100, Uwe Kleine-König wrote:
> > As described in the added code comment, a reference to .exit.text is ok
> > for drivers registered via module_platform_driver_probe(). Make this
> > explicit to prevent the following section mismatch warning
> > 
> > 	WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text)
> > 
> > that triggers on an allmodconfig W=1 build.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> I'd like to enable these warnings even for W=0 builds, so it would be
> great to get it into the main line soon.
> 
> If you apply it, please notice that I fat-fingered the parameters to git
> send-email and it was sent in a thread. So (assuming you're using b4)
> you'd need:
> 
> 	b4 am -P _ -v1 2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de

Do you have this patch still on your radar? I guess it's to late to get
it into v6.9 now, but do you plan to apply it for v6.10-rc1?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] parport: amiga: Mark driver struct with __refdata to prevent section mismatch
  2024-04-15 14:37   ` Uwe Kleine-König
@ 2024-04-29 20:30     ` Uwe Kleine-König
  0 siblings, 0 replies; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-29 20:30 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel, kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1351 bytes --]

Hello,

On Mon, Apr 15, 2024 at 04:37:44PM +0200, Uwe Kleine-König wrote:
> On Fri, Mar 29, 2024 at 10:54:39PM +0100, Uwe Kleine-König wrote:
> > As described in the added code comment, a reference to .exit.text is ok
> > for drivers registered via module_platform_driver_probe(). Make this
> > explicit to prevent the following section mismatch warning
> > 
> > 	WARNING: modpost: drivers/parport/parport_amiga: section mismatch in reference: amiga_parallel_driver+0x8 (section: .data) -> amiga_parallel_remove (section: .exit.text)
> > 
> > that triggers on an allmodconfig W=1 build.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> I'd like to enable these warnings even for W=0 builds, so it would be
> great to get it into the main line soon.
> 
> If you apply it, please notice that I fat-fingered the parameters to git
> send-email and it was sent in a thread. So (assuming you're using b4)
> you'd need:
> 
>         b4 am -P _ -v1 49ab91032bf9b57cd5fb6d306c38884d059dce2f.1711748999.git.u.kleine-koenig@pengutronix.de

Gentle ping!? It would be great to get this patch in during the
upcoming merge window.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] virt: sev-guest: Mark driver struct with __refdata to prevent section mismatch
  2024-04-15 14:39   ` Uwe Kleine-König
@ 2024-04-29 20:32     ` Uwe Kleine-König
  0 siblings, 0 replies; 18+ messages in thread
From: Uwe Kleine-König @ 2024-04-29 20:32 UTC (permalink / raw)
  To: Tom Lendacky, Dan Williams, Kuppuswamy Sathyanarayanan,
	Borislav Petkov (AMD)
  Cc: kernel, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

On Mon, Apr 15, 2024 at 04:39:32PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Fri, Mar 29, 2024 at 10:54:41PM +0100, Uwe Kleine-König wrote:
> > As described in the added code comment, a reference to .exit.text is ok
> > for drivers registered via module_platform_driver_probe(). Make this
> > explicit to prevent the following section mismatch warning
> > 
> > 	WARNING: modpost: drivers/virt/coco/sev-guest/sev-guest: section mismatch in reference: sev_guest_driver+0x10 (section: .data) -> sev_guest_remove (section: .exit.text)
> > 
> > that triggers on an allmodconfig W=1 build.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> I'd like to enable these warnings even for W=0 builds, so it would be
> great to get it into the main line soon.
> 
> If you apply it, please notice that I fat-fingered the parameters to git
> send-email and it was sent in a thread. So (assuming you're using b4)
> you'd need:
> 
>         b4 am -P _ 4a81b0e87728a58904283e2d1f18f73abc69c2a1.1711748999.git.u.kleine-koenig@pengutronix.de

This patch didn't make it into next up to now. Is there a chance to get
it into v6.10-rc1?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch
  2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2024-04-15 14:34 ` [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
@ 2024-04-30 20:58 ` Dmitry Torokhov
  6 siblings, 0 replies; 18+ messages in thread
From: Dmitry Torokhov @ 2024-04-30 20:58 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-input, linux-kbuild, kernel

On Fri, Mar 29, 2024 at 10:54:38PM +0100, Uwe Kleine-König wrote:
> As described in the added code comment, a reference to .exit.text is ok
> for drivers registered via module_platform_driver_probe(). Make this
> explicit to prevent the following section mismatch warning
> 
> 	WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text)
> 
> that triggers on an allmodconfig W=1 build.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied, thank you.

-- 
Dmitry

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

* Re: [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch
  2024-04-29 20:29   ` Uwe Kleine-König
@ 2024-04-30 20:59     ` Dmitry Torokhov
  0 siblings, 0 replies; 18+ messages in thread
From: Dmitry Torokhov @ 2024-04-30 20:59 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-input, kernel, linux-kbuild

Hi Uwe,

On Mon, Apr 29, 2024 at 10:29:41PM +0200, Uwe Kleine-König wrote:
> Hello Dmitry,
> 
> On Mon, Apr 15, 2024 at 04:34:53PM +0200, Uwe Kleine-König wrote:
> > On Fri, Mar 29, 2024 at 10:54:38PM +0100, Uwe Kleine-König wrote:
> > > As described in the added code comment, a reference to .exit.text is ok
> > > for drivers registered via module_platform_driver_probe(). Make this
> > > explicit to prevent the following section mismatch warning
> > > 
> > > 	WARNING: modpost: drivers/input/mouse/amimouse: section mismatch in reference: amimouse_driver+0x8 (section: .data) -> amimouse_remove (section: .exit.text)
> > > 
> > > that triggers on an allmodconfig W=1 build.
> > > 
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > I'd like to enable these warnings even for W=0 builds, so it would be
> > great to get it into the main line soon.
> > 
> > If you apply it, please notice that I fat-fingered the parameters to git
> > send-email and it was sent in a thread. So (assuming you're using b4)
> > you'd need:
> > 
> > 	b4 am -P _ -v1 2e3783106bf6bd9a7bdeb12b706378fb16316471.1711748999.git.u.kleine-koenig@pengutronix.de
> 
> Do you have this patch still on your radar? I guess it's to late to get
> it into v6.9 now, but do you plan to apply it for v6.10-rc1?

I'll get it into 6.9, it is not controversial.

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2024-04-30 20:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29 21:54 [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] parport: amiga: " Uwe Kleine-König
2024-04-15 14:37   ` Uwe Kleine-König
2024-04-29 20:30     ` Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] serial: ami: " Uwe Kleine-König
2024-03-29 21:54 ` [PATCH] virt: sev-guest: " Uwe Kleine-König
2024-03-30  0:16   ` Kuppuswamy Sathyanarayanan
2024-04-15 14:39   ` Uwe Kleine-König
2024-04-29 20:32     ` Uwe Kleine-König
2024-04-15 21:53   ` Tom Lendacky
2024-03-29 21:54 ` [PATCH] OSS: dmasound/paula: " Uwe Kleine-König
2024-04-01 11:47   ` Takashi Iwai
2024-03-29 21:54 ` [PATCH] serial: pmac_zilog: Drop usage of platform_driver_probe() Uwe Kleine-König
2024-04-03  5:15   ` Michael Ellerman
2024-04-15 14:34 ` [PATCH] Input: amimouse - Mark driver struct with __refdata to prevent section mismatch Uwe Kleine-König
2024-04-29 20:29   ` Uwe Kleine-König
2024-04-30 20:59     ` Dmitry Torokhov
2024-04-30 20:58 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).