[PATCH RFC] net: stmmac: Make DWMAC_ROCKCHIP and DWMAC_STM32 depend on PM_SLEEP
From: Paul E. McKenney
Date: Mon Aug 18 2025 - 15:18:00 EST
Hello!
This might be more of a bug report than a patch, but here goes...
Running rcuscale or refscale performance tests on datacenter ARM systems
gives the following build errors with CONFIG_HIBERNATION=n:
ERROR: modpost: "stmmac_simple_pm_ops" [drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko] undefined!
ERROR: modpost: "stmmac_simple_pm_ops" [drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.ko] undefined!
The problem is that these two drivers unconditionally reference
stmmac_simple_pm_ops, which is not exported to modules in kernels built
without CONFIG_PM_SLEEP, which depends on CONFIG_HIBERNATION.
Therefore, update drivers/net/ethernet/stmicro/stmmac/Kconfig so that
CONFIG_DWMAC_ROCKCHIP and CONFIG_DWMAC_STM32 depend on CONFIG_PM_SLEEP,
thus preventing the dependence on a symbol when it is not exported.
With this change, rcuscale and refscale build and run happily on the
ARM system that I have access to.
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
Cc: Andrew Lunn <andrew+netdev@xxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
Cc: Paolo Abeni <pabeni@xxxxxxxxxx>
Cc: Maxime Coquelin <mcoquelin.stm32@xxxxxxxxx>
Cc: Alexandre Torgue <alexandre.torgue@xxxxxxxxxxx>
Cc: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Cc: Choong Yong Liang <yong.liang.choong@xxxxxxxxxxxxxxx>
Cc: "Russell King (Oracle)" <rmk+kernel@xxxxxxxxxxxxxxx>
Cc: <netdev@xxxxxxxxxxxxxxx>
Cc: <linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 67fa879b1e521e..150f662953a24b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -146,7 +146,7 @@ config DWMAC_RENESAS_GBETH
config DWMAC_ROCKCHIP
tristate "Rockchip dwmac support"
default ARCH_ROCKCHIP
- depends on OF && (ARCH_ROCKCHIP || COMPILE_TEST)
+ depends on OF && (ARCH_ROCKCHIP || COMPILE_TEST) && PM_SLEEP
select MFD_SYSCON
help
Support for Ethernet controller on Rockchip RK3288 SoC.
@@ -231,7 +231,7 @@ config DWMAC_STI
config DWMAC_STM32
tristate "STM32 DWMAC support"
default ARCH_STM32
- depends on OF && HAS_IOMEM && (ARCH_STM32 || COMPILE_TEST)
+ depends on OF && HAS_IOMEM && (ARCH_STM32 || COMPILE_TEST) && PM_SLEEP
select MFD_SYSCON
help
Support for ethernet controller on STM32 SOCs.