Re: [PATCH net] net: ti: icssg-prueth: Fix emac link speed handling

From: Andrew Lunn
Date: Thu Jul 31 2025 - 11:00:38 EST


On Thu, Jul 31, 2025 at 05:38: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.

It is only safe to access phydev members when the phydev lock is
held. When phylib calls emac_adjust_link() it is holding this lock, so
MAC drivers don't need to worry about it. However, if you call it
directly, without the lock, bad things will happen.

Andrew

---
pw-bot: cr