aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Farnsworth <wfarnsworth@mvista.com>2009-07-01 09:00:34 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-02 16:16:55 -0400
commit42caa074042e22f873c408a0d13be657b16192f1 (patch)
tree669d03e8d66964989ca3486f2fc0802f0196dcf9
parent67c38fc61af930fa03b042932b6b14fbf8126222 (diff)
phylib: fixes for PHY_RESUMING state changes
The PHY_HALTED state disables phydev->link, but the link will not be updated upon entering PHY_RESUMING. Add a call to phy_read_status() to update the link before entering PHY_RUNNING. If the link is not up at this point, enter the PHY_NOLINK state instead. Also, when transitioning from PHY_RESUMING to PHY_RUNNING, calls to netif_carrier_on() and phydev->adjust_link() are missing. Add the calls similar to the other transitions to PHY_RUNNING. Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/phy.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 61755cbd978e..eda94fcd4065 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -928,13 +928,32 @@ static void phy_state_machine(struct work_struct *work)
928 * Otherwise, it's 0, and we're 928 * Otherwise, it's 0, and we're
929 * still waiting for AN */ 929 * still waiting for AN */
930 if (err > 0) { 930 if (err > 0) {
931 phydev->state = PHY_RUNNING; 931 err = phy_read_status(phydev);
932 if (err)
933 break;
934
935 if (phydev->link) {
936 phydev->state = PHY_RUNNING;
937 netif_carrier_on(phydev->attached_dev);
938 } else
939 phydev->state = PHY_NOLINK;
940 phydev->adjust_link(phydev->attached_dev);
932 } else { 941 } else {
933 phydev->state = PHY_AN; 942 phydev->state = PHY_AN;
934 phydev->link_timeout = PHY_AN_TIMEOUT; 943 phydev->link_timeout = PHY_AN_TIMEOUT;
935 } 944 }
936 } else 945 } else {
937 phydev->state = PHY_RUNNING; 946 err = phy_read_status(phydev);
947 if (err)
948 break;
949
950 if (phydev->link) {
951 phydev->state = PHY_RUNNING;
952 netif_carrier_on(phydev->attached_dev);
953 } else
954 phydev->state = PHY_NOLINK;
955 phydev->adjust_link(phydev->attached_dev);
956 }
938 break; 957 break;
939 } 958 }
940 959