* [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
@ 2024-11-05 18:36 Geert Uytterhoeven
2024-11-05 22:29 ` Finn Thain
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-11-05 18:36 UTC (permalink / raw)
To: Finn Thain, Michael Schmitz, James E . J . Bottomley,
Martin K . Petersen, Sam Creasey, Uwe Kleine-König
Cc: linux-scsi, linux-m68k, Geert Uytterhoeven
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 warnings
WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
that trigger on a Sun 3 allmodconfig build.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/sun3_scsi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index fffc0fa525940cee..1bd1c3f87ff7dd42 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)
iounmap(ioaddr);
}
-static struct platform_driver sun3_scsi_driver = {
+/*
+ * sun3_scsi_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 sun3_scsi_driver __refdata = {
.remove_new = __exit_p(sun3_scsi_remove),
.driver = {
.name = DRV_MODULE_NAME,
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
2024-11-05 18:36 [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Geert Uytterhoeven
@ 2024-11-05 22:29 ` Finn Thain
2024-11-06 8:50 ` Uwe Kleine-König
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Finn Thain @ 2024-11-05 22:29 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Michael Schmitz, James E . J . Bottomley, Martin K . Petersen,
Sam Creasey, Uwe Kleine-König, linux-scsi, linux-m68k
On Tue, 5 Nov 2024, Geert Uytterhoeven 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 warnings
>
> WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
> WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
>
> that trigger on a Sun 3 allmodconfig build.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Finn Thain <fthain@linux-m68k.org>
Thanks, Geert.
> ---
> drivers/scsi/sun3_scsi.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
> index fffc0fa525940cee..1bd1c3f87ff7dd42 100644
> --- a/drivers/scsi/sun3_scsi.c
> +++ b/drivers/scsi/sun3_scsi.c
> @@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)
> iounmap(ioaddr);
> }
>
> -static struct platform_driver sun3_scsi_driver = {
> +/*
> + * sun3_scsi_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 sun3_scsi_driver __refdata = {
> .remove_new = __exit_p(sun3_scsi_remove),
> .driver = {
> .name = DRV_MODULE_NAME,
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
2024-11-05 18:36 [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Geert Uytterhoeven
2024-11-05 22:29 ` Finn Thain
@ 2024-11-06 8:50 ` Uwe Kleine-König
2024-11-06 9:59 ` Geert Uytterhoeven
2024-11-07 2:07 ` Martin K. Petersen
2024-11-14 2:49 ` Martin K. Petersen
3 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2024-11-06 8:50 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Finn Thain, Michael Schmitz, James E . J . Bottomley,
Martin K . Petersen, Sam Creasey, linux-scsi, linux-m68k
[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]
On Tue, Nov 05, 2024 at 07:36:31PM +0100, Geert Uytterhoeven 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 warnings
>
> WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
> WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
>
> that trigger on a Sun 3 allmodconfig build.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Seems I missed that one before posting 7308bf8a2c3d ("modpost: Enable
section warning from *driver to .exit.text"). My excuse is that this
driver isn't enabled for an ARCH=m68k allmodconfig build.
Thanks
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
2024-11-06 8:50 ` Uwe Kleine-König
@ 2024-11-06 9:59 ` Geert Uytterhoeven
0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2024-11-06 9:59 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Finn Thain, Michael Schmitz, James E . J . Bottomley,
Martin K . Petersen, Sam Creasey, linux-scsi, linux-m68k
Hi Uwe,
On Wed, Nov 6, 2024 at 9:50 AM Uwe Kleine-König
<u.kleine-koenig@baylibre.com> wrote:
> On Tue, Nov 05, 2024 at 07:36:31PM +0100, Geert Uytterhoeven 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 warnings
> >
> > WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
> > WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
> >
> > that trigger on a Sun 3 allmodconfig build.
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Thanks!
> Seems I missed that one before posting 7308bf8a2c3d ("modpost: Enable
> section warning from *driver to .exit.text"). My excuse is that this
> driver isn't enabled for an ARCH=m68k allmodconfig build.
Understandable, as there are basically 5 classes of m68k kernels:
- Classic with MMU,
- Coldfire with MMU,
- Sun-3,
- Classic without MMU,
- Coldire without MMU.
As the last two consist of multiple single-platform kernels, they're
harder to do allmodconfig for.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
2024-11-05 18:36 [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Geert Uytterhoeven
2024-11-05 22:29 ` Finn Thain
2024-11-06 8:50 ` Uwe Kleine-König
@ 2024-11-07 2:07 ` Martin K. Petersen
2024-11-14 2:49 ` Martin K. Petersen
3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2024-11-07 2:07 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Finn Thain, Michael Schmitz, James E . J . Bottomley,
Martin K . Petersen, Sam Creasey, Uwe Kleine-König,
linux-scsi, linux-m68k
Geert,
> 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 warnings
Applied to 6.13/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
2024-11-05 18:36 [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Geert Uytterhoeven
` (2 preceding siblings ...)
2024-11-07 2:07 ` Martin K. Petersen
@ 2024-11-14 2:49 ` Martin K. Petersen
3 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2024-11-14 2:49 UTC (permalink / raw)
To: Finn Thain, Michael Schmitz, James E . J . Bottomley, Sam Creasey,
Uwe Kleine-König, Geert Uytterhoeven
Cc: Martin K . Petersen, linux-scsi, linux-m68k
On Tue, 05 Nov 2024 19:36:31 +0100, Geert Uytterhoeven 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 warnings
>
> WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
> WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
>
> [...]
Applied to 6.13/scsi-queue, thanks!
[1/1] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
https://git.kernel.org/mkp/scsi/c/50133cf05263
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-14 2:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 18:36 [PATCH] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch Geert Uytterhoeven
2024-11-05 22:29 ` Finn Thain
2024-11-06 8:50 ` Uwe Kleine-König
2024-11-06 9:59 ` Geert Uytterhoeven
2024-11-07 2:07 ` Martin K. Petersen
2024-11-14 2:49 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox