net: bcmgenet: Fix EEE implementation
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Tue, 6 Jun 2023 21:43:47 +0000 (14:43 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Jun 2023 04:53:14 +0000 (21:53 -0700)
commita9f31047baca57d47440c879cf259b86f900260c
treed21c792962cf7b44aafc4af8defb3ac4d50682f0
parentf0d751973f739feb3742d4e5f4c0914e8b84e7c7
net: bcmgenet: Fix EEE implementation

We had a number of short comings:

- EEE must be re-evaluated whenever the state machine detects a link
  change as wight be switching from a link partner with EEE
  enabled/disabled

- tx_lpi_enabled controls whether EEE should be enabled/disabled for the
  transmit path, which applies to the TBUF block

- We do not need to forcibly enable EEE upon system resume, as the PHY
  state machine will trigger a link event that will do that, too

Fixes: 6ef398ea60d9 ("net: bcmgenet: add EEE support")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20230606214348.2408018-1-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h
drivers/net/ethernet/broadcom/genet/bcmmii.c