Skip to content

Commit

Permalink
kgdboc,input: Fix regression with keyboard release key and early debu…
Browse files Browse the repository at this point in the history
…gging

The commit 111c182 (kgdboc: reset
input devices (keyboards) when exiting debugger) introduced a
regression in early debugging such that you get a kernel oops on
continue (with the go command) if you boot a kernel with:

    earlyprintk=vga ekgdboc=kbd kgdbwait

The restore kgdboc_restore_input() routine schedules work for the
purpose of sending key release events for any keys that were in the
depressed state prior to entering the kernel debugger.  A simple fix
to the crash is to not invoke the schedule_work() if the kernel
system_state is anything other than SYSTEM_RUNNING.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Sergei Shtylyov <sshtylyov@mvista.com>
  • Loading branch information
Jason Wessel committed Dec 14, 2010
1 parent e8a7e48 commit 8863ada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/serial/kgdboc.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper);

static void kgdboc_restore_input(void)
{
schedule_work(&kgdboc_restore_input_work);
if (likely(system_state == SYSTEM_RUNNING))
schedule_work(&kgdboc_restore_input_work);
}

static int kgdboc_register_kbd(char **cptr)
Expand Down

0 comments on commit 8863ada

Please sign in to comment.