diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-08-14 19:52:52 -0400 |
---|---|---|
committer | David S. Miller <davem@greenl8ke.davemloft.net> | 2014-08-16 22:13:33 -0400 |
commit | 4fd14e0b4a4fdb57a2b96659cb8adae255cd225d (patch) | |
tree | 9a46c9a1c1c83425a3f425d5d9e475a97a8e0979 /drivers/net/phy | |
parent | 16466f4284154311f163a58b77379eb186274f87 (diff) |
net: phy: bcm7xxx: re-advertise all supported modes out of suspend
The BCM7xxx internal Gigabit PHYs on 28nm process platforms come out
reset without any half-duplex or "hub" compatible advertised modes,
which was causing auto-negotiation issues coming out of S3
suspend/resume, we just could not establish a link with a half-duplex
only link partner.
Make sure that the resume function properly re-configures the PHY device
to advertise all supported modes.
Fixes: b560a58c45c6 ("net: phy: add Broadcom BCM7xxx internal PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@greenl8ke.davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/bcm7xxx.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 2b40548c85d5..a8ca03ff4f1e 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c | |||
@@ -157,6 +157,23 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev) | |||
157 | return bcm7xxx_28nm_afe_config_init(phydev); | 157 | return bcm7xxx_28nm_afe_config_init(phydev); |
158 | } | 158 | } |
159 | 159 | ||
160 | static int bcm7xxx_28nm_resume(struct phy_device *phydev) | ||
161 | { | ||
162 | int ret; | ||
163 | |||
164 | /* Re-apply workarounds coming out suspend/resume */ | ||
165 | ret = bcm7xxx_28nm_config_init(phydev); | ||
166 | if (ret) | ||
167 | return ret; | ||
168 | |||
169 | /* 28nm Gigabit PHYs come out of reset without any half-duplex | ||
170 | * or "hub" compliant advertised mode, fix that. This does not | ||
171 | * cause any problems with the PHY library since genphy_config_aneg() | ||
172 | * gracefully handles auto-negotiated and forced modes. | ||
173 | */ | ||
174 | return genphy_config_aneg(phydev); | ||
175 | } | ||
176 | |||
160 | static int phy_set_clr_bits(struct phy_device *dev, int location, | 177 | static int phy_set_clr_bits(struct phy_device *dev, int location, |
161 | int set_mask, int clr_mask) | 178 | int set_mask, int clr_mask) |
162 | { | 179 | { |
@@ -258,7 +275,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
258 | .config_aneg = genphy_config_aneg, | 275 | .config_aneg = genphy_config_aneg, |
259 | .read_status = genphy_read_status, | 276 | .read_status = genphy_read_status, |
260 | .suspend = bcm7xxx_suspend, | 277 | .suspend = bcm7xxx_suspend, |
261 | .resume = bcm7xxx_28nm_afe_config_init, | 278 | .resume = bcm7xxx_28nm_resume, |
262 | .driver = { .owner = THIS_MODULE }, | 279 | .driver = { .owner = THIS_MODULE }, |
263 | }, { | 280 | }, { |
264 | .phy_id = PHY_ID_BCM7439, | 281 | .phy_id = PHY_ID_BCM7439, |
@@ -271,7 +288,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
271 | .config_aneg = genphy_config_aneg, | 288 | .config_aneg = genphy_config_aneg, |
272 | .read_status = genphy_read_status, | 289 | .read_status = genphy_read_status, |
273 | .suspend = bcm7xxx_suspend, | 290 | .suspend = bcm7xxx_suspend, |
274 | .resume = bcm7xxx_28nm_afe_config_init, | 291 | .resume = bcm7xxx_28nm_resume, |
275 | .driver = { .owner = THIS_MODULE }, | 292 | .driver = { .owner = THIS_MODULE }, |
276 | }, { | 293 | }, { |
277 | .phy_id = PHY_ID_BCM7445, | 294 | .phy_id = PHY_ID_BCM7445, |
@@ -284,7 +301,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
284 | .config_aneg = genphy_config_aneg, | 301 | .config_aneg = genphy_config_aneg, |
285 | .read_status = genphy_read_status, | 302 | .read_status = genphy_read_status, |
286 | .suspend = bcm7xxx_suspend, | 303 | .suspend = bcm7xxx_suspend, |
287 | .resume = bcm7xxx_28nm_config_init, | 304 | .resume = bcm7xxx_28nm_afe_config_init, |
288 | .driver = { .owner = THIS_MODULE }, | 305 | .driver = { .owner = THIS_MODULE }, |
289 | }, { | 306 | }, { |
290 | .phy_id = PHY_BCM_OUI_4, | 307 | .phy_id = PHY_BCM_OUI_4, |