lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250819160049.4004887A48-agordeev@linux.ibm.com>
Date: Tue, 19 Aug 2025 18:00:49 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Naresh Kamboju <naresh.kamboju@...aro.org>,
        Russell King <rmk+kernel@...linux.org.uk>
Cc: open list <linux-kernel@...r.kernel.org>, Netdev <netdev@...r.kernel.org>,
        lkft-triage@...ts.linaro.org,
        Linux Regressions <regressions@...ts.linux.dev>,
        linux-s390@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Jose Abreu <joabreu@...opsys.com>,
        Ben Copeland <benjamin.copeland@...aro.org>,
        Anders Roxell <anders.roxell@...aro.org>,
        Dan Carpenter <dan.carpenter@...aro.org>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: next-20250813 s390 allyesconfig undefined reference to
 `stmmac_simple_pm_ops'

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@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ