Re: Interrupt/Sleep deadlock

2000-10-10 Thread Linus Torvalds
In article <[EMAIL PROTECTED]>, Ivan Passos <[EMAIL PROTECTED]> wrote: > >"You could use a semaphore for this. Initialize it to 0, then call >down() from the ioctl, and up() from the interrupt handler. If the >up() happens before the down(), the down() won't go to sleep." > >Initializing it to

Re: Interrupt/Sleep deadlock

2000-10-10 Thread Ivan Passos
On Thu, 28 Sep 2000, Ivan Passos wrote: > > In order to get the configuration of a board, I have to send, from > userspace, an ioctl to the driver and wait for the board to complete its > action. The way this is implemented is as follows: > - In the ioctl, the driver sends a command to the

Re: Interrupt/Sleep deadlock

2000-10-10 Thread Ivan Passos
On Thu, 28 Sep 2000, Ivan Passos wrote: In order to get the configuration of a board, I have to send, from userspace, an ioctl to the driver and wait for the board to complete its action. The way this is implemented is as follows: - In the ioctl, the driver sends a command to the board and

Re: Interrupt/Sleep deadlock

2000-10-10 Thread Linus Torvalds
In article [EMAIL PROTECTED], Ivan Passos [EMAIL PROTECTED] wrote: "You could use a semaphore for this. Initialize it to 0, then call down() from the ioctl, and up() from the interrupt handler. If the up() happens before the down(), the down() won't go to sleep." Initializing it to 0 means:

Re: Interrupt/Sleep deadlock

2000-10-01 Thread Rusty Russell
In message <[EMAIL PROTECTED]> you write: > Heh.. I needed to figure this out about 6 months ago. Here's the "right > answer" > > Before sending the command to the board, call > set_current_state(TASK_UNINTERRUPTIBLE). *Ahem* >From Documentation/DocBook/kernel-hacking.tmpl: Wait Queues

Re: Interrupt/Sleep deadlock

2000-10-01 Thread Rusty Russell
In message [EMAIL PROTECTED] you write: Heh.. I needed to figure this out about 6 months ago. Here's the "right answer" Before sending the command to the board, call set_current_state(TASK_UNINTERRUPTIBLE). *Ahem* From Documentation/DocBook/kernel-hacking.tmpl: Wait Queues ...

Re: Interrupt/Sleep deadlock

2000-09-28 Thread Nigel Gamble
You could use a semaphore for this. Initialize it to 0, then call down() from the ioctl, and up() from the interrupt handler. If the up() happens before the down(), the down() won't go to sleep. Nigel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: Interrupt/Sleep deadlock

2000-09-28 Thread Matthew Dharm
Heh.. I needed to figure this out about 6 months ago. Here's the "right answer" Before sending the command to the board, call set_current_state(TASK_UNINTERRUPTIBLE). This will prevent the scheduler from interrupting your task, but more importantly it will prevent your task from being

Interrupt/Sleep deadlock

2000-09-28 Thread Ivan Passos
Hello, In order to get the configuration of a board, I have to send, from userspace, an ioctl to the driver and wait for the board to complete its action. The way this is implemented is as follows: - In the ioctl, the driver sends a command to the board and then goes to sleep

Interrupt/Sleep deadlock

2000-09-28 Thread Ivan Passos
Hello, In order to get the configuration of a board, I have to send, from userspace, an ioctl to the driver and wait for the board to complete its action. The way this is implemented is as follows: - In the ioctl, the driver sends a command to the board and then goes to sleep

Re: Interrupt/Sleep deadlock

2000-09-28 Thread Matthew Dharm
Heh.. I needed to figure this out about 6 months ago. Here's the "right answer" Before sending the command to the board, call set_current_state(TASK_UNINTERRUPTIBLE). This will prevent the scheduler from interrupting your task, but more importantly it will prevent your task from being

Re: Interrupt/Sleep deadlock

2000-09-28 Thread Nigel Gamble
You could use a semaphore for this. Initialize it to 0, then call down() from the ioctl, and up() from the interrupt handler. If the up() happens before the down(), the down() won't go to sleep. Nigel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a