* [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling
@ 2025-08-05 17:38 MD Danish Anwar
2025-08-06 15:47 ` Andrew Lunn
2025-08-08 19:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: MD Danish Anwar @ 2025-08-05 17:38 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Meghana Malladi, Himanshu Mittal
Cc: linux-arm-kernel, netdev, linux-kernel, srk, Vignesh Raghavendra,
Roger Quadros, danishanwar
When link settings are changed emac->speed is populated by
emac_adjust_link(). The link speed and other settings are then written into
the DRAM. However if both ports are brought down after this and brought up
again or if the operating mode is changed and a firmware reload is needed,
the DRAM is cleared by icssg_config(). As a result the link settings are
lost.
Fix this by calling emac_adjust_link() after icssg_config(). This re
populates the settings in the DRAM after a new firmware load.
Fixes: 9facce84f406 ("net: ti: icssg-prueth: Fix firmware load sequence.")
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
---
v2 - v3: Dropped the if check as it was not needed.
v2: https://lore.kernel.org/all/20250801121948.1492261-1-danishanwar@ti.com/
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 2b973d6e2341..6c7d776ae4ee 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -50,6 +50,8 @@
/* CTRLMMR_ICSSG_RGMII_CTRL register bits */
#define ICSSG_CTRL_RGMII_ID_MODE BIT(24)
+static void emac_adjust_link(struct net_device *ndev);
+
static int emac_get_tx_ts(struct prueth_emac *emac,
struct emac_tx_ts_response *rsp)
{
@@ -229,6 +231,10 @@ static int prueth_emac_common_start(struct prueth *prueth)
ret = icssg_config(prueth, emac, slice);
if (ret)
goto disable_class;
+
+ mutex_lock(&emac->ndev->phydev->lock);
+ emac_adjust_link(emac->ndev);
+ mutex_unlock(&emac->ndev->phydev->lock);
}
ret = prueth_emac_start(prueth);
base-commit: 4eabe4cc0958e28ceaf592bbb62c234339642e41
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling
2025-08-05 17:38 [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling MD Danish Anwar
@ 2025-08-06 15:47 ` Andrew Lunn
2025-08-08 19:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-08-06 15:47 UTC (permalink / raw)
To: MD Danish Anwar
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Meghana Malladi, Himanshu Mittal, linux-arm-kernel,
netdev, linux-kernel, srk, Vignesh Raghavendra, Roger Quadros
On Tue, Aug 05, 2025 at 11:08:12PM +0530, MD Danish Anwar wrote:
> When link settings are changed emac->speed is populated by
> emac_adjust_link(). The link speed and other settings are then written into
> the DRAM. However if both ports are brought down after this and brought up
> again or if the operating mode is changed and a firmware reload is needed,
> the DRAM is cleared by icssg_config(). As a result the link settings are
> lost.
>
> Fix this by calling emac_adjust_link() after icssg_config(). This re
> populates the settings in the DRAM after a new firmware load.
>
> Fixes: 9facce84f406 ("net: ti: icssg-prueth: Fix firmware load sequence.")
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling
2025-08-05 17:38 [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling MD Danish Anwar
2025-08-06 15:47 ` Andrew Lunn
@ 2025-08-08 19:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-08 19:30 UTC (permalink / raw)
To: MD Danish Anwar
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, m-malladi,
h-mittal1, linux-arm-kernel, netdev, linux-kernel, srk, vigneshr,
rogerq
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 5 Aug 2025 23:08:12 +0530 you wrote:
> When link settings are changed emac->speed is populated by
> emac_adjust_link(). The link speed and other settings are then written into
> the DRAM. However if both ports are brought down after this and brought up
> again or if the operating mode is changed and a firmware reload is needed,
> the DRAM is cleared by icssg_config(). As a result the link settings are
> lost.
>
> [...]
Here is the summary with links:
- [net,v3] net: ti: icssg-prueth: Fix emac link speed handling
https://git.kernel.org/netdev/net/c/06feac15406f
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:[~2025-08-08 19:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-05 17:38 [PATCH net v3] net: ti: icssg-prueth: Fix emac link speed handling MD Danish Anwar
2025-08-06 15:47 ` Andrew Lunn
2025-08-08 19:30 ` 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;
as well as URLs for NNTP newsgroup(s).