Skip to content

Commit

Permalink
[media] lirc_zilog: fix spinning rx thread
Browse files Browse the repository at this point in the history
We were calling schedule_timeout with the rx thread's task state still
at TASK_RUNNING, which it shouldn't be. Make sure we call
set_current_state(TASK_INTERRUPTIBLE) *before* schedule_timeout, and
we're all good here. I believe this problem was mistakenly introduced in
commit 5bd6b04, and I'm not sure how I
missed it before, as I swear I tested the patchset that was included in,
but alas, stuff happens...

Acked-by: Andy Walls <awalls@md.metrocast.net>
CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed Jul 1, 2011
1 parent 1ba9268 commit 6a8c97a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/lirc/lirc_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,14 @@ static int lirc_thread(void *arg)
dprintk("poll thread started\n");

while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);

/* if device not opened, we can sleep half a second */
if (atomic_read(&ir->open_count) == 0) {
schedule_timeout(HZ/2);
continue;
}

set_current_state(TASK_INTERRUPTIBLE);

/*
* This is ~113*2 + 24 + jitter (2*repeat gap + code length).
* We use this interval as the chip resets every time you poll
Expand Down

0 comments on commit 6a8c97a

Please sign in to comment.