aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/z85230.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-02-05 19:31:03 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-07 18:49:52 -0500
commit45d3ac4ec31ccf9a39065e8576260c6ac2652c83 (patch)
treeca22e67bdf80e12f03fa60030e85fadb18175ec9 /drivers/net/wan/z85230.c
parent257b346d20cd309a4c5a13b8de5ad2b7c63b590a (diff)
z85230: spinlock logic
At some point someone added a spin_lock(&dev->lock) to the IRQ handler for the Z85230 driver. This actually correctly fixes a bug but the necessary changes to remove the chan->lock calls in the event handlers were not made (c->lock is the same lock). Simona Dascenzo reported the problem with the driver and this patch should fix the problem he found. Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/wan/z85230.c')
-rw-r--r--drivers/net/wan/z85230.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c
index 59ddd21c3958..8dbcf83bb5f3 100644
--- a/drivers/net/wan/z85230.c
+++ b/drivers/net/wan/z85230.c
@@ -331,8 +331,7 @@ static void z8530_rtsdtr(struct z8530_channel *c, int set)
331static void z8530_rx(struct z8530_channel *c) 331static void z8530_rx(struct z8530_channel *c)
332{ 332{
333 u8 ch,stat; 333 u8 ch,stat;
334 spin_lock(c->lock); 334
335
336 while(1) 335 while(1)
337 { 336 {
338 /* FIFO empty ? */ 337 /* FIFO empty ? */
@@ -390,7 +389,6 @@ static void z8530_rx(struct z8530_channel *c)
390 */ 389 */
391 write_zsctrl(c, ERR_RES); 390 write_zsctrl(c, ERR_RES);
392 write_zsctrl(c, RES_H_IUS); 391 write_zsctrl(c, RES_H_IUS);
393 spin_unlock(c->lock);
394} 392}
395 393
396 394
@@ -406,7 +404,6 @@ static void z8530_rx(struct z8530_channel *c)
406 404
407static void z8530_tx(struct z8530_channel *c) 405static void z8530_tx(struct z8530_channel *c)
408{ 406{
409 spin_lock(c->lock);
410 while(c->txcount) { 407 while(c->txcount) {
411 /* FIFO full ? */ 408 /* FIFO full ? */
412 if(!(read_zsreg(c, R0)&4)) 409 if(!(read_zsreg(c, R0)&4))
@@ -434,7 +431,6 @@ static void z8530_tx(struct z8530_channel *c)
434 431
435 z8530_tx_done(c); 432 z8530_tx_done(c);
436 write_zsctrl(c, RES_H_IUS); 433 write_zsctrl(c, RES_H_IUS);
437 spin_unlock(c->lock);
438} 434}
439 435
440/** 436/**
@@ -452,7 +448,6 @@ static void z8530_status(struct z8530_channel *chan)
452{ 448{
453 u8 status, altered; 449 u8 status, altered;
454 450
455 spin_lock(chan->lock);
456 status=read_zsreg(chan, R0); 451 status=read_zsreg(chan, R0);
457 altered=chan->status^status; 452 altered=chan->status^status;
458 453
@@ -487,7 +482,6 @@ static void z8530_status(struct z8530_channel *chan)
487 } 482 }
488 write_zsctrl(chan, RES_EXT_INT); 483 write_zsctrl(chan, RES_EXT_INT);
489 write_zsctrl(chan, RES_H_IUS); 484 write_zsctrl(chan, RES_H_IUS);
490 spin_unlock(chan->lock);
491} 485}
492 486
493struct z8530_irqhandler z8530_sync= 487struct z8530_irqhandler z8530_sync=
@@ -511,7 +505,6 @@ EXPORT_SYMBOL(z8530_sync);
511 505
512static void z8530_dma_rx(struct z8530_channel *chan) 506static void z8530_dma_rx(struct z8530_channel *chan)
513{ 507{
514 spin_lock(chan->lock);
515 if(chan->rxdma_on) 508 if(chan->rxdma_on)
516 { 509 {
517 /* Special condition check only */ 510 /* Special condition check only */
@@ -534,7 +527,6 @@ static void z8530_dma_rx(struct z8530_channel *chan)
534 /* DMA is off right now, drain the slow way */ 527 /* DMA is off right now, drain the slow way */
535 z8530_rx(chan); 528 z8530_rx(chan);
536 } 529 }
537 spin_unlock(chan->lock);
538} 530}
539 531
540/** 532/**
@@ -547,7 +539,6 @@ static void z8530_dma_rx(struct z8530_channel *chan)
547 539
548static void z8530_dma_tx(struct z8530_channel *chan) 540static void z8530_dma_tx(struct z8530_channel *chan)
549{ 541{
550 spin_lock(chan->lock);
551 if(!chan->dma_tx) 542 if(!chan->dma_tx)
552 { 543 {
553 printk(KERN_WARNING "Hey who turned the DMA off?\n"); 544 printk(KERN_WARNING "Hey who turned the DMA off?\n");
@@ -557,7 +548,6 @@ static void z8530_dma_tx(struct z8530_channel *chan)
557 /* This shouldnt occur in DMA mode */ 548 /* This shouldnt occur in DMA mode */
558 printk(KERN_ERR "DMA tx - bogus event!\n"); 549 printk(KERN_ERR "DMA tx - bogus event!\n");
559 z8530_tx(chan); 550 z8530_tx(chan);
560 spin_unlock(chan->lock);
561} 551}
562 552
563/** 553/**
@@ -596,7 +586,6 @@ static void z8530_dma_status(struct z8530_channel *chan)
596 } 586 }
597 } 587 }
598 588
599 spin_lock(chan->lock);
600 if(altered&chan->dcdcheck) 589 if(altered&chan->dcdcheck)
601 { 590 {
602 if(status&chan->dcdcheck) 591 if(status&chan->dcdcheck)
@@ -618,7 +607,6 @@ static void z8530_dma_status(struct z8530_channel *chan)
618 607
619 write_zsctrl(chan, RES_EXT_INT); 608 write_zsctrl(chan, RES_EXT_INT);
620 write_zsctrl(chan, RES_H_IUS); 609 write_zsctrl(chan, RES_H_IUS);
621 spin_unlock(chan->lock);
622} 610}
623 611
624struct z8530_irqhandler z8530_dma_sync= 612struct z8530_irqhandler z8530_dma_sync=