aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-07-14 16:13:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-14 16:13:41 -0400
commit252aa9d94a04252046f3a382e6aca1b5c95921d8 (patch)
tree5b265e4ae8011bd99938b2d4da5abac411aa6fc7 /drivers/net/wireless
parent8660c1240ec6016522b882c88751cb4ce40bf0e8 (diff)
Revert "NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines."
This reverts commit adeab1afb7de89555c69aab5ca21300c14af6369. As Alan Cox explained, the TTY layer changes that went recently to get rid of the tty->low_latency stuff fixes this already, and even for -stable it's the ->low_latency changes that should go in to fix this, rather than this patch. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/strip.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 3d39f6587eb9..38366a56b71f 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -856,7 +856,6 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
856 unsigned char *orbuff = strip_info->rx_buff; 856 unsigned char *orbuff = strip_info->rx_buff;
857 unsigned char *osbuff = strip_info->sx_buff; 857 unsigned char *osbuff = strip_info->sx_buff;
858 unsigned char *otbuff = strip_info->tx_buff; 858 unsigned char *otbuff = strip_info->tx_buff;
859 unsigned long flags;
860 859
861 if (new_mtu > MAX_SEND_MTU) { 860 if (new_mtu > MAX_SEND_MTU) {
862 printk(KERN_ERR 861 printk(KERN_ERR
@@ -865,11 +864,11 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
865 return -EINVAL; 864 return -EINVAL;
866 } 865 }
867 866
868 spin_lock_irqsave(&strip_lock, flags); 867 spin_lock_bh(&strip_lock);
869 if (!allocate_buffers(strip_info, new_mtu)) { 868 if (!allocate_buffers(strip_info, new_mtu)) {
870 printk(KERN_ERR "%s: unable to grow strip buffers, MTU change cancelled.\n", 869 printk(KERN_ERR "%s: unable to grow strip buffers, MTU change cancelled.\n",
871 strip_info->dev->name); 870 strip_info->dev->name);
872 spin_unlock_irqrestore(&strip_lock, flags); 871 spin_unlock_bh(&strip_lock);
873 return -ENOMEM; 872 return -ENOMEM;
874 } 873 }
875 874
@@ -893,7 +892,7 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
893 } 892 }
894 } 893 }
895 strip_info->tx_head = strip_info->tx_buff; 894 strip_info->tx_head = strip_info->tx_buff;
896 spin_unlock_irqrestore(&strip_lock, flags); 895 spin_unlock_bh(&strip_lock);
897 896
898 printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n", 897 printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n",
899 strip_info->dev->name, old_mtu, strip_info->mtu); 898 strip_info->dev->name, old_mtu, strip_info->mtu);
@@ -984,13 +983,10 @@ static void strip_seq_neighbours(struct seq_file *seq,
984 const MetricomNodeTable * table, 983 const MetricomNodeTable * table,
985 const char *title) 984 const char *title)
986{ 985{
987 unsigned long flags; 986 /* We wrap this in a do/while loop, so if the table changes */
987 /* while we're reading it, we just go around and try again. */
988 struct timeval t; 988 struct timeval t;
989 989
990 /*
991 * We wrap this in a do/while loop, so if the table changes
992 * while we're reading it, we just go around and try again.
993 */
994 do { 990 do {
995 int i; 991 int i;
996 t = table->timestamp; 992 t = table->timestamp;
@@ -999,9 +995,9 @@ static void strip_seq_neighbours(struct seq_file *seq,
999 for (i = 0; i < table->num_nodes; i++) { 995 for (i = 0; i < table->num_nodes; i++) {
1000 MetricomNode node; 996 MetricomNode node;
1001 997
1002 spin_lock_irqsave(&strip_lock, flags); 998 spin_lock_bh(&strip_lock);
1003 node = table->node[i]; 999 node = table->node[i];
1004 spin_unlock_irqrestore(&strip_lock, flags); 1000 spin_unlock_bh(&strip_lock);
1005 seq_printf(seq, " %s\n", node.c); 1001 seq_printf(seq, " %s\n", node.c);
1006 } 1002 }
1007 } while (table->timestamp.tv_sec != t.tv_sec 1003 } while (table->timestamp.tv_sec != t.tv_sec
@@ -1540,7 +1536,6 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb)
1540static int strip_xmit(struct sk_buff *skb, struct net_device *dev) 1536static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
1541{ 1537{
1542 struct strip *strip_info = netdev_priv(dev); 1538 struct strip *strip_info = netdev_priv(dev);
1543 unsigned long flags;
1544 1539
1545 if (!netif_running(dev)) { 1540 if (!netif_running(dev)) {
1546 printk(KERN_ERR "%s: xmit call when iface is down\n", 1541 printk(KERN_ERR "%s: xmit call when iface is down\n",
@@ -1579,11 +1574,11 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
1579 strip_info->dev->name, sx_pps_count / 8); 1574 strip_info->dev->name, sx_pps_count / 8);
1580 } 1575 }
1581 1576
1582 spin_lock_irqsave(&strip_lock, flags); 1577 spin_lock_bh(&strip_lock);
1583 1578
1584 strip_send(strip_info, skb); 1579 strip_send(strip_info, skb);
1585 1580
1586 spin_unlock_irqrestore(&strip_lock, flags); 1581 spin_unlock_bh(&strip_lock);
1587 1582
1588 if (skb) 1583 if (skb)
1589 dev_kfree_skb(skb); 1584 dev_kfree_skb(skb);
@@ -2268,13 +2263,12 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
2268{ 2263{
2269 struct strip *strip_info = tty->disc_data; 2264 struct strip *strip_info = tty->disc_data;
2270 const unsigned char *end = cp + count; 2265 const unsigned char *end = cp + count;
2271 unsigned long flags;
2272 2266
2273 if (!strip_info || strip_info->magic != STRIP_MAGIC 2267 if (!strip_info || strip_info->magic != STRIP_MAGIC
2274 || !netif_running(strip_info->dev)) 2268 || !netif_running(strip_info->dev))
2275 return; 2269 return;
2276 2270
2277 spin_lock_irqsave(&strip_lock, flags); 2271 spin_lock_bh(&strip_lock);
2278#if 0 2272#if 0
2279 { 2273 {
2280 struct timeval tv; 2274 struct timeval tv;
@@ -2341,7 +2335,7 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
2341 } 2335 }
2342 cp++; 2336 cp++;
2343 } 2337 }
2344 spin_unlock_irqrestore(&strip_lock, flags); 2338 spin_unlock_bh(&strip_lock);
2345} 2339}
2346 2340
2347 2341
@@ -2529,11 +2523,9 @@ static void strip_dev_setup(struct net_device *dev)
2529 2523
2530static void strip_free(struct strip *strip_info) 2524static void strip_free(struct strip *strip_info)
2531{ 2525{
2532 unsigned long flags; 2526 spin_lock_bh(&strip_lock);
2533
2534 spin_lock_irqsave(&strip_lock, flags);
2535 list_del_rcu(&strip_info->list); 2527 list_del_rcu(&strip_info->list);
2536 spin_unlock_irqrestore(&strip_lock, flags); 2528 spin_unlock_bh(&strip_lock);
2537 2529
2538 strip_info->magic = 0; 2530 strip_info->magic = 0;
2539 2531
@@ -2547,7 +2539,6 @@ static void strip_free(struct strip *strip_info)
2547static struct strip *strip_alloc(void) 2539static struct strip *strip_alloc(void)
2548{ 2540{
2549 struct list_head *n; 2541 struct list_head *n;
2550 unsigned long flags;
2551 struct net_device *dev; 2542 struct net_device *dev;
2552 struct strip *strip_info; 2543 struct strip *strip_info;
2553 2544
@@ -2571,7 +2562,7 @@ static struct strip *strip_alloc(void)
2571 strip_info->idle_timer.function = strip_IdleTask; 2562 strip_info->idle_timer.function = strip_IdleTask;
2572 2563
2573 2564
2574 spin_lock_irqsave(&strip_lock, flags); 2565 spin_lock_bh(&strip_lock);
2575 rescan: 2566 rescan:
2576 /* 2567 /*
2577 * Search the list to find where to put our new entry 2568 * Search the list to find where to put our new entry
@@ -2590,7 +2581,7 @@ static struct strip *strip_alloc(void)
2590 sprintf(dev->name, "st%ld", dev->base_addr); 2581 sprintf(dev->name, "st%ld", dev->base_addr);
2591 2582
2592 list_add_tail_rcu(&strip_info->list, &strip_list); 2583 list_add_tail_rcu(&strip_info->list, &strip_list);
2593 spin_unlock_irqrestore(&strip_lock, flags); 2584 spin_unlock_bh(&strip_lock);
2594 2585
2595 return strip_info; 2586 return strip_info;
2596} 2587}