aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware
diff options
context:
space:
mode:
authorKarsten Keil <kkeil@suse.de>2007-10-19 02:39:19 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:34 -0400
commitfeea6d4d1247aa10648dcd9a328ea210a6321def (patch)
treee3d747f01759ec2a96ad61e55114728b00c5e8ab /drivers/isdn/hardware
parent1e9c7813723c925623f2e21a93e2d5dc05ea8d12 (diff)
isdn: fix random hard freeze with AVM T1 cards
This fixes the hard freeze debugged for AVM C4 cards for the AVM T1 cards. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r--drivers/isdn/hardware/avm/t1isa.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c
index c925020fe9b7..6130724e46e7 100644
--- a/drivers/isdn/hardware/avm/t1isa.c
+++ b/drivers/isdn/hardware/avm/t1isa.c
@@ -180,8 +180,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
180 180
181 ApplId = (unsigned) b1_get_word(card->port); 181 ApplId = (unsigned) b1_get_word(card->port);
182 MsgLen = t1_get_slice(card->port, card->msgbuf); 182 MsgLen = t1_get_slice(card->port, card->msgbuf);
183 spin_unlock_irqrestore(&card->lock, flags);
184 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { 183 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
184 spin_unlock_irqrestore(&card->lock, flags);
185 printk(KERN_ERR "%s: incoming packet dropped\n", 185 printk(KERN_ERR "%s: incoming packet dropped\n",
186 card->name); 186 card->name);
187 } else { 187 } else {
@@ -190,7 +190,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
190 capilib_data_b3_conf(&cinfo->ncci_head, ApplId, 190 capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
191 CAPIMSG_NCCI(skb->data), 191 CAPIMSG_NCCI(skb->data),
192 CAPIMSG_MSGID(skb->data)); 192 CAPIMSG_MSGID(skb->data));
193 193 spin_unlock_irqrestore(&card->lock, flags);
194 capi_ctr_handle_message(ctrl, ApplId, skb); 194 capi_ctr_handle_message(ctrl, ApplId, skb);
195 } 195 }
196 break; 196 break;
@@ -200,21 +200,17 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
200 ApplId = b1_get_word(card->port); 200 ApplId = b1_get_word(card->port);
201 NCCI = b1_get_word(card->port); 201 NCCI = b1_get_word(card->port);
202 WindowSize = b1_get_word(card->port); 202 WindowSize = b1_get_word(card->port);
203 spin_unlock_irqrestore(&card->lock, flags);
204
205 capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize); 203 capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize);
206 204 spin_unlock_irqrestore(&card->lock, flags);
207 break; 205 break;
208 206
209 case RECEIVE_FREE_NCCI: 207 case RECEIVE_FREE_NCCI:
210 208
211 ApplId = b1_get_word(card->port); 209 ApplId = b1_get_word(card->port);
212 NCCI = b1_get_word(card->port); 210 NCCI = b1_get_word(card->port);
213 spin_unlock_irqrestore(&card->lock, flags);
214
215 if (NCCI != 0xffffffff) 211 if (NCCI != 0xffffffff)
216 capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI); 212 capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI);
217 213 spin_unlock_irqrestore(&card->lock, flags);
218 break; 214 break;
219 215
220 case RECEIVE_START: 216 case RECEIVE_START:
@@ -333,13 +329,16 @@ static void t1isa_reset_ctr(struct capi_ctr *ctrl)
333 avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); 329 avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
334 avmcard *card = cinfo->card; 330 avmcard *card = cinfo->card;
335 unsigned int port = card->port; 331 unsigned int port = card->port;
332 unsigned long flags;
336 333
337 t1_disable_irq(port); 334 t1_disable_irq(port);
338 b1_reset(port); 335 b1_reset(port);
339 b1_reset(port); 336 b1_reset(port);
340 337
341 memset(cinfo->version, 0, sizeof(cinfo->version)); 338 memset(cinfo->version, 0, sizeof(cinfo->version));
339 spin_lock_irqsave(&card->lock, flags);
342 capilib_release(&cinfo->ncci_head); 340 capilib_release(&cinfo->ncci_head);
341 spin_unlock_irqrestore(&card->lock, flags);
343 capi_ctr_reseted(ctrl); 342 capi_ctr_reseted(ctrl);
344} 343}
345 344
@@ -466,29 +465,26 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
466 u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); 465 u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data);
467 u16 dlen, retval; 466 u16 dlen, retval;
468 467
468 spin_lock_irqsave(&card->lock, flags);
469 if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { 469 if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) {
470 retval = capilib_data_b3_req(&cinfo->ncci_head, 470 retval = capilib_data_b3_req(&cinfo->ncci_head,
471 CAPIMSG_APPID(skb->data), 471 CAPIMSG_APPID(skb->data),
472 CAPIMSG_NCCI(skb->data), 472 CAPIMSG_NCCI(skb->data),
473 CAPIMSG_MSGID(skb->data)); 473 CAPIMSG_MSGID(skb->data));
474 if (retval != CAPI_NOERROR) 474 if (retval != CAPI_NOERROR) {
475 spin_unlock_irqrestore(&card->lock, flags);
475 return retval; 476 return retval;
476 477 }
477 dlen = CAPIMSG_DATALEN(skb->data); 478 dlen = CAPIMSG_DATALEN(skb->data);
478 479
479 spin_lock_irqsave(&card->lock, flags);
480 b1_put_byte(port, SEND_DATA_B3_REQ); 480 b1_put_byte(port, SEND_DATA_B3_REQ);
481 t1_put_slice(port, skb->data, len); 481 t1_put_slice(port, skb->data, len);
482 t1_put_slice(port, skb->data + len, dlen); 482 t1_put_slice(port, skb->data + len, dlen);
483 spin_unlock_irqrestore(&card->lock, flags);
484 } else { 483 } else {
485
486 spin_lock_irqsave(&card->lock, flags);
487 b1_put_byte(port, SEND_MESSAGE); 484 b1_put_byte(port, SEND_MESSAGE);
488 t1_put_slice(port, skb->data, len); 485 t1_put_slice(port, skb->data, len);
489 spin_unlock_irqrestore(&card->lock, flags);
490 } 486 }
491 487 spin_unlock_irqrestore(&card->lock, flags);
492 dev_kfree_skb_any(skb); 488 dev_kfree_skb_any(skb);
493 return CAPI_NOERROR; 489 return CAPI_NOERROR;
494} 490}