linux/3.3: merge recent ubifs patches from 3.2
[openwrt.git] / target / linux / lantiq / patches / 850-etop_irq.patch
1 Index: linux-3.1.10/drivers/net/lantiq_etop.c
2 ===================================================================
3 --- linux-3.1.10.orig/drivers/net/lantiq_etop.c 2012-02-23 09:06:47.274557678 +0100
4 +++ linux-3.1.10/drivers/net/lantiq_etop.c 2012-02-23 09:07:03.006558044 +0100
5 @@ -203,8 +203,10 @@
6 {
7 struct ltq_etop_chan *ch = container_of(napi,
8 struct ltq_etop_chan, napi);
9 + struct ltq_etop_priv *priv = netdev_priv(ch->netdev);
10 int rx = 0;
11 int complete = 0;
12 + unsigned long flags;
13
14 while ((rx < budget) && !complete) {
15 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
16 @@ -218,7 +220,9 @@
17 }
18 if (complete || !rx) {
19 napi_complete(&ch->napi);
20 + spin_lock_irqsave(&priv->lock, flags);
21 ltq_dma_ack_irq(&ch->dma);
22 + spin_unlock_irqrestore(&priv->lock, flags);
23 }
24 return rx;
25 }
26 @@ -248,7 +252,9 @@
27 if (netif_tx_queue_stopped(txq))
28 netif_tx_start_queue(txq);
29 napi_complete(&ch->napi);
30 + spin_lock_irqsave(&priv->lock, flags);
31 ltq_dma_ack_irq(&ch->dma);
32 + spin_unlock_irqrestore(&priv->lock, flags);
33 return 1;
34 }
35
36 @@ -615,13 +621,16 @@
37 {
38 struct ltq_etop_priv *priv = netdev_priv(dev);
39 int i;
40 + unsigned long flags;
41
42 for (i = 0; i < MAX_DMA_CHAN; i++) {
43 struct ltq_etop_chan *ch = &priv->ch[i];
44
45 if (!IS_TX(i) && (!IS_RX(i)))
46 continue;
47 + spin_lock_irqsave(&priv->lock, flags);
48 ltq_dma_open(&ch->dma);
49 + spin_unlock_irqrestore(&priv->lock, flags);
50 napi_enable(&ch->napi);
51 }
52 if (priv->phydev)
53 @@ -635,6 +644,7 @@
54 {
55 struct ltq_etop_priv *priv = netdev_priv(dev);
56 int i;
57 + unsigned long flags;
58
59 netif_tx_stop_all_queues(dev);
60 if (priv->phydev)
61 @@ -645,7 +655,9 @@
62 if (!IS_RX(i) && !IS_TX(i))
63 continue;
64 napi_disable(&ch->napi);
65 + spin_lock_irqsave(&priv->lock, flags);
66 ltq_dma_close(&ch->dma);
67 + spin_unlock_irqrestore(&priv->lock, flags);
68 }
69 return 0;
70 }
This page took 0.053752 seconds and 5 git commands to generate.