[PATCH net-next v2 11/17] net: stmmac: move priv->eee_enabled into stmmac_eee_init()

Andrew Lunn andrew at lunn.ch
Mon Jan 6 09:04:14 PST 2025


On Mon, Jan 06, 2025 at 12:25:39PM +0000, Russell King (Oracle) wrote:
> All call sites for stmmac_eee_init() assign the return code to
> priv->eee_enabled. Rather than having this coded at each call site,
> move the assignment inside stmmac_eee_init().
> 
> Since stmmac_init_eee() takes priv->lock before checking the state of
> priv->eee_enabled, move the assignment within the locked region. Also,
> stmmac_suspend() checks the state of this member under the lock. While
> two concurrent calls to stmmac_init_eee() aren't possible, there is
> a possibility that stmmac_suspend() may run concurrently with a change
> of priv->eee_enabled unless we modify it under the lock.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew at lunn.ch>

    Andrew



More information about the linux-arm-kernel mailing list