[PATCH RFC] net: stmmac: Make DWMAC_ROCKCHIP and DWMAC_STM32 depend on PM_SLEEP

Paul E. McKenney posted 1 patch 1 month, 2 weeks ago
[PATCH RFC] net: stmmac: Make DWMAC_ROCKCHIP and DWMAC_STM32 depend on PM_SLEEP
Posted by Paul E. McKenney 1 month, 2 weeks ago
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@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: <netdev@vger.kernel.org>
Cc: <linux-stm32@st-md-mailman.stormreply.com>
Cc: <linux-arm-kernel@lists.infradead.org>

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.
Re: [PATCH RFC] net: stmmac: Make DWMAC_ROCKCHIP and DWMAC_STM32 depend on PM_SLEEP
Posted by Russell King (Oracle) 1 month, 2 weeks ago
On Mon, Aug 18, 2025 at 12:11:09PM -0700, Paul E. McKenney wrote:
> 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 kernel build bot caught this, and I asked questions of Rafael last
week and have been waiting for a response that still hasn't come.

However, there was some discussion over the weekend (argh) on IRC from
rdd and arnd, but I didn't have time over a weekend (shocking, I know,
we're supposed to work 24x7 on the kernel, rather than preparing to
travel to a different location for medical stuff) to really participate
in that discussion.

Nevertheless, I do have a patch with my preferred solution - but whether
that solution is what other people prefer seems to be a subject of
disagreement according to that which happened on IRC. This affects every
driver that I converted to use stmmac_simple_pm_ops, which is more than
you're patching.

I've been missing around with medical stuff today, which means I also
haven't had time today to do anything further.

It's a known problem, but (1) there's been no participation from the
kernel community to help address it and (2) over the last few days I've
been busy myself doing stuff related to medical stuff.

Yea, it's shocking, but it's also real life outside of the realms of
kernel hacking.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH RFC] net: stmmac: Make DWMAC_ROCKCHIP and DWMAC_STM32 depend on PM_SLEEP
Posted by Paul E. McKenney 1 month, 2 weeks ago
On Mon, Aug 18, 2025 at 08:26:05PM +0100, Russell King (Oracle) wrote:
> On Mon, Aug 18, 2025 at 12:11:09PM -0700, Paul E. McKenney wrote:
> > 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 kernel build bot caught this, and I asked questions of Rafael last
> week and have been waiting for a response that still hasn't come.
> 
> However, there was some discussion over the weekend (argh) on IRC from
> rdd and arnd, but I didn't have time over a weekend (shocking, I know,
> we're supposed to work 24x7 on the kernel, rather than preparing to
> travel to a different location for medical stuff) to really participate
> in that discussion.
> 
> Nevertheless, I do have a patch with my preferred solution - but whether
> that solution is what other people prefer seems to be a subject of
> disagreement according to that which happened on IRC. This affects every
> driver that I converted to use stmmac_simple_pm_ops, which is more than
> you're patching.
> 
> I've been missing around with medical stuff today, which means I also
> haven't had time today to do anything further.
> 
> It's a known problem, but (1) there's been no participation from the
> kernel community to help address it and (2) over the last few days I've
> been busy myself doing stuff related to medical stuff.
> 
> Yea, it's shocking, but it's also real life outside of the realms of
> kernel hacking.

;-) ;-) ;-)

I am happy with whatever solves the problem.  In the meantime, I will
be using my patch in testing to get this failure out of the way of
other bugs.

							Thanx, Paul