Skip to content

Commit

Permalink
net: qcom/emac: Change the order of mac up and sgmii open
Browse files Browse the repository at this point in the history
This patch fixes the order of mac_up and sgmii_open for the
reasons noted below:

- If open takes more time(if the SGMII block is not responding or
  if we want to do some delay based task) in this situation we
  will hit NETDEV watchdog
- The main reason : We should signal to upper layers that we are
  ready to receive packets "only" when the entire path is initialized
  not the other way around, this is followed in the reset path where
  we do mac_down, sgmii_reset and mac_up. This also makes the driver
  uniform across the reset and open paths.
- In the future there may be need for delay based tasks to be done in
  sgmii open which will result in NETDEV watchdog
- As per the documentation the order of init should be sgmii, mac, rings
  and DMA

Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
Acked-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hemanth Puranik authored and David S. Miller committed Dec 18, 2017
1 parent c505873 commit ac3241d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/qualcomm/emac/emac.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,18 @@ static int emac_open(struct net_device *netdev)
return ret;
}

ret = emac_mac_up(adpt);
ret = adpt->phy.open(adpt);
if (ret) {
emac_mac_rx_tx_rings_free_all(adpt);
free_irq(irq->irq, irq);
return ret;
}

ret = adpt->phy.open(adpt);
ret = emac_mac_up(adpt);
if (ret) {
emac_mac_down(adpt);
emac_mac_rx_tx_rings_free_all(adpt);
free_irq(irq->irq, irq);
adpt->phy.close(adpt);
return ret;
}

Expand Down

0 comments on commit ac3241d

Please sign in to comment.