aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/asyncdata.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2006-04-11 01:55:16 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:50 -0400
commit69049cc87dccb1e6fb54aa25c63033efac805dbd (patch)
tree9db1953a831091335b98f8749865f4c8b410ff9b /drivers/isdn/gigaset/asyncdata.c
parent27d1ac2ef7d0b9250ca9fd2ef506e12866ce8fdf (diff)
[PATCH] isdn4linux: Siemens Gigaset drivers: make some variables non-atomic
With Hansjoerg Lipp <hjlipp@web.de> Replace some atomic_t variables in the Gigaset drivers by non-atomic ones, using spinlocks instead to assure atomicity, as proposed in discussions on the linux-kernel mailing list. Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/gigaset/asyncdata.c')
-rw-r--r--drivers/isdn/gigaset/asyncdata.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index ce60f6521b96..ce3cd77094b3 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -566,19 +566,22 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail)
566int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb) 566int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb)
567{ 567{
568 unsigned len = skb->len; 568 unsigned len = skb->len;
569 unsigned long flags;
569 570
570 if (bcs->proto2 == ISDN_PROTO_L2_HDLC) 571 if (bcs->proto2 == ISDN_PROTO_L2_HDLC)
571 skb = HDLC_Encode(skb, HW_HDR_LEN, 0); 572 skb = HDLC_Encode(skb, HW_HDR_LEN, 0);
572 else 573 else
573 skb = iraw_encode(skb, HW_HDR_LEN, 0); 574 skb = iraw_encode(skb, HW_HDR_LEN, 0);
574 if (!skb) { 575 if (!skb) {
575 dev_err(bcs->cs->dev, 576 err("unable to allocate memory for encoding!\n");
576 "unable to allocate memory for encoding!\n");
577 return -ENOMEM; 577 return -ENOMEM;
578 } 578 }
579 579
580 skb_queue_tail(&bcs->squeue, skb); 580 skb_queue_tail(&bcs->squeue, skb);
581 tasklet_schedule(&bcs->cs->write_tasklet); 581 spin_lock_irqsave(&bcs->cs->lock, flags);
582 if (bcs->cs->connected)
583 tasklet_schedule(&bcs->cs->write_tasklet);
584 spin_unlock_irqrestore(&bcs->cs->lock, flags);
582 585
583 return len; /* ok so far */ 586 return len; /* ok so far */
584} 587}