Advertisement
Guest User

Untitled

a guest
May 6th, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. diff --git a/drivers/net/ethernet/allwinner/sun8i-emac.c b/drivers/net/ethernet/allwinner/sun8i-emac.
  2. index 23b5e98..8e126f3 100644
  3. --- a/drivers/net/ethernet/allwinner/sun8i-emac.c
  4. +++ b/drivers/net/ethernet/allwinner/sun8i-emac.c
  5. @@ -17,6 +17,7 @@
  6. * - Jumbo frame
  7. * - features rx-all
  8. */
  9. +#include <linux/delay.h>
  10. #include <linux/bitops.h>
  11. #include <linux/clk.h>
  12. #include <linux/phy.h>
  13. @@ -895,9 +896,14 @@ static int sun8i_emac_open(struct net_device *ndev)
  14. /*TODO err = readl_poll_timeout(priv->base + SUN8I_EMAC_BASIC_CTL1, v,
  15. !(v & 0x01), 100, 10000);*/
  16. /* wait for reset to be ended */
  17. + int t = 0;
  18. do {
  19. v = readl(priv->base + SUN8I_EMAC_BASIC_CTL1);
  20. + msleep(10);
  21. + t++;
  22. } while ((v & 0x01) != 0 && timeout++ < 50);
  23. +
  24. + pr_info("%s: retry: %d\n", __func__, t);
  25. if (timeout >= 50) {
  26. dev_err(priv->dev, "EMAC reset timeout\n");
  27. err = -EFAULT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement