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