* [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method
@ 2026-01-26 12:33 Russell King (Oracle)
2026-01-26 13:29 ` Maxime Chevallier
2026-01-28 1:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2026-01-26 12:33 UTC (permalink / raw)
To: Andrew Lunn
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet, imx,
Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
Paolo Abeni, Pengutronix Kernel Team, Sascha Hauer, Shawn Guo
As the stmmac_priv struct is passed to the fix_soc_reset() method which
has the ioaddr, there is no need to pass ioaddr separately. Pass just
the stmmac_priv struct. Fix up the glues that use it.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 8 +++++---
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 ++++--
drivers/net/ethernet/stmicro/stmmac/hwif.c | 2 +-
include/linux/stmmac.h | 2 +-
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index c722ff2dc1fc..97de4726208e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -46,7 +46,7 @@ struct imx_dwmac_ops {
u32 flags;
bool mac_rgmii_txclk_auto_adj;
- int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr);
+ int (*fix_soc_reset)(struct stmmac_priv *priv);
int (*set_intf_mode)(struct imx_priv_data *dwmac, u8 phy_intf_sel);
void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
};
@@ -220,12 +220,14 @@ static void imx93_dwmac_fix_speed(void *priv, int speed, unsigned int mode)
writel(old_ctrl, dwmac->base_addr + MAC_CTRL_REG);
}
-static int imx_dwmac_mx93_reset(struct stmmac_priv *priv, void __iomem *ioaddr)
+static int imx_dwmac_mx93_reset(struct stmmac_priv *priv)
{
struct plat_stmmacenet_data *plat_dat = priv->plat;
- u32 value = readl(ioaddr + DMA_BUS_MODE);
+ void __iomem *ioaddr = priv->ioaddr;
+ u32 value;
/* DMA SW reset */
+ value = readl(ioaddr + DMA_BUS_MODE);
value |= DMA_BUS_MODE_SFT_RESET;
writel(value, ioaddr + DMA_BUS_MODE);
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 4f2b5bd6cb31..ed0b534d8d7b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -485,10 +485,12 @@ static int loongson_dwmac_acpi_config(struct pci_dev *pdev,
}
/* Loongson's DWMAC device may take nearly two seconds to complete DMA reset */
-static int loongson_dwmac_fix_reset(struct stmmac_priv *priv, void __iomem *ioaddr)
+static int loongson_dwmac_fix_reset(struct stmmac_priv *priv)
{
- u32 value = readl(ioaddr + DMA_BUS_MODE);
+ void __iomem *ioaddr = priv->ioaddr;
+ u32 value;
+ value = readl(ioaddr + DMA_BUS_MODE);
if (value & DMA_BUS_MODE_SFT_RESET) {
netdev_err(priv->dev, "the PHY clock is missing\n");
return -EINVAL;
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index 014f7cd79a3c..7e69ff4b9a98 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -109,7 +109,7 @@ int stmmac_reset(struct stmmac_priv *priv)
void __iomem *ioaddr = priv->ioaddr;
if (plat && plat->fix_soc_reset)
- return plat->fix_soc_reset(priv, ioaddr);
+ return plat->fix_soc_reset(priv);
return stmmac_do_callback(priv, dma, reset, ioaddr);
}
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index e308c98c7bd3..5199451dd0bc 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -257,7 +257,7 @@ struct plat_stmmacenet_data {
int (*set_clk_tx_rate)(void *priv, struct clk *clk_tx_i,
phy_interface_t interface, int speed);
void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
- int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr);
+ int (*fix_soc_reset)(struct stmmac_priv *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.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method
2026-01-26 12:33 [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method Russell King (Oracle)
@ 2026-01-26 13:29 ` Maxime Chevallier
2026-01-28 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-01-26 13:29 UTC (permalink / raw)
To: Russell King (Oracle), Andrew Lunn
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet, imx,
Jakub Kicinski, linux-arm-kernel, linux-stm32, netdev,
Paolo Abeni, Pengutronix Kernel Team, Sascha Hauer, Shawn Guo
Hi,
On 26/01/2026 13:33, Russell King (Oracle) wrote:
> As the stmmac_priv struct is passed to the fix_soc_reset() method which
> has the ioaddr, there is no need to pass ioaddr separately. Pass just
> the stmmac_priv struct. Fix up the glues that use it.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method
2026-01-26 12:33 [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method Russell King (Oracle)
2026-01-26 13:29 ` Maxime Chevallier
@ 2026-01-28 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-28 1:40 UTC (permalink / raw)
To: Russell King
Cc: andrew, alexandre.torgue, andrew+netdev, davem, edumazet, imx,
kuba, linux-arm-kernel, linux-stm32, netdev, pabeni, kernel,
s.hauer, shawnguo
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 26 Jan 2026 12:33:14 +0000 you wrote:
> As the stmmac_priv struct is passed to the fix_soc_reset() method which
> has the ioaddr, there is no need to pass ioaddr separately. Pass just
> the stmmac_priv struct. Fix up the glues that use it.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 8 +++++---
> drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 6 ++++--
> drivers/net/ethernet/stmicro/stmmac/hwif.c | 2 +-
> include/linux/stmmac.h | 2 +-
> 4 files changed, 11 insertions(+), 7 deletions(-)
Here is the summary with links:
- [net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method
https://git.kernel.org/netdev/net-next/c/d64f761dbfda
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-28 1:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 12:33 [PATCH net-next] net: stmmac: don't pass ioaddr to fix_soc_reset() method Russell King (Oracle)
2026-01-26 13:29 ` Maxime Chevallier
2026-01-28 1:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox