Daniel Thompson c8b29f049e tty: kgdb_nmi: Automatically manage tty enable
At present it is not possible to boot with the ttyNMI0 console treating
character input normally, instead character input triggers a prompt
telling the user how to trigger the knock detector and enter the
debugger. To use the console normally requires that kdb be entered and
the nmi_console command be used to enable the console (or if only kgdb
is present then gdb must directly manipulate the value of
kgdb_nmi_tty_enabled).

This patch automates the management of kgdb_nmi_tty_enabled by keeping
track of the number of file handles that are open for reading and using
that to determine how to tty should operate.

The approach means that:

1. Behaviour before init starts is unchanged.

2. If the userspace runs a getty or some other interactive process on
   /dev/console (or explicitly on /dev/ttyNMI0) the tty will treat
   character input like any other tty.

3. If the userspace doesn't use /dev/console or if it uses /dev/console
   only to log messages (O_WRONLY) then the user prompt is retained.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 18:19:40 -07:00
..
2014-07-10 21:04:25 +02:00
2014-06-23 16:47:44 -07:00
2014-07-13 15:52:12 -07:00
2014-06-04 09:08:25 -07:00
2014-05-27 17:38:11 -07:00
2014-06-26 13:34:15 +01:00
2014-06-25 12:19:01 -07:00
2014-07-06 12:11:57 -07:00
2014-07-12 14:13:10 -07:00
2014-06-17 15:43:48 -07:00
2014-06-11 14:06:55 -07:00
2014-06-02 16:35:49 -07:00
2014-07-06 12:08:30 -07:00
2014-06-06 11:44:09 -07:00
2014-05-26 21:27:09 +02:00
2014-06-26 10:48:23 +01:00
2014-06-23 09:22:48 +03:00
2014-07-01 13:18:38 +03:00