| Age | Commit message (Collapse) | Author |
|
The framebuffer console is now able to dynamically bind and unbind from the VT
console layer. Due to the way the VT console layer works, the drivers
themselves decide when to bind or unbind. However, it was decided that
binding must be controlled, not by the drivers themselves, but by the VT
console layer. With this, dynamic binding is possible for all VT console
drivers, not just fbcon.
Thus, the VT console layer will impose the following to all VT console
drivers:
- all registered VT console drivers will be entered in a private list
- drivers can register themselves to the VT console layer, but they cannot
decide when to bind or unbind. (Exception: To maintain backwards
compatibility, take_over_console() will automatically bind the driver after
registration.)
- drivers can remove themselves from the list by unregistering from the VT
console layer. A prerequisite for unregistration is that the driver must not
be bound.
The following functions are new in the vt.c:
register_con_driver() - public function, this function adds the VT console
driver to an internal list maintained by the VT console
bind_con_driver() - private function, it binds the driver to the console
take_over_console() is changed to call register_con_driver() followed by a
bind_con_driver(). This is the only time drivers can decide when to bind to
the VT layer. This is to maintain backwards compatibility.
unbind_con_driver() - private function, it unbinds the driver from its
console. The vacated consoles will be taken over by the default boot console
driver.
unregister_con_driver() - public function, removes the driver from the
internal list maintained by the VT console. It will only succeed if the
driver is currently unbound.
con_is_bound() checks if the driver is currently bound or not
give_up_console() is just a wrapper to unregister_con_driver().
There are also 3 additional functions meant to be called only by the tty layer
for sysfs control:
vt_bind() - calls bind_con_driver()
vt_unbind() - calls unbind_con_driver()
vt_show_drivers() - shows the list of registered drivers
Most VT console drivers will continue to work as is, but might have problems
when unbinding or binding which should be fixable with minimal changes.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Currently printk is no use for early debugging because it refuses to
actually print anything to the console unless
cpu_online(smp_processor_id()) is true.
The stated explanation is that console drivers may require per-cpu
resources, or otherwise barf, because the system is not yet setup
correctly. Fair enough.
However some console drivers might be quite happy running early during
boot, in fact we have one, and so it'd be nice if printk understood that.
So I added a flag (which I would have called CON_BOOT, but that's taken)
called CON_ANYTIME, which indicates that a console is happy to be called
anytime, even if the cpu is not yet online.
Tested on a Power 5 machine, with both a CON_ANYTIME driver and a bogus
console driver that BUG()s if called while offline. No problems AFAICT.
Built for i386 UP & SMP.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Trying to suspend/resume with console messages flying all around is
doomed to failure, when the devices that the messages are trying to
go to are being shut down.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch contains cleanups under drivers/video/ including:
- make some needlessly global code static
- the following was needlessly EXPORT_SYMBOL'ed:
- fbcon.c: fb_con
- fbmon.c: get_EDID_from_firmware (completely unused)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
CON_BOOT is like early printk in that it allows for output really early on.
It's better than early printk because it unregisters automatically when a
real console is initialised. So if you don't get consoles registering in
console_init, there isn't a huge delay between the boot console
unregistering and the real console starting. This is the case on PA-RISC
where we have serial ports that aren't discovered until the PCI bus has
been walked.
I think all the current early printk users could be converted to this
scheme with a minimal amount of effort.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The new PowerMac sleep code provides an arch hook that can be used by video
drivers on laptops to bring back the screen very early, pretty much before
anything else. This basically turns reports of the style "my laptop doesn't
wakeup" to "I get this or this oops/error/panic on wakeup", making fixing the
PM related bugs possible on a whole range of them.
However, the fbdev wakeup code triggers WARN_ON's in the VT subsystem if
called without the console semaphore when redrawing the screen (I added those
warnings a couple of kernel versions ago), and we can't call
acquire_console_sem() since we are so early in the wakeup process that we are
considered as in_atomic() (we hold irqs off too).
This patch addds a try_acquire_console_sem() function that can be used by
those video drivers that implement this early wakeup hook. If the acquire
fails (which should never happen in practice), wakeup is delayed to the normal
PCI callback which does a blocking acquire_console_sem().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
->con_font_get() sanitized. We pass console_font * to method instead of
console_font_op * and do not mess with mixing ->data in these guys.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
con_font_set() sanitized. We are passing console_font and flags into
the method in separate arguments and we are not messing with
console_font_op->data anymore - it's a userland pointer (to be annotated
several patches later in the series, due to another abuse of console_font_op
that needs to be fixed first), while console_font->data is kernel one
and they don't mix anymore.
We also do a sanity check (font width > 0) in the caller instead of
method instances, since we are already checking for width <= 32 and
height <= 32 there; doesn't make sense leaving that one in method
instances.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
->con_font_copy() sanitized. We extract the number of console to copy the
font from in the caller (it's taken from the field of console_font_op that
is normally used for font height - messy even for an ioctl, but that animal
used to be passed all the way down into console drivers).
With decoding done in con_font_copy(), we simply pass source console number
into the method.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
->con_font_default() sanitized. We copy font name (if any) from userland
in the caller and pass it explicitly. We are also beginning to get rid
of console_font_op in method arguments.
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Preparations for cleanups: con_font_op() is turned into a switch calling
con_font_{get,set,default,copy} depending on the operation required;
method ->con_font_op() also split, with NULL resulting in -ENOSYS on
operation in question.
Code that used to be in con_font_op() got slightly cleaned up after move
into new helpers (we are beginning to untangle the mess; there will be
more cleanups in the next patches).
Methods are currently using exact same arguments as old ->con_font_op().
That will change in subsequent patches, method by method (right now there's
a hell of a scary field reuse between them, making impossible to do any
static checks and practically begging for bugs).
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add console_stop() and console_start() methods so the serial drivers
can disable console output before suspending a port, and re-enable output
afterwards.
We also add locking to ensure that we synchronise with any in-progress
printk.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
[This patch series has also been separately sent to the architecture
maintainers]
Add console_device() to return the console tty driver structure and the
index. Acquire the console lock while scanning the list of console drivers
to protect us against console driver list manipulations.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Herbert Xu <herbert@gondor.apana.org.au>
The following patch adds basic module reference counting to vt console
drivers. Currently modules like fbcon are not counted at all.
|
|
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This patch implements what we discussed earlier to fix the switch bewteen
KD_GRAPHICS and KD_TEXT.
It has been tested for a few days now and appear to resolve the problem for
affected users.
James: I know you have some objections, I don't fully agree with them, and
I want that in asap now, that bug has been plaguing fbdev since the very
beginning and it's time to get rid of that and my corresponding todolist
entry. You are welcome to propose a patch on top of this one if you feel
you can make things cleaner. The approach of adding a parameter to
con_blank() is Linus idea btw :)
I didn't add a separate function as that would have made the butchering of
drivers/char/vt beyond what I want to deal with in 2.6.
|
|
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
- Make sure that all console operations are approriately protected under
console_sem.
- Adds checks to make sure that people are taking console_sem when it is
expected to be held.
|
|
Add a generic add_preferred_console() to printk.c so that other
platforms, such as MIPS for example, can sanely fix this problem
as well.
|
|
From: Christoph Hellwig <hch@lst.de>
now that kdev_t is gone very few places needs this still, the only header
of those beeing fs.h
|
|
From: Amit Shah <shahamit@gmx.net>
The read function for consoles in include/linux/console.h contains const
char* for a pointer that it will actually modify. Although no one seems
to be using this as of now, it should be corrected.
|
|
Console drivers cleanup. In current tree interaction between
console and tty layer sits in the ->device() method of struct console.
It takes a pointer to console and returns device number of its tty
device. open(2) on /dev/console goes through the list of registered
consoles, picks the first one that has ->device() and remaps the device
number to console->device(console). Then it proceeds with normal
opening of tty. This is the only caller of ->device().
Cleanup: let ->device() return a pair (pointer to tty_driver, index
of tty in question) instead of device number. Note that
a) the first thing tty_open() does with remapped device number is
conversion to such pair.
b) console driver _knows_ which tty_driver we want - one that
implements tty interface to the same physical device (i.e. the part of
the same driver).
c) current code expects the result of ->device() to be a device
number of tty device - anything else is immediate -ENODEV from tty_open();
might as well have NULL ->device in that driver.
Console drivers converted, (the only) caller updated.
|
|
Preparation to console->device() cleanup: serial drivers converted
to common helper for their ->device() methods.
|
|
drivers/video/console. Allow resize of a single VC via the tty layer. Nuked GET_FB_IDX.
|
|
- Al Viro: task-private namespaces, more cleanups
|
|
- Mikael Pettersson: make proc_misc happy without modules
- Arjan van de Ven: clean up acpitable implementation ("micro-acpi")
- Anton Altaparmakov: LDM partition code update
- Alan Cox: final (yeah, sure) small missing pieces
- Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend
- Arjan van de Ven: remove power from pcmcia socket on card remove
- Greg KH: USB updates
- Neil Brown: multipath updates
- Martin Dalecki: fix up some "asmlinkage" routine markings
|
|
- Neil Brown: md cleanups/fixes
- Andrew Morton: console locking merge
- Andrea Arkangeli: major VM merge
|
|
|