Skip to content

Commit 8153bce

Browse files
danish-tigregkh
authored andcommitted
net: ti: icssg-prueth: Fix emac link speed handling
[ Upstream commit 06feac1 ] 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: 9facce8 ("net: ti: icssg-prueth: Fix firmware load sequence.") Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Message-ID: <20250805173812.2183161-1-danishanwar@ti.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a2cb4df commit 8153bce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/ti/icssg/icssg_prueth.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
/* CTRLMMR_ICSSG_RGMII_CTRL register bits */
5151
#define ICSSG_CTRL_RGMII_ID_MODE BIT(24)
5252

53+
static void emac_adjust_link(struct net_device *ndev);
54+
5355
static int emac_get_tx_ts(struct prueth_emac *emac,
5456
struct emac_tx_ts_response *rsp)
5557
{
@@ -266,6 +268,10 @@ static int prueth_emac_common_start(struct prueth *prueth)
266268
ret = icssg_config(prueth, emac, slice);
267269
if (ret)
268270
goto disable_class;
271+
272+
mutex_lock(&emac->ndev->phydev->lock);
273+
emac_adjust_link(emac->ndev);
274+
mutex_unlock(&emac->ndev->phydev->lock);
269275
}
270276

271277
ret = prueth_emac_start(prueth);

0 commit comments

Comments
 (0)