Commit 45d3ac4e authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik

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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 257b346d
...@@ -331,8 +331,7 @@ static void z8530_rtsdtr(struct z8530_channel *c, int set) ...@@ -331,8 +331,7 @@ static void z8530_rtsdtr(struct z8530_channel *c, int set)
static void z8530_rx(struct z8530_channel *c) static void z8530_rx(struct z8530_channel *c)
{ {
u8 ch,stat; u8 ch,stat;
spin_lock(c->lock);
while(1) while(1)
{ {
/* FIFO empty ? */ /* FIFO empty ? */
...@@ -390,7 +389,6 @@ static void z8530_rx(struct z8530_channel *c) ...@@ -390,7 +389,6 @@ static void z8530_rx(struct z8530_channel *c)
*/ */
write_zsctrl(c, ERR_RES); write_zsctrl(c, ERR_RES);
write_zsctrl(c, RES_H_IUS); write_zsctrl(c, RES_H_IUS);
spin_unlock(c->lock);
} }
...@@ -406,7 +404,6 @@ static void z8530_rx(struct z8530_channel *c) ...@@ -406,7 +404,6 @@ static void z8530_rx(struct z8530_channel *c)
static void z8530_tx(struct z8530_channel *c) static void z8530_tx(struct z8530_channel *c)
{ {
spin_lock(c->lock);
while(c->txcount) { while(c->txcount) {
/* FIFO full ? */ /* FIFO full ? */
if(!(read_zsreg(c, R0)&4)) if(!(read_zsreg(c, R0)&4))
...@@ -434,7 +431,6 @@ static void z8530_tx(struct z8530_channel *c) ...@@ -434,7 +431,6 @@ static void z8530_tx(struct z8530_channel *c)
z8530_tx_done(c); z8530_tx_done(c);
write_zsctrl(c, RES_H_IUS); write_zsctrl(c, RES_H_IUS);
spin_unlock(c->lock);
} }
/** /**
...@@ -452,7 +448,6 @@ static void z8530_status(struct z8530_channel *chan) ...@@ -452,7 +448,6 @@ static void z8530_status(struct z8530_channel *chan)
{ {
u8 status, altered; u8 status, altered;
spin_lock(chan->lock);
status=read_zsreg(chan, R0); status=read_zsreg(chan, R0);
altered=chan->status^status; altered=chan->status^status;
...@@ -487,7 +482,6 @@ static void z8530_status(struct z8530_channel *chan) ...@@ -487,7 +482,6 @@ static void z8530_status(struct z8530_channel *chan)
} }
write_zsctrl(chan, RES_EXT_INT); write_zsctrl(chan, RES_EXT_INT);
write_zsctrl(chan, RES_H_IUS); write_zsctrl(chan, RES_H_IUS);
spin_unlock(chan->lock);
} }
struct z8530_irqhandler z8530_sync= struct z8530_irqhandler z8530_sync=
...@@ -511,7 +505,6 @@ EXPORT_SYMBOL(z8530_sync); ...@@ -511,7 +505,6 @@ EXPORT_SYMBOL(z8530_sync);
static void z8530_dma_rx(struct z8530_channel *chan) static void z8530_dma_rx(struct z8530_channel *chan)
{ {
spin_lock(chan->lock);
if(chan->rxdma_on) if(chan->rxdma_on)
{ {
/* Special condition check only */ /* Special condition check only */
...@@ -534,7 +527,6 @@ static void z8530_dma_rx(struct z8530_channel *chan) ...@@ -534,7 +527,6 @@ static void z8530_dma_rx(struct z8530_channel *chan)
/* DMA is off right now, drain the slow way */ /* DMA is off right now, drain the slow way */
z8530_rx(chan); z8530_rx(chan);
} }
spin_unlock(chan->lock);
} }
/** /**
...@@ -547,7 +539,6 @@ static void z8530_dma_rx(struct z8530_channel *chan) ...@@ -547,7 +539,6 @@ static void z8530_dma_rx(struct z8530_channel *chan)
static void z8530_dma_tx(struct z8530_channel *chan) static void z8530_dma_tx(struct z8530_channel *chan)
{ {
spin_lock(chan->lock);
if(!chan->dma_tx) if(!chan->dma_tx)
{ {
printk(KERN_WARNING "Hey who turned the DMA off?\n"); printk(KERN_WARNING "Hey who turned the DMA off?\n");
...@@ -557,7 +548,6 @@ static void z8530_dma_tx(struct z8530_channel *chan) ...@@ -557,7 +548,6 @@ static void z8530_dma_tx(struct z8530_channel *chan)
/* This shouldnt occur in DMA mode */ /* This shouldnt occur in DMA mode */
printk(KERN_ERR "DMA tx - bogus event!\n"); printk(KERN_ERR "DMA tx - bogus event!\n");
z8530_tx(chan); z8530_tx(chan);
spin_unlock(chan->lock);
} }
/** /**
...@@ -596,7 +586,6 @@ static void z8530_dma_status(struct z8530_channel *chan) ...@@ -596,7 +586,6 @@ static void z8530_dma_status(struct z8530_channel *chan)
} }
} }
spin_lock(chan->lock);
if(altered&chan->dcdcheck) if(altered&chan->dcdcheck)
{ {
if(status&chan->dcdcheck) if(status&chan->dcdcheck)
...@@ -618,7 +607,6 @@ static void z8530_dma_status(struct z8530_channel *chan) ...@@ -618,7 +607,6 @@ static void z8530_dma_status(struct z8530_channel *chan)
write_zsctrl(chan, RES_EXT_INT); write_zsctrl(chan, RES_EXT_INT);
write_zsctrl(chan, RES_H_IUS); write_zsctrl(chan, RES_H_IUS);
spin_unlock(chan->lock);
} }
struct z8530_irqhandler z8530_dma_sync= struct z8530_irqhandler z8530_dma_sync=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment