linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* next-20250813 s390 allyesconfig undefined reference to `stmmac_simple_pm_ops'
@ 2025-08-19  9:37 Naresh Kamboju
  2025-08-19 16:00 ` Alexander Gordeev
  0 siblings, 1 reply; 3+ messages in thread
From: Naresh Kamboju @ 2025-08-19  9:37 UTC (permalink / raw)
  To: open list, Netdev, lkft-triage, Linux Regressions, linux-s390
  Cc: David S. Miller, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Jakub Kicinski, Alexandre Torgue, Jose Abreu, Ben Copeland,
	Anders Roxell, Dan Carpenter, Arnd Bergmann

Build regressions were detected on the s390 architecture with the
Linux next-20250813 tag when building with the allyesconfig configuration.

The failure is caused by unresolved symbol references to stmmac_simple_pm_ops
in multiple STMMAC driver object files, resulting in a link error during
vmlinux generation.

First seen on next-20250813
Good: next-20250812
Bad: next-20250813 and next-20250819

Regression Analysis:
- New regression? yes
- Reproducibility? yes

* s390, build
  - gcc-13-allyesconfig

Boot regression: next-20250813 s390 allyesconfig undefined reference
to `stmmac_simple_pm_ops'

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

## Build log
s390x-linux-gnu-ld:
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o:(.data.rel+0xa0):
undefined reference to `stmmac_simple_pm_ops'
s390x-linux-gnu-ld:
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.o:(.data.rel+0xa0):
undefined reference to `stmmac_simple_pm_ops'
s390x-linux-gnu-ld:
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.o:(.data.rel+0xe0):
undefined reference to `stmmac_simple_pm_ops'
s390x-linux-gnu-ld:
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.o:(.data.rel+0xe0):
undefined reference to `stmmac_simple_pm_ops'
make[3]: *** [/scripts/Makefile.vmlinux:91: vmlinux.unstripped] Error 1

## Source
* Kernel version: 6.17.0-rc2
* Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
* Git describe: next-20250818
* Git commit: 3ac864c2d9bb8608ee236e89bf561811613abfce
* Architectures: s390
* Toolchains: gcc-13
* Kconfigs: allyesconfig

## Build
* Build log: https://qa-reports.linaro.org/api/testruns/29579401/log_file/
* Build details:
https://regressions.linaro.org/lkft/linux-next-master/next-20250818/build/gcc-13-allyesconfig/
* Build plan: https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE
* Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE/config

--
Linaro LKFT
https://lkft.linaro.org

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

* Re: next-20250813 s390 allyesconfig undefined reference to `stmmac_simple_pm_ops'
  2025-08-19  9:37 next-20250813 s390 allyesconfig undefined reference to `stmmac_simple_pm_ops' Naresh Kamboju
@ 2025-08-19 16:00 ` Alexander Gordeev
  2025-08-19 17:35   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Gordeev @ 2025-08-19 16:00 UTC (permalink / raw)
  To: Naresh Kamboju, Russell King
  Cc: open list, Netdev, lkft-triage, Linux Regressions, linux-s390,
	David S. Miller, Heiko Carstens, Vasily Gorbik, Jakub Kicinski,
	Alexandre Torgue, Jose Abreu, Ben Copeland, Anders Roxell,
	Dan Carpenter, Arnd Bergmann

On Tue, Aug 19, 2025 at 03:07:56PM +0530, Naresh Kamboju wrote:

Hi Naresh,

> Build regressions were detected on the s390 architecture with the
> Linux next-20250813 tag when building with the allyesconfig configuration.
> 
> The failure is caused by unresolved symbol references to stmmac_simple_pm_ops
> in multiple STMMAC driver object files, resulting in a link error during
> vmlinux generation.
> 
> First seen on next-20250813
> Good: next-20250812
> Bad: next-20250813 and next-20250819
> 
> Regression Analysis:
> - New regression? yes
> - Reproducibility? yes
> 
> * s390, build
>   - gcc-13-allyesconfig
> 
> Boot regression: next-20250813 s390 allyesconfig undefined reference
> to `stmmac_simple_pm_ops'
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> 
> ## Build log
> s390x-linux-gnu-ld:
> drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o:(.data.rel+0xa0):
> undefined reference to `stmmac_simple_pm_ops'
> s390x-linux-gnu-ld:
> drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.o:(.data.rel+0xa0):
> undefined reference to `stmmac_simple_pm_ops'
> s390x-linux-gnu-ld:
> drivers/net/ethernet/stmicro/stmmac/stmmac_pci.o:(.data.rel+0xe0):
> undefined reference to `stmmac_simple_pm_ops'
> s390x-linux-gnu-ld:
> drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.o:(.data.rel+0xe0):
> undefined reference to `stmmac_simple_pm_ops'
> make[3]: *** [/scripts/Makefile.vmlinux:91: vmlinux.unstripped] Error 1
> 
> ## Source
> * Kernel version: 6.17.0-rc2
> * Git tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git
> * Git describe: next-20250818
> * Git commit: 3ac864c2d9bb8608ee236e89bf561811613abfce
> * Architectures: s390
> * Toolchains: gcc-13
> * Kconfigs: allyesconfig
> 
> ## Build
> * Build log: https://qa-reports.linaro.org/api/testruns/29579401/log_file/
> * Build details:
> https://regressions.linaro.org/lkft/linux-next-master/next-20250818/build/gcc-13-allyesconfig/
> * Build plan: https://tuxapi.tuxsuite.com/v1/groups/linaro/projects/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE
> * Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE/
> * Kernel config:
> https://storage.tuxsuite.com/public/linaro/lkft/builds/31RcVYdjsdhroYxXs4TJYixUCaE/config


I guess it boils down to these commits:

0a529da8cfe3 Merge branch 'net-stmmac-improbe-suspend-resume-architecture'
d6e1f2272960 net: stmmac: mediatek: convert to resume() method
c7308b2f3d0d net: stmmac: stm32: convert to suspend()/resume() methods
d7a276a5768f net: stmmac: rk: convert to suspend()/resume() methods
c91918a1e976 net: stmmac: pci: convert to suspend()/resume() methods
38772638d6d1 net: stmmac: loongson: convert to suspend()/resume() methods
062b42801733 net: stmmac: intel: convert to suspend()/resume() methods
b51f34bc85e3 net: stmmac: platform: legacy hooks for suspend()/resume() methods
7e84b3fae58c net: stmmac: provide a set of simple PM ops
07bbbfe7addf net: stmmac: add suspend()/resume() platform ops

CONFIG_PM is not defined on s390 and as result stmmac_simple_pm_ops ends up
in _DISCARD_PM_OPS(). The below patch fixes the linking, but it is by no
means a correct solution:

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 5769165ee5ba..d475a77e4871 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -668,7 +668,7 @@ static struct pci_driver loongson_dwmac_driver = {
 	.probe = loongson_dwmac_probe,
 	.remove = loongson_dwmac_remove,
 	.driver = {
-		.pm = &stmmac_simple_pm_ops,
+		.pm = &__static_stmmac_simple_pm_ops,
 	},
 };
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index ac8288301994..69fcc8f10ccc 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1820,7 +1820,7 @@ static struct platform_driver rk_gmac_dwmac_driver = {
 	.remove = rk_gmac_remove,
 	.driver = {
 		.name           = "rk_gmac-dwmac",
-		.pm		= &stmmac_simple_pm_ops,
+		.pm		= &__static_stmmac_simple_pm_ops,
 		.of_match_table = rk_gmac_dwmac_match,
 	},
 };
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 77a04c4579c9..d3e1eb35b231 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -669,7 +669,7 @@ static struct platform_driver stm32_dwmac_driver = {
 	.remove = stm32_dwmac_remove,
 	.driver = {
 		.name           = "stm32-dwmac",
-		.pm		= &stmmac_simple_pm_ops,
+		.pm		= &__static_stmmac_simple_pm_ops,
 		.of_match_table = stm32_dwmac_match,
 	},
 };
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index bf95f03dd33f..c5554ede0ba4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -375,6 +375,7 @@ enum stmmac_state {
 };
 
 extern const struct dev_pm_ops stmmac_simple_pm_ops;
+extern const struct dev_pm_ops __static_stmmac_simple_pm_ops;
 
 int stmmac_mdio_unregister(struct net_device *ndev);
 int stmmac_mdio_register(struct net_device *ndev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index e6a7d0ddac2a..d1710f26d65a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -286,7 +286,7 @@ static struct pci_driver stmmac_pci_driver = {
 	.probe = stmmac_pci_probe,
 	.remove = stmmac_pci_remove,
 	.driver         = {
-		.pm     = &stmmac_simple_pm_ops,
+		.pm     = &__static_stmmac_simple_pm_ops,
 	},
 };
 
diff --git a/include/linux/pm.h b/include/linux/pm.h
index cc7b2dc28574..05524761fd51 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -381,7 +381,7 @@ const struct dev_pm_ops name = { \
 	const struct dev_pm_ops name
 
 #define _DISCARD_PM_OPS(name, license, ns)				\
-	static __maybe_unused const struct dev_pm_ops __static_##name
+	__maybe_unused const struct dev_pm_ops __static_##name
 
 #ifdef CONFIG_PM
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_EXPORT_PM_OPS(name, license, ns)


> --
> Linaro LKFT
> https://lkft.linaro.org

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

* Re: next-20250813 s390 allyesconfig undefined reference to `stmmac_simple_pm_ops'
  2025-08-19 16:00 ` Alexander Gordeev
@ 2025-08-19 17:35   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-08-19 17:35 UTC (permalink / raw)
  To: Alexander Gordeev, Naresh Kamboju, Russell King
  Cc: open list, Netdev, lkft-triage, Linux Regressions, linux-s390,
	David S . Miller, Heiko Carstens, Vasily Gorbik, Jakub Kicinski,
	Alexandre Torgue, Jose Abreu, Benjamin Copeland, Anders Roxell,
	Dan Carpenter

On Tue, Aug 19, 2025, at 18:00, Alexander Gordeev wrote:
> On Tue, Aug 19, 2025 at 03:07:56PM +0530, Naresh Kamboju wrote:
> CONFIG_PM is not defined on s390 and as result stmmac_simple_pm_ops ends up
> in _DISCARD_PM_OPS(). The below patch fixes the linking, but it is by no
> means a correct solution:
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c 
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index 5769165ee5ba..d475a77e4871 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -668,7 +668,7 @@ static struct pci_driver loongson_dwmac_driver = {
>  	.probe = loongson_dwmac_probe,
>  	.remove = loongson_dwmac_remove,
>  	.driver = {
> -		.pm = &stmmac_simple_pm_ops,
> +		.pm = &__static_stmmac_simple_pm_ops,

The correct solution is to make the PM_SLEEP versions use this

            .pm = pm_sleep_ptr(stmmac_simple_pm_ops),

or the corresponding version for the PM_RUNTIME+PM_SLEEP drivers:

            .pm = pm_ptr(stmmac_pltfrm_pm_ops),
 
By convention, the pm_ptr()/pm_sleep_ptr() macro should be
used for any driver using DEFINE_DEV_PM_OPS() or its variants,
though missing that does not produce a warning for non-exported
options and only wastes a few bytes of .data.

>  #define _DISCARD_PM_OPS(name, license, ns)				\
> -	static __maybe_unused const struct dev_pm_ops __static_##name
> +	__maybe_unused const struct dev_pm_ops __static_##name 

This would cause a lot of link failures elsewhere, since _DISCARD_PM_OPS
needs to ensure the operations are discarded by the compiler, which does
not happen when they are defined as a global symbol.

The idea of making this a 'static __maybe_unused' symbol is that
the actual functions get discarded as well but don't need an individual
__maybe_unused annotation or an #ifdef around them to prevent a
warning for unused symbols.

     Arnd

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

end of thread, other threads:[~2025-08-19 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  9:37 next-20250813 s390 allyesconfig undefined reference to `stmmac_simple_pm_ops' Naresh Kamboju
2025-08-19 16:00 ` Alexander Gordeev
2025-08-19 17:35   ` Arnd Bergmann

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).