From: <he...@us...> - 2005-03-14 19:47:20
|
Update of /cvsroot/gc-linux/linux/drivers/exi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22829/drivers/exi Modified Files: exi-hw.h exi-hw.c Log Message: Fixed issue if kernel preemption is enabled. Index: exi-hw.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-hw.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- exi-hw.h 13 Mar 2005 21:49:16 -0000 1.1 +++ exi-hw.h 14 Mar 2005 19:47:10 -0000 1.2 @@ -106,12 +106,13 @@ void __iomem *io_base; struct exi_device *device_selected; + wait_queue_head_t wait_queue; + + spinlock_t cmd_lock; struct exi_command *dma_cmd; struct exi_command post_cmd; - wait_queue_head_t wait_queue; - unsigned long csr; struct tasklet_struct tasklet; Index: exi-hw.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-hw.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- exi-hw.c 13 Mar 2005 21:49:16 -0000 1.3 +++ exi-hw.c 14 Mar 2005 19:47:10 -0000 1.4 @@ -89,6 +89,7 @@ [0] = { .channel = 0, .lock = SPIN_LOCK_UNLOCKED, + .cmd_lock = SPIN_LOCK_UNLOCKED, .io_lock = SPIN_LOCK_UNLOCKED, .io_base = EXI_IO_BASE(0), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( @@ -97,6 +98,7 @@ [1] = { .channel = 1, .lock = SPIN_LOCK_UNLOCKED, + .cmd_lock = SPIN_LOCK_UNLOCKED, .io_lock = SPIN_LOCK_UNLOCKED, .io_base = EXI_IO_BASE(1), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( @@ -105,6 +107,7 @@ [2] = { .channel = 2, .lock = SPIN_LOCK_UNLOCKED, + .cmd_lock = SPIN_LOCK_UNLOCKED, .io_lock = SPIN_LOCK_UNLOCKED, .io_base = EXI_IO_BASE(2), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( @@ -157,6 +160,7 @@ exi_channel->channel = channel; spin_lock_init(&exi_channel->lock); + spin_lock_init(&exi_channel->cmd_lock); spin_lock_init(&exi_channel->io_lock); exi_channel->io_base = EXI_IO_BASE(channel); init_waitqueue_head(&exi_channel->wait_queue); @@ -407,6 +411,8 @@ BUG_ON(cmd->data == NULL); BUG_ON(exi_is_selected(exi_channel)); + spin_lock(exi_channel->cmd_lock); + /* cmd->data contains the device to select */ exi_device = cmd->data; //exi_driver = to_exi_driver(exi_device->dev.driver); @@ -436,6 +442,8 @@ exi_channel->flags &= ~EXI_SELECTED; exi_channel->device_selected = NULL; + + spin_unlock(exi_channel->cmd_lock); } /* |