summaryrefslogtreecommitdiff
path: root/target/linux/lantiq
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2012-02-14 15:05:58 +0000
committerJohn Crispin <john@openwrt.org>2012-02-14 15:05:58 +0000
commit0b07769898cde3733602a7c62b2a1130d5808c5b (patch)
treee338d7ca474095685fde8c68a8bbcf6bd8e44515 /target/linux/lantiq
parent55bf39e98cbe5bcedcb04366596605f44025aca6 (diff)
downloadmtk-20170518-0b07769898cde3733602a7c62b2a1130d5808c5b.zip
mtk-20170518-0b07769898cde3733602a7c62b2a1130d5808c5b.tar.gz
mtk-20170518-0b07769898cde3733602a7c62b2a1130d5808c5b.tar.bz2
fixes irq locking in ethernet driver
SVN-Revision: 30522
Diffstat (limited to 'target/linux/lantiq')
-rw-r--r--target/linux/lantiq/patches/850-etop_irq.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches/850-etop_irq.patch b/target/linux/lantiq/patches/850-etop_irq.patch
new file mode 100644
index 0000000..d0b8645
--- /dev/null
+++ b/target/linux/lantiq/patches/850-etop_irq.patch
@@ -0,0 +1,71 @@
+Index: linux-3.1.10/drivers/net/lantiq_etop.c
+===================================================================
+--- linux-3.1.10.orig/drivers/net/lantiq_etop.c 2012-02-09 10:07:01.180680919 +0100
++++ linux-3.1.10/drivers/net/lantiq_etop.c 2012-02-09 10:11:00.996691173 +0100
+@@ -203,8 +203,10 @@
+ {
+ struct ltq_etop_chan *ch = container_of(napi,
+ struct ltq_etop_chan, napi);
++ struct ltq_etop_priv *priv = netdev_priv(ch->netdev);
+ int rx = 0;
+ int complete = 0;
++ unsigned long flags;
+
+ while ((rx < budget) && !complete) {
+ struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
+@@ -218,7 +220,9 @@
+ }
+ if (complete || !rx) {
+ napi_complete(&ch->napi);
++ spin_lock_irqsave(&priv->lock, flags);
+ ltq_dma_ack_irq(&ch->dma);
++ spin_unlock_irqrestore(&priv->lock, flags);
+ }
+ return rx;
+ }
+@@ -248,7 +252,9 @@
+ if (netif_tx_queue_stopped(txq))
+ netif_tx_start_queue(txq);
+ napi_complete(&ch->napi);
++ spin_lock_irqsave(&priv->lock, flags);
+ ltq_dma_ack_irq(&ch->dma);
++ spin_unlock_irqrestore(&priv->lock, flags);
+ return 1;
+ }
+
+@@ -615,13 +621,17 @@
+ {
+ struct ltq_etop_priv *priv = netdev_priv(dev);
+ int i;
++ unsigned long flags;
+
+ for (i = 0; i < MAX_DMA_CHAN; i++) {
+ struct ltq_etop_chan *ch = &priv->ch[i];
+
+ if (!IS_TX(i) && (!IS_RX(i)))
+ continue;
++ spin_lock_irqsave(&priv->lock, flags);
+ ltq_dma_open(&ch->dma);
++ ltq_dma_ack_irq(&ch->dma);
++ spin_unlock_irqrestore(&priv->lock, flags);
+ napi_enable(&ch->napi);
+ }
+ if (priv->phydev)
+@@ -635,6 +645,7 @@
+ {
+ struct ltq_etop_priv *priv = netdev_priv(dev);
+ int i;
++ unsigned long flags;
+
+ netif_tx_stop_all_queues(dev);
+ if (priv->phydev)
+@@ -645,7 +656,9 @@
+ if (!IS_RX(i) && !IS_TX(i))
+ continue;
+ napi_disable(&ch->napi);
++ spin_lock_irqsave(&priv->lock, flags);
+ ltq_dma_close(&ch->dma);
++ spin_unlock_irqrestore(&priv->lock, flags);
+ }
+ return 0;
+ }