vt/console: try harder to print output when panicing
Jesse's initial patch commit said: "At panic time (i.e. when oops_in_progress is set) we should try a bit harder to update the screen and make sure output gets to the VT, since some drivers are capable of flipping back to it. So make sure we try to unblank and update the display if called from a panic context." I've enhanced this to add a flag to the vc that console layer can set to indicate they want this behaviour to occur. This also adds support to fbcon for that flag and adds an fb flag for drivers to indicate they want to use the support. It enables this for KMS drivers. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: James Simmons <jsimmons@infradead.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
26df6d1340
commit
8fd4bd2235
@@ -105,6 +105,7 @@ struct vc_data {
|
||||
struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
|
||||
unsigned long vc_uni_pagedir;
|
||||
unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
|
||||
bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
|
||||
/* additional information is in vt_kern.h */
|
||||
};
|
||||
|
||||
|
@@ -825,6 +825,10 @@ struct fb_tile_ops {
|
||||
*/
|
||||
#define FBINFO_BE_MATH 0x100000
|
||||
|
||||
/* report to the VT layer that this fb driver can accept forced console
|
||||
output like oopses */
|
||||
#define FBINFO_CAN_FORCE_OUTPUT 0x200000
|
||||
|
||||
struct fb_info {
|
||||
int node;
|
||||
int flags;
|
||||
|
@@ -100,6 +100,13 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last,
|
||||
int deflt);
|
||||
int vty_init(const struct file_operations *console_fops);
|
||||
|
||||
static inline bool vt_force_oops_output(struct vc_data *vc)
|
||||
{
|
||||
if (oops_in_progress && vc->vc_panic_force_write)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* vc_screen.c shares this temporary buffer with the console write code so that
|
||||
* we can easily avoid touching user space while holding the console spinlock.
|
||||
|
Reference in New Issue
Block a user