003-via-rhine-crash-fix.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- a/drivers/net/ethernet/via/via-rhine.c
  2. +++ b/drivers/net/ethernet/via/via-rhine.c
  3. @@ -689,9 +689,12 @@ static void __devinit rhine_reload_eepro
  4. #ifdef CONFIG_NET_POLL_CONTROLLER
  5. static void rhine_poll(struct net_device *dev)
  6. {
  7. - disable_irq(dev->irq);
  8. - rhine_interrupt(dev->irq, (void *)dev);
  9. - enable_irq(dev->irq);
  10. + struct rhine_private *rp = netdev_priv(dev);
  11. + const int irq = rp->pdev->irq;
  12. +
  13. + disable_irq(irq);
  14. + rhine_interrupt(irq, dev);
  15. + enable_irq(irq);
  16. }
  17. #endif
  18. @@ -929,7 +932,6 @@ static int __devinit rhine_init_one(stru
  19. dev = alloc_etherdev(sizeof(struct rhine_private));
  20. if (!dev) {
  21. rc = -ENOMEM;
  22. - dev_err(&pdev->dev, "alloc_etherdev failed\n");
  23. goto err_out;
  24. }
  25. SET_NETDEV_DEV(dev, &pdev->dev);
  26. @@ -973,7 +975,6 @@ static int __devinit rhine_init_one(stru
  27. }
  28. #endif /* USE_MMIO */
  29. - dev->base_addr = (unsigned long)ioaddr;
  30. rp->base = ioaddr;
  31. /* Get chip registers into a sane state */
  32. @@ -996,8 +997,6 @@ static int __devinit rhine_init_one(stru
  33. if (!phy_id)
  34. phy_id = ioread8(ioaddr + 0x6C);
  35. - dev->irq = pdev->irq;
  36. -
  37. spin_lock_init(&rp->lock);
  38. mutex_init(&rp->task_lock);
  39. INIT_WORK(&rp->reset_task, rhine_reset_task);
  40. @@ -1158,7 +1157,6 @@ static void alloc_rbufs(struct net_devic
  41. rp->rx_skbuff[i] = skb;
  42. if (skb == NULL)
  43. break;
  44. - skb->dev = dev; /* Mark as being used by this device. */
  45. rp->rx_skbuff_dma[i] =
  46. pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz,
  47. @@ -1943,7 +1941,6 @@ static int rhine_rx(struct net_device *d
  48. rp->rx_skbuff[entry] = skb;
  49. if (skb == NULL)
  50. break; /* Better luck next round. */
  51. - skb->dev = dev; /* Mark as being used by this device. */
  52. rp->rx_skbuff_dma[entry] =
  53. pci_map_single(rp->pdev, skb->data,
  54. rp->rx_buf_sz,