2
0

106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. --- a/drivers/net/ethernet/korina.c
  2. +++ b/drivers/net/ethernet/korina.c
  3. @@ -122,8 +122,6 @@ struct korina_private {
  4. int rx_irq;
  5. int tx_irq;
  6. - int ovr_irq;
  7. - int und_irq;
  8. spinlock_t lock; /* NIC xmit lock */
  9. @@ -891,8 +889,6 @@ static void korina_restart_task(struct w
  10. */
  11. disable_irq(lp->rx_irq);
  12. disable_irq(lp->tx_irq);
  13. - disable_irq(lp->ovr_irq);
  14. - disable_irq(lp->und_irq);
  15. writel(readl(&lp->tx_dma_regs->dmasm) |
  16. DMA_STAT_FINI | DMA_STAT_ERR,
  17. @@ -911,40 +907,10 @@ static void korina_restart_task(struct w
  18. }
  19. korina_multicast_list(dev);
  20. - enable_irq(lp->und_irq);
  21. - enable_irq(lp->ovr_irq);
  22. enable_irq(lp->tx_irq);
  23. enable_irq(lp->rx_irq);
  24. }
  25. -static void korina_clear_and_restart(struct net_device *dev, u32 value)
  26. -{
  27. - struct korina_private *lp = netdev_priv(dev);
  28. -
  29. - netif_stop_queue(dev);
  30. - writel(value, &lp->eth_regs->ethintfc);
  31. - schedule_work(&lp->restart_task);
  32. -}
  33. -
  34. -/* Ethernet Tx Underflow interrupt */
  35. -static irqreturn_t korina_und_interrupt(int irq, void *dev_id)
  36. -{
  37. - struct net_device *dev = dev_id;
  38. - struct korina_private *lp = netdev_priv(dev);
  39. - unsigned int und;
  40. -
  41. - spin_lock(&lp->lock);
  42. -
  43. - und = readl(&lp->eth_regs->ethintfc);
  44. -
  45. - if (und & ETH_INT_FC_UND)
  46. - korina_clear_and_restart(dev, und & ~ETH_INT_FC_UND);
  47. -
  48. - spin_unlock(&lp->lock);
  49. -
  50. - return IRQ_HANDLED;
  51. -}
  52. -
  53. static void korina_tx_timeout(struct net_device *dev)
  54. {
  55. struct korina_private *lp = netdev_priv(dev);
  56. @@ -952,25 +918,6 @@ static void korina_tx_timeout(struct net
  57. schedule_work(&lp->restart_task);
  58. }
  59. -/* Ethernet Rx Overflow interrupt */
  60. -static irqreturn_t
  61. -korina_ovr_interrupt(int irq, void *dev_id)
  62. -{
  63. - struct net_device *dev = dev_id;
  64. - struct korina_private *lp = netdev_priv(dev);
  65. - unsigned int ovr;
  66. -
  67. - spin_lock(&lp->lock);
  68. - ovr = readl(&lp->eth_regs->ethintfc);
  69. -
  70. - if (ovr & ETH_INT_FC_OVR)
  71. - korina_clear_and_restart(dev, ovr & ~ETH_INT_FC_OVR);
  72. -
  73. - spin_unlock(&lp->lock);
  74. -
  75. - return IRQ_HANDLED;
  76. -}
  77. -
  78. #ifdef CONFIG_NET_POLL_CONTROLLER
  79. static void korina_poll_controller(struct net_device *dev)
  80. {
  81. @@ -993,8 +940,7 @@ static int korina_open(struct net_device
  82. }
  83. /* Install the interrupt handler
  84. - * that handles the Done Finished
  85. - * Ovr and Und Events */
  86. + * that handles the Done Finished */
  87. ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt,
  88. 0, "Korina ethernet Rx", dev);
  89. if (ret < 0) {
  90. @@ -1010,31 +956,10 @@ static int korina_open(struct net_device
  91. goto err_free_rx_irq;
  92. }
  93. - /* Install handler for overrun error. */
  94. - ret = request_irq(lp->ovr_irq, korina_ovr_interrupt,
  95. - 0, "Ethernet Overflow", dev);
  96. - if (ret < 0) {
  97. - printk(KERN_ERR "%s: unable to get OVR IRQ %d\n",
  98. - dev->name, lp->ovr_irq);
  99. - goto err_free_tx_irq;
  100. - }
  101. -
  102. - /* Install handler for underflow error. */
  103. - ret = request_irq(lp->und_irq, korina_und_interrupt,
  104. - 0, "Ethernet Underflow", dev);
  105. - if (ret < 0) {
  106. - printk(KERN_ERR "%s: unable to get UND IRQ %d\n",
  107. - dev->name, lp->und_irq);
  108. - goto err_free_ovr_irq;
  109. - }
  110. mod_timer(&lp->media_check_timer, jiffies + 1);
  111. out:
  112. return ret;
  113. -err_free_ovr_irq:
  114. - free_irq(lp->ovr_irq, dev);
  115. -err_free_tx_irq:
  116. - free_irq(lp->tx_irq, dev);
  117. err_free_rx_irq:
  118. free_irq(lp->rx_irq, dev);
  119. err_release:
  120. @@ -1052,8 +977,6 @@ static int korina_close(struct net_devic
  121. /* Disable interrupts */
  122. disable_irq(lp->rx_irq);
  123. disable_irq(lp->tx_irq);
  124. - disable_irq(lp->ovr_irq);
  125. - disable_irq(lp->und_irq);
  126. korina_abort_tx(dev);
  127. tmp = readl(&lp->tx_dma_regs->dmasm);
  128. @@ -1073,8 +996,6 @@ static int korina_close(struct net_devic
  129. free_irq(lp->rx_irq, dev);
  130. free_irq(lp->tx_irq, dev);
  131. - free_irq(lp->ovr_irq, dev);
  132. - free_irq(lp->und_irq, dev);
  133. return 0;
  134. }
  135. @@ -1113,8 +1034,6 @@ static int korina_probe(struct platform_
  136. lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx");
  137. lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx");
  138. - lp->ovr_irq = platform_get_irq_byname(pdev, "korina_ovr");
  139. - lp->und_irq = platform_get_irq_byname(pdev, "korina_und");
  140. r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs");
  141. dev->base_addr = r->start;