Commit 6a8c97ac authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[media] lirc_zilog: fix spinning rx thread

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 5bd6b046, 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: default avatarAndy Walls <awalls@md.metrocast.net>
CC: stable@kernel.org
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1ba9268c
...@@ -475,14 +475,14 @@ static int lirc_thread(void *arg) ...@@ -475,14 +475,14 @@ static int lirc_thread(void *arg)
dprintk("poll thread started\n"); dprintk("poll thread started\n");
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
set_current_state(TASK_INTERRUPTIBLE);
/* if device not opened, we can sleep half a second */ /* if device not opened, we can sleep half a second */
if (atomic_read(&ir->open_count) == 0) { if (atomic_read(&ir->open_count) == 0) {
schedule_timeout(HZ/2); schedule_timeout(HZ/2);
continue; continue;
} }
set_current_state(TASK_INTERRUPTIBLE);
/* /*
* This is ~113*2 + 24 + jitter (2*repeat gap + code length). * This is ~113*2 + 24 + jitter (2*repeat gap + code length).
* We use this interval as the chip resets every time you poll * We use this interval as the chip resets every time you poll
......
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