tty/serial/core: Introduce poll_init callback
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Mon, 24 Sep 2012 21:27:53 +0000 (14:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 20:47:02 +0000 (13:47 -0700)
commitc7f3e7087ab0abb52bb1286010f2c104fd38ca5c
tree322207554769abe35110e41a4de93aa273b8c901
parent729043e82cdd403a131127254528afea8031ebab
tty/serial/core: Introduce poll_init callback

It was noticed that polling drivers (like KGDB) are not able to use
serial ports if the ports were not previously initialized via console.
I.e.  when booting with console=ttyAMA0 kgdboc=ttyAMA0, everything works
fine, but with console=ttyFOO kgdboc=ttyAMA0, the kgdboc doesn't work.

This is because we don't initialize the hardware. Calling ->startup() is
not an option, because drivers request interrupts there, and drivers
fail to handle situations when tty isn't opened with interrupts enabled.

So, we have to implement a new callback (actually, tty_ops already have
a similar callback), which does everything needed to initialize just the
hardware.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c
include/linux/serial_core.h