aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ucc_geth.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7fff4c5a1693..41ad2f3697c7 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1651,25 +1651,28 @@ static void adjust_link(struct net_device *dev)
1651 ugeth->oldspeed = phydev->speed; 1651 ugeth->oldspeed = phydev->speed;
1652 } 1652 }
1653 1653
1654 /*
1655 * To change the MAC configuration we need to disable the
1656 * controller. To do so, we have to either grab ugeth->lock,
1657 * which is a bad idea since 'graceful stop' commands might
1658 * take quite a while, or we can quiesce driver's activity.
1659 */
1660 ugeth_quiesce(ugeth);
1661 ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
1662
1663 out_be32(&ug_regs->maccfg2, tempval);
1664 out_be32(&uf_regs->upsmr, upsmr);
1665
1666 ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);
1667 ugeth_activate(ugeth);
1668
1669 if (!ugeth->oldlink) { 1654 if (!ugeth->oldlink) {
1670 new_state = 1; 1655 new_state = 1;
1671 ugeth->oldlink = 1; 1656 ugeth->oldlink = 1;
1672 } 1657 }
1658
1659 if (new_state) {
1660 /*
1661 * To change the MAC configuration we need to disable
1662 * the controller. To do so, we have to either grab
1663 * ugeth->lock, which is a bad idea since 'graceful
1664 * stop' commands might take quite a while, or we can
1665 * quiesce driver's activity.
1666 */
1667 ugeth_quiesce(ugeth);
1668 ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
1669
1670 out_be32(&ug_regs->maccfg2, tempval);
1671 out_be32(&uf_regs->upsmr, upsmr);
1672
1673 ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);
1674 ugeth_activate(ugeth);
1675 }
1673 } else if (ugeth->oldlink) { 1676 } else if (ugeth->oldlink) {
1674 new_state = 1; 1677 new_state = 1;
1675 ugeth->oldlink = 0; 1678 ugeth->oldlink = 0;