Commit c8c702b1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] err1-2: sscape locking fix

Fix deadlock identified by the Stanford locking checker.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b10be47d
......@@ -171,13 +171,18 @@ static unsigned char sscape_read(struct sscape_info *devc, int reg)
return val;
}
static void __sscape_write(int reg, int data)
{
outb(reg, PORT(ODIE_ADDR));
outb(data, PORT(ODIE_DATA));
}
static void sscape_write(struct sscape_info *devc, int reg, int data)
{
unsigned long flags;
spin_lock_irqsave(&devc->lock,flags);
outb(reg, PORT(ODIE_ADDR));
outb(data, PORT(ODIE_DATA));
__sscape_write(reg, data);
spin_unlock_irqrestore(&devc->lock,flags);
}
......@@ -386,7 +391,7 @@ static void sscape_coproc_close(void *dev_info, int sub_device)
spin_lock_irqsave(&devc->lock,flags);
if (devc->dma_allocated)
{
sscape_write(devc, GA_DMAA_REG, 0x20); /* DMA channel disabled */
__sscape_write(GA_DMAA_REG, 0x20); /* DMA channel disabled */
devc->dma_allocated = 0;
}
spin_unlock_irqrestore(&devc->lock,flags);
......
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