diff options
-rw-r--r-- | drivers/net/hamradio/6pack.c | 10 | ||||
-rw-r--r-- | drivers/net/hamradio/mkiss.c | 41 | ||||
-rw-r--r-- | drivers/net/ppp_async.c | 11 | ||||
-rw-r--r-- | drivers/net/ppp_synctty.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/strip.c | 39 |
5 files changed, 44 insertions, 68 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 913a56406594..155160052c8b 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -398,14 +398,13 @@ static DEFINE_RWLOCK(disc_data_lock); | |||
398 | 398 | ||
399 | static struct sixpack *sp_get(struct tty_struct *tty) | 399 | static struct sixpack *sp_get(struct tty_struct *tty) |
400 | { | 400 | { |
401 | unsigned long flags; | ||
402 | struct sixpack *sp; | 401 | struct sixpack *sp; |
403 | 402 | ||
404 | read_lock_irqsave(&disc_data_lock, flags); | 403 | read_lock(&disc_data_lock); |
405 | sp = tty->disc_data; | 404 | sp = tty->disc_data; |
406 | if (sp) | 405 | if (sp) |
407 | atomic_inc(&sp->refcnt); | 406 | atomic_inc(&sp->refcnt); |
408 | read_unlock_irqrestore(&disc_data_lock, flags); | 407 | read_unlock(&disc_data_lock); |
409 | 408 | ||
410 | return sp; | 409 | return sp; |
411 | } | 410 | } |
@@ -689,13 +688,12 @@ out: | |||
689 | */ | 688 | */ |
690 | static void sixpack_close(struct tty_struct *tty) | 689 | static void sixpack_close(struct tty_struct *tty) |
691 | { | 690 | { |
692 | unsigned long flags; | ||
693 | struct sixpack *sp; | 691 | struct sixpack *sp; |
694 | 692 | ||
695 | write_lock_irqsave(&disc_data_lock, flags); | 693 | write_lock(&disc_data_lock); |
696 | sp = tty->disc_data; | 694 | sp = tty->disc_data; |
697 | tty->disc_data = NULL; | 695 | tty->disc_data = NULL; |
698 | write_unlock_irqrestore(&disc_data_lock, flags); | 696 | write_unlock(&disc_data_lock); |
699 | if (!sp) | 697 | if (!sp) |
700 | return; | 698 | return; |
701 | 699 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index a7286500c186..fda2fc83e9a1 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -244,16 +244,15 @@ static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc, | |||
244 | /* Send one completely decapsulated AX.25 packet to the AX.25 layer. */ | 244 | /* Send one completely decapsulated AX.25 packet to the AX.25 layer. */ |
245 | static void ax_bump(struct mkiss *ax) | 245 | static void ax_bump(struct mkiss *ax) |
246 | { | 246 | { |
247 | unsigned long flags; | ||
248 | struct sk_buff *skb; | 247 | struct sk_buff *skb; |
249 | int count; | 248 | int count; |
250 | 249 | ||
251 | spin_lock_irqsave(&ax->buflock, flags); | 250 | spin_lock_bh(&ax->buflock); |
252 | if (ax->rbuff[0] > 0x0f) { | 251 | if (ax->rbuff[0] > 0x0f) { |
253 | if (ax->rbuff[0] & 0x80) { | 252 | if (ax->rbuff[0] & 0x80) { |
254 | if (check_crc_16(ax->rbuff, ax->rcount) < 0) { | 253 | if (check_crc_16(ax->rbuff, ax->rcount) < 0) { |
255 | ax->dev->stats.rx_errors++; | 254 | ax->dev->stats.rx_errors++; |
256 | spin_unlock_irqrestore(&ax->buflock, flags); | 255 | spin_unlock_bh(&ax->buflock); |
257 | 256 | ||
258 | return; | 257 | return; |
259 | } | 258 | } |
@@ -268,7 +267,7 @@ static void ax_bump(struct mkiss *ax) | |||
268 | } else if (ax->rbuff[0] & 0x20) { | 267 | } else if (ax->rbuff[0] & 0x20) { |
269 | if (check_crc_flex(ax->rbuff, ax->rcount) < 0) { | 268 | if (check_crc_flex(ax->rbuff, ax->rcount) < 0) { |
270 | ax->dev->stats.rx_errors++; | 269 | ax->dev->stats.rx_errors++; |
271 | spin_unlock_irqrestore(&ax->buflock, flags); | 270 | spin_unlock_bh(&ax->buflock); |
272 | return; | 271 | return; |
273 | } | 272 | } |
274 | if (ax->crcmode != CRC_MODE_FLEX && ax->crcauto) { | 273 | if (ax->crcmode != CRC_MODE_FLEX && ax->crcauto) { |
@@ -295,7 +294,7 @@ static void ax_bump(struct mkiss *ax) | |||
295 | printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n", | 294 | printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n", |
296 | ax->dev->name); | 295 | ax->dev->name); |
297 | ax->dev->stats.rx_dropped++; | 296 | ax->dev->stats.rx_dropped++; |
298 | spin_unlock_irqrestore(&ax->buflock, flags); | 297 | spin_unlock_bh(&ax->buflock); |
299 | return; | 298 | return; |
300 | } | 299 | } |
301 | 300 | ||
@@ -304,13 +303,11 @@ static void ax_bump(struct mkiss *ax) | |||
304 | netif_rx(skb); | 303 | netif_rx(skb); |
305 | ax->dev->stats.rx_packets++; | 304 | ax->dev->stats.rx_packets++; |
306 | ax->dev->stats.rx_bytes += count; | 305 | ax->dev->stats.rx_bytes += count; |
307 | spin_unlock_irqrestore(&ax->buflock, flags); | 306 | spin_unlock_bh(&ax->buflock); |
308 | } | 307 | } |
309 | 308 | ||
310 | static void kiss_unesc(struct mkiss *ax, unsigned char s) | 309 | static void kiss_unesc(struct mkiss *ax, unsigned char s) |
311 | { | 310 | { |
312 | unsigned long flags; | ||
313 | |||
314 | switch (s) { | 311 | switch (s) { |
315 | case END: | 312 | case END: |
316 | /* drop keeptest bit = VSV */ | 313 | /* drop keeptest bit = VSV */ |
@@ -337,18 +334,18 @@ static void kiss_unesc(struct mkiss *ax, unsigned char s) | |||
337 | break; | 334 | break; |
338 | } | 335 | } |
339 | 336 | ||
340 | spin_lock_irqsave(&ax->buflock, flags); | 337 | spin_lock_bh(&ax->buflock); |
341 | if (!test_bit(AXF_ERROR, &ax->flags)) { | 338 | if (!test_bit(AXF_ERROR, &ax->flags)) { |
342 | if (ax->rcount < ax->buffsize) { | 339 | if (ax->rcount < ax->buffsize) { |
343 | ax->rbuff[ax->rcount++] = s; | 340 | ax->rbuff[ax->rcount++] = s; |
344 | spin_unlock_irqrestore(&ax->buflock, flags); | 341 | spin_unlock_bh(&ax->buflock); |
345 | return; | 342 | return; |
346 | } | 343 | } |
347 | 344 | ||
348 | ax->dev->stats.rx_over_errors++; | 345 | ax->dev->stats.rx_over_errors++; |
349 | set_bit(AXF_ERROR, &ax->flags); | 346 | set_bit(AXF_ERROR, &ax->flags); |
350 | } | 347 | } |
351 | spin_unlock_irqrestore(&ax->buflock, flags); | 348 | spin_unlock_bh(&ax->buflock); |
352 | } | 349 | } |
353 | 350 | ||
354 | static int ax_set_mac_address(struct net_device *dev, void *addr) | 351 | static int ax_set_mac_address(struct net_device *dev, void *addr) |
@@ -370,7 +367,6 @@ static void ax_changedmtu(struct mkiss *ax) | |||
370 | { | 367 | { |
371 | struct net_device *dev = ax->dev; | 368 | struct net_device *dev = ax->dev; |
372 | unsigned char *xbuff, *rbuff, *oxbuff, *orbuff; | 369 | unsigned char *xbuff, *rbuff, *oxbuff, *orbuff; |
373 | unsigned long flags; | ||
374 | int len; | 370 | int len; |
375 | 371 | ||
376 | len = dev->mtu * 2; | 372 | len = dev->mtu * 2; |
@@ -396,7 +392,7 @@ static void ax_changedmtu(struct mkiss *ax) | |||
396 | return; | 392 | return; |
397 | } | 393 | } |
398 | 394 | ||
399 | spin_lock_irqsave(&ax->buflock, flags); | 395 | spin_lock_bh(&ax->buflock); |
400 | 396 | ||
401 | oxbuff = ax->xbuff; | 397 | oxbuff = ax->xbuff; |
402 | ax->xbuff = xbuff; | 398 | ax->xbuff = xbuff; |
@@ -427,7 +423,7 @@ static void ax_changedmtu(struct mkiss *ax) | |||
427 | ax->mtu = dev->mtu + 73; | 423 | ax->mtu = dev->mtu + 73; |
428 | ax->buffsize = len; | 424 | ax->buffsize = len; |
429 | 425 | ||
430 | spin_unlock_irqrestore(&ax->buflock, flags); | 426 | spin_unlock_bh(&ax->buflock); |
431 | 427 | ||
432 | kfree(oxbuff); | 428 | kfree(oxbuff); |
433 | kfree(orbuff); | 429 | kfree(orbuff); |
@@ -437,7 +433,6 @@ static void ax_changedmtu(struct mkiss *ax) | |||
437 | static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) | 433 | static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) |
438 | { | 434 | { |
439 | struct mkiss *ax = netdev_priv(dev); | 435 | struct mkiss *ax = netdev_priv(dev); |
440 | unsigned long flags; | ||
441 | unsigned char *p; | 436 | unsigned char *p; |
442 | int actual, count; | 437 | int actual, count; |
443 | 438 | ||
@@ -454,7 +449,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) | |||
454 | 449 | ||
455 | p = icp; | 450 | p = icp; |
456 | 451 | ||
457 | spin_lock_irqsave(&ax->buflock, flags); | 452 | spin_lock_bh(&ax->buflock); |
458 | if ((*p & 0x0f) != 0) { | 453 | if ((*p & 0x0f) != 0) { |
459 | /* Configuration Command (kissparms(1). | 454 | /* Configuration Command (kissparms(1). |
460 | * Protocol spec says: never append CRC. | 455 | * Protocol spec says: never append CRC. |
@@ -484,7 +479,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) | |||
484 | ax->crcauto = (cmd ? 0 : 1); | 479 | ax->crcauto = (cmd ? 0 : 1); |
485 | printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd); | 480 | printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd); |
486 | } | 481 | } |
487 | spin_unlock_irqrestore(&ax->buflock, flags); | 482 | spin_unlock_bh(&ax->buflock); |
488 | netif_start_queue(dev); | 483 | netif_start_queue(dev); |
489 | 484 | ||
490 | return; | 485 | return; |
@@ -517,7 +512,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len) | |||
517 | count = kiss_esc(p, (unsigned char *)ax->xbuff, len); | 512 | count = kiss_esc(p, (unsigned char *)ax->xbuff, len); |
518 | } | 513 | } |
519 | } | 514 | } |
520 | spin_unlock_irqrestore(&ax->buflock, flags); | 515 | spin_unlock_bh(&ax->buflock); |
521 | 516 | ||
522 | set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags); | 517 | set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags); |
523 | actual = ax->tty->ops->write(ax->tty, ax->xbuff, count); | 518 | actual = ax->tty->ops->write(ax->tty, ax->xbuff, count); |
@@ -709,14 +704,13 @@ static DEFINE_RWLOCK(disc_data_lock); | |||
709 | 704 | ||
710 | static struct mkiss *mkiss_get(struct tty_struct *tty) | 705 | static struct mkiss *mkiss_get(struct tty_struct *tty) |
711 | { | 706 | { |
712 | unsigned long flags; | ||
713 | struct mkiss *ax; | 707 | struct mkiss *ax; |
714 | 708 | ||
715 | read_lock_irqsave(&disc_data_lock, flags); | 709 | read_lock(&disc_data_lock); |
716 | ax = tty->disc_data; | 710 | ax = tty->disc_data; |
717 | if (ax) | 711 | if (ax) |
718 | atomic_inc(&ax->refcnt); | 712 | atomic_inc(&ax->refcnt); |
719 | read_unlock_irqrestore(&disc_data_lock, flags); | 713 | read_unlock(&disc_data_lock); |
720 | 714 | ||
721 | return ax; | 715 | return ax; |
722 | } | 716 | } |
@@ -815,13 +809,12 @@ out: | |||
815 | 809 | ||
816 | static void mkiss_close(struct tty_struct *tty) | 810 | static void mkiss_close(struct tty_struct *tty) |
817 | { | 811 | { |
818 | unsigned long flags; | ||
819 | struct mkiss *ax; | 812 | struct mkiss *ax; |
820 | 813 | ||
821 | write_lock_irqsave(&disc_data_lock, flags); | 814 | write_lock(&disc_data_lock); |
822 | ax = tty->disc_data; | 815 | ax = tty->disc_data; |
823 | tty->disc_data = NULL; | 816 | tty->disc_data = NULL; |
824 | write_unlock_irqrestore(&disc_data_lock, flags); | 817 | write_unlock(&disc_data_lock); |
825 | 818 | ||
826 | if (!ax) | 819 | if (!ax) |
827 | return; | 820 | return; |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 1fd319bf758e..17c116bb332c 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -132,15 +132,13 @@ static DEFINE_RWLOCK(disc_data_lock); | |||
132 | 132 | ||
133 | static struct asyncppp *ap_get(struct tty_struct *tty) | 133 | static struct asyncppp *ap_get(struct tty_struct *tty) |
134 | { | 134 | { |
135 | unsigned long flags; | ||
136 | struct asyncppp *ap; | 135 | struct asyncppp *ap; |
137 | 136 | ||
138 | read_lock_irqsave(&disc_data_lock, flags); | 137 | read_lock(&disc_data_lock); |
139 | ap = tty->disc_data; | 138 | ap = tty->disc_data; |
140 | if (ap != NULL) | 139 | if (ap != NULL) |
141 | atomic_inc(&ap->refcnt); | 140 | atomic_inc(&ap->refcnt); |
142 | read_unlock_irqrestore(&disc_data_lock, flags); | 141 | read_unlock(&disc_data_lock); |
143 | |||
144 | return ap; | 142 | return ap; |
145 | } | 143 | } |
146 | 144 | ||
@@ -217,13 +215,12 @@ ppp_asynctty_open(struct tty_struct *tty) | |||
217 | static void | 215 | static void |
218 | ppp_asynctty_close(struct tty_struct *tty) | 216 | ppp_asynctty_close(struct tty_struct *tty) |
219 | { | 217 | { |
220 | unsigned long flags; | ||
221 | struct asyncppp *ap; | 218 | struct asyncppp *ap; |
222 | 219 | ||
223 | write_lock_irqsave(&disc_data_lock, flags); | 220 | write_lock_irq(&disc_data_lock); |
224 | ap = tty->disc_data; | 221 | ap = tty->disc_data; |
225 | tty->disc_data = NULL; | 222 | tty->disc_data = NULL; |
226 | write_unlock_irqrestore(&disc_data_lock, flags); | 223 | write_unlock_irq(&disc_data_lock); |
227 | if (!ap) | 224 | if (!ap) |
228 | return; | 225 | return; |
229 | 226 | ||
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index 1b3f75febee1..aa3d39f38e22 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
@@ -182,15 +182,13 @@ static DEFINE_RWLOCK(disc_data_lock); | |||
182 | 182 | ||
183 | static struct syncppp *sp_get(struct tty_struct *tty) | 183 | static struct syncppp *sp_get(struct tty_struct *tty) |
184 | { | 184 | { |
185 | unsigned long flags; | ||
186 | struct syncppp *ap; | 185 | struct syncppp *ap; |
187 | 186 | ||
188 | read_lock_irqsave(&disc_data_lock, flags); | 187 | read_lock(&disc_data_lock); |
189 | ap = tty->disc_data; | 188 | ap = tty->disc_data; |
190 | if (ap != NULL) | 189 | if (ap != NULL) |
191 | atomic_inc(&ap->refcnt); | 190 | atomic_inc(&ap->refcnt); |
192 | read_unlock_irqrestore(&disc_data_lock, flags); | 191 | read_unlock(&disc_data_lock); |
193 | |||
194 | return ap; | 192 | return ap; |
195 | } | 193 | } |
196 | 194 | ||
@@ -264,13 +262,12 @@ ppp_sync_open(struct tty_struct *tty) | |||
264 | static void | 262 | static void |
265 | ppp_sync_close(struct tty_struct *tty) | 263 | ppp_sync_close(struct tty_struct *tty) |
266 | { | 264 | { |
267 | unsigned long flags; | ||
268 | struct syncppp *ap; | 265 | struct syncppp *ap; |
269 | 266 | ||
270 | write_lock_irqsave(&disc_data_lock, flags); | 267 | write_lock_irq(&disc_data_lock); |
271 | ap = tty->disc_data; | 268 | ap = tty->disc_data; |
272 | tty->disc_data = NULL; | 269 | tty->disc_data = NULL; |
273 | write_unlock_irqrestore(&disc_data_lock, flags); | 270 | write_unlock_irq(&disc_data_lock); |
274 | if (!ap) | 271 | if (!ap) |
275 | return; | 272 | return; |
276 | 273 | ||
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) | |||
1540 | static int strip_xmit(struct sk_buff *skb, struct net_device *dev) | 1536 | static 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 | ||
2530 | static void strip_free(struct strip *strip_info) | 2524 | static 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) | |||
2547 | static struct strip *strip_alloc(void) | 2539 | static 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 | } |