diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-12-23 02:41:14 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-12-23 02:41:14 -0500 |
commit | cfb13c5db08c90311a5defdde9a0328ee788cca5 (patch) | |
tree | 842cb60d1d19b99e550fdbc653723e4b13e51ee5 /drivers/net/ucc_geth.c | |
parent | 4b6ba8aacbb3185703b797286547d0f8f3859b02 (diff) | |
parent | 90a8a73c06cc32b609a880d48449d7083327e11a (diff) |
Merge commit 'v2.6.37-rc7' into devicetree/next
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index f7e370fd8ddc..73a3e0d93237 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -2051,12 +2051,16 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2051 | 2051 | ||
2052 | ugeth_vdbg("%s: IN", __func__); | 2052 | ugeth_vdbg("%s: IN", __func__); |
2053 | 2053 | ||
2054 | /* | ||
2055 | * Tell the kernel the link is down. | ||
2056 | * Must be done before disabling the controller | ||
2057 | * or deadlock may happen. | ||
2058 | */ | ||
2059 | phy_stop(phydev); | ||
2060 | |||
2054 | /* Disable the controller */ | 2061 | /* Disable the controller */ |
2055 | ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); | 2062 | ugeth_disable(ugeth, COMM_DIR_RX_AND_TX); |
2056 | 2063 | ||
2057 | /* Tell the kernel the link is down */ | ||
2058 | phy_stop(phydev); | ||
2059 | |||
2060 | /* Mask all interrupts */ | 2064 | /* Mask all interrupts */ |
2061 | out_be32(ugeth->uccf->p_uccm, 0x00000000); | 2065 | out_be32(ugeth->uccf->p_uccm, 0x00000000); |
2062 | 2066 | ||
@@ -2066,9 +2070,6 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2066 | /* Disable Rx and Tx */ | 2070 | /* Disable Rx and Tx */ |
2067 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); | 2071 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2068 | 2072 | ||
2069 | phy_disconnect(ugeth->phydev); | ||
2070 | ugeth->phydev = NULL; | ||
2071 | |||
2072 | ucc_geth_memclean(ugeth); | 2073 | ucc_geth_memclean(ugeth); |
2073 | } | 2074 | } |
2074 | 2075 | ||
@@ -3551,7 +3552,10 @@ static int ucc_geth_close(struct net_device *dev) | |||
3551 | 3552 | ||
3552 | napi_disable(&ugeth->napi); | 3553 | napi_disable(&ugeth->napi); |
3553 | 3554 | ||
3555 | cancel_work_sync(&ugeth->timeout_work); | ||
3554 | ucc_geth_stop(ugeth); | 3556 | ucc_geth_stop(ugeth); |
3557 | phy_disconnect(ugeth->phydev); | ||
3558 | ugeth->phydev = NULL; | ||
3555 | 3559 | ||
3556 | free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev); | 3560 | free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev); |
3557 | 3561 | ||
@@ -3580,8 +3584,12 @@ static void ucc_geth_timeout_work(struct work_struct *work) | |||
3580 | * Must reset MAC *and* PHY. This is done by reopening | 3584 | * Must reset MAC *and* PHY. This is done by reopening |
3581 | * the device. | 3585 | * the device. |
3582 | */ | 3586 | */ |
3583 | ucc_geth_close(dev); | 3587 | netif_tx_stop_all_queues(dev); |
3584 | ucc_geth_open(dev); | 3588 | ucc_geth_stop(ugeth); |
3589 | ucc_geth_init_mac(ugeth); | ||
3590 | /* Must start PHY here */ | ||
3591 | phy_start(ugeth->phydev); | ||
3592 | netif_tx_start_all_queues(dev); | ||
3585 | } | 3593 | } |
3586 | 3594 | ||
3587 | netif_tx_schedule_all(dev); | 3595 | netif_tx_schedule_all(dev); |
@@ -3595,7 +3603,6 @@ static void ucc_geth_timeout(struct net_device *dev) | |||
3595 | { | 3603 | { |
3596 | struct ucc_geth_private *ugeth = netdev_priv(dev); | 3604 | struct ucc_geth_private *ugeth = netdev_priv(dev); |
3597 | 3605 | ||
3598 | netif_carrier_off(dev); | ||
3599 | schedule_work(&ugeth->timeout_work); | 3606 | schedule_work(&ugeth->timeout_work); |
3600 | } | 3607 | } |
3601 | 3608 | ||