Skip to content

Commit

Permalink
tg3 / broadcom: Refine AC131 APD support
Browse files Browse the repository at this point in the history
Auto power-down (APD) support is a power-saving feature.  It should be
selectively enabled since it might expose MAC bugs.  This patch changes
the code to enable APD only if the PHY_BRCM_AUTO_PWRDWN_ENABLE flag is
set.  The tg3 driver was changed to set this bit.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matt Carlson authored and David S. Miller committed Nov 3, 2009
1 parent 63a14ce commit cdd4e09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/phy/broadcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,11 @@ static int brcm_fet_config_init(struct phy_device *phydev)
if (err < 0)
goto done;

/* Enable auto power down */
err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
MII_BRCM_FET_SHDW_AS2_APDE);
if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) {
/* Enable auto power down */
err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2,
MII_BRCM_FET_SHDW_AS2_APDE);
}

done:
/* Disable shadow register access */
Expand Down
1 change: 1 addition & 0 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ static int tg3_mdio_init(struct tg3 *tp)
case TG3_PHY_ID_RTL8201E:
case TG3_PHY_ID_BCMAC131:
phydev->interface = PHY_INTERFACE_MODE_MII;
phydev->dev_flags |= PHY_BRCM_AUTO_PWRDWN_ENABLE;
tp->tg3_flags3 |= TG3_FLG3_PHY_IS_FET;
break;
}
Expand Down

0 comments on commit cdd4e09

Please sign in to comment.