Re: [PATCH net-next v1] net: stmmac: Default DWMAC_MOTORCOMM to m on MACH_LOONGSON64

From: Tiezhu Yang

Date: Wed Sep 16 2026 - 21:02:13 EST


On 2026/9/17 上午12:54, Maxime Chevallier wrote:
Hi

On 9/15/26 09:32, Tiezhu Yang wrote:
Currently, there is no network connectivity when upgrading to the
latest upstream mainline kernel on certain Loongson machines such
as Loongson-3C6000 server, because the driver for the onboard NIC
is not enabled.

Enable the Motorcomm PCI DWMAC driver as a module by default when
building for the Loongson-64 platform.

This ensures out-of-the-box support for Motorcomm YT6801 Ethernet
controllers on Loongson machines, enabling demand-loading without
increasing the core kernel image size.

Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index ab3c4cf96423..c86d6c08977c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -408,6 +408,7 @@ config DWMAC_LOONGSON
config DWMAC_MOTORCOMM
tristate "Motorcomm PCI DWMAC support"
+ default m if MACH_LOONGSON64
depends on PCI
select MOTORCOMM_PHY
select STMMAC_LIBPCI

I agree with Yao Zi, this belongs in your .config, maybe your
defconfig, but not in the stmmac Kconfig.

Thanks for the constructive suggestions.

Before moving forward, I'd like to share an alternative thought.
As noted in the earlier review, this network controller could be
used across multiple architectures. To avoid the redundant churn
in the defconfigs of every single architecture, I am wondering if
we could unconditionally set it to default m in the Kconfig instead.

Please let me know whether it makes sense:

```
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index ab3c4cf96423..bea18cb4b697 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -408,6 +408,7 @@ config DWMAC_LOONGSON

config DWMAC_MOTORCOMM
tristate "Motorcomm PCI DWMAC support"
+ default m
depends on PCI
select MOTORCOMM_PHY
select STMMAC_LIBPCI
```

If no, I will modify the arch-specific config.

Thanks,
Tiezhu