Its possible that we can write to the hvc_console tty as soon it is
registered. Recently this started happening due to (what looks like) a
change to the hotplug code.
Unfortunately at this stage we have not started the khvcd kernel thread and
oops. The solution is to start the kernel thread before registering the
tty.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
When registering the hvc console port, register a list of ops (read and write)
to go with it, instead of calling fixed function names.
This allows different ports to encode the data differently.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Remove all the vio device driver code from hvc_console.c
This will allow us to separate hvsi, hvc, and allow hvc_console to be used
without the ppc64 vio layer.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Separate the console setup routines of the hvc_console and the vio layer.
Remove the call to find_init_vty from hvc_console.c.
Fail the setup routine if the console doesn't exist, but register the console
again when the specified channel is instantiated. This scheme maintains the
print buffer semantics while eliminating callout and call back for the console
code.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Check if a vterm was registered before accepting it as a console.
Check that a slot hasn't been probed with a tty in hvc_instantiate().
Check that a slot hasn't been free'ed when handing out console device.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
num_vterms hasn't been used since the hotplug support went in. Also, remove a
dead code line from a list_for_each_entry conversion.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Be thorough in our exit routine, since it says it is there to be so.
Unregistering without registering is safe (checked in 2.6.10).
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Guard the MAGIC_SYSRQ ^O to be just on the console channel. Make the other
channels more transparent.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Have the hvc console code try to pull characters immediately when receiving an
interrupt, and kick the poll thread only if the immediate poll indicates it
needed a call back to do more work.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Use the vterm numbers to match the vio devices being probed with the indices
already allocated via the console initcall function hvc_find_vtys.
The old code required hvc_find_vtys to "guess" the matching devices the vio
subsystem would find and its probe order.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Milton Miller has done a lot of work to clean up our hvc_console code.
One of the important things the following patch series does is separate the
VIO layer from the hvc_console code. With the VIO specific code removed any
ppc64 platform, or even any architecture, can use hvc_console as a generic
polling console. You simply have to supply a get_chars and put_chars method
and hvc_console does the rest of the work. You can even use it for an
interrupt driven console.
This patch:
Rearrange the code in drivers/char/hvc_console.c to make future patches
smaller. No actual code changes, just ordering of the functions in the file.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!