* [PATCH] net: stmmac: add support for platform specific config.
@ 2025-06-06 11:41 Xandy.Xiong
2025-06-06 13:12 ` Simon Horman
2025-06-06 16:46 ` Russell King (Oracle)
0 siblings, 2 replies; 4+ messages in thread
From: Xandy.Xiong @ 2025-06-06 11:41 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Maxime Coquelin, Alexandre Torgue
Cc: Russell King (Oracle), Furong Xu, netdev, linux-kernel,
xiongliang
This patch adds support for platform-specific init config in the
stmmac driver. As SMMU remap, must after dma descriptor setup,
and same mac link caps must init before phy init. To support these feature,
a new function pointer 'fix_mac_config' is added to the
plat_stmmacenet_data structure.
And call the function pointer 'fix_mac_config' in the __stmmac_open().
Signed-off-by: Xandy.Xiong <xiongliang@xiaomi.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
include/linux/stmmac.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 085c09039af4..8d629a3c2237 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4041,6 +4041,10 @@ static int __stmmac_open(struct net_device *dev,
if (ret < 0)
return ret;
+ /* Same mac config must before phy init and after stmmac_setup_dma_desc */
+ if (priv->plat->fix_mac_config)
+ priv->plat->fix_mac_config(dev, priv->plat->bsp_priv);
+
if ((!priv->hw->xpcs ||
xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
ret = stmmac_init_phy(dev);
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 26ddf95d23f9..0a6021e5b932 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -239,6 +239,7 @@ struct plat_stmmacenet_data {
phy_interface_t interface, int speed);
void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
int (*fix_soc_reset)(void *priv, void __iomem *ioaddr);
+ int (*fix_mac_config)(struct net_device *ndev, void *priv);
int (*serdes_powerup)(struct net_device *ndev, void *priv);
void (*serdes_powerdown)(struct net_device *ndev, void *priv);
int (*mac_finish)(struct net_device *ndev,
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: stmmac: add support for platform specific config.
2025-06-06 11:41 [PATCH] net: stmmac: add support for platform specific config Xandy.Xiong
@ 2025-06-06 13:12 ` Simon Horman
2025-06-06 16:46 ` Russell King (Oracle)
1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-06-06 13:12 UTC (permalink / raw)
To: Xandy.Xiong
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
Russell King (Oracle), Furong Xu, netdev, linux-kernel
On Fri, Jun 06, 2025 at 07:41:55PM +0800, Xandy.Xiong wrote:
> This patch adds support for platform-specific init config in the
> stmmac driver. As SMMU remap, must after dma descriptor setup,
> and same mac link caps must init before phy init. To support these feature,
> a new function pointer 'fix_mac_config' is added to the
> plat_stmmacenet_data structure.
> And call the function pointer 'fix_mac_config' in the __stmmac_open().
>
> Signed-off-by: Xandy.Xiong <xiongliang@xiaomi.com>
Hi,
I think that there needs to be an in-tree user of this callback
for it to be added. And that such a user should be included
in the same patch-set that adds the callback.
Moreover...
## Form letter - net-next-closed
The merge window for v6.16 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations. We are
currently accepting bug fixes only.
Please repost when net-next reopens after June 8th.
RFC patches sent for review only are obviously welcome at any time.
--
pw-bot: changes-requested
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: stmmac: add support for platform specific config.
2025-06-06 11:41 [PATCH] net: stmmac: add support for platform specific config Xandy.Xiong
2025-06-06 13:12 ` Simon Horman
@ 2025-06-06 16:46 ` Russell King (Oracle)
2025-06-06 16:49 ` Andrew Lunn
1 sibling, 1 reply; 4+ messages in thread
From: Russell King (Oracle) @ 2025-06-06 16:46 UTC (permalink / raw)
To: Xandy.Xiong
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Maxime Coquelin, Alexandre Torgue, Furong Xu, netdev,
linux-kernel
On Fri, Jun 06, 2025 at 07:41:55PM +0800, Xandy.Xiong wrote:
> This patch adds support for platform-specific init config in the
> stmmac driver. As SMMU remap, must after dma descriptor setup,
> and same mac link caps must init before phy init. To support these feature,
> a new function pointer 'fix_mac_config' is added to the
> plat_stmmacenet_data structure.
> And call the function pointer 'fix_mac_config' in the __stmmac_open().
We need to see the use case for any new hook.
I'm afraid we've seen way too many cases of new hooks added to the
kernel tree only to never see their corresponding implementations
come along, so now there's a requirement to post an implementation
along with a hook.
Also, please review the netdev FAQ, if you can find it... I can't
anymore. It'll tell you how to submit patches, when to submit them,
how to indicate which tree, etc.
You can find the source file for what I think _was_ the FAQ at:
Documentation/process/maintainer-netdev.rst
but this doesn't seem to be in the documentation tree on kernel.org
(or at least is not in an obvious place.)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: stmmac: add support for platform specific config.
2025-06-06 16:46 ` Russell King (Oracle)
@ 2025-06-06 16:49 ` Andrew Lunn
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2025-06-06 16:49 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Xandy.Xiong, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
Furong Xu, netdev, linux-kernel
> Also, please review the netdev FAQ, if you can find it...
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
It got renamed, since it is no longer a set of questions and answers.
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-06 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 11:41 [PATCH] net: stmmac: add support for platform specific config Xandy.Xiong
2025-06-06 13:12 ` Simon Horman
2025-06-06 16:46 ` Russell King (Oracle)
2025-06-06 16:49 ` Andrew Lunn
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).