From: Jakub Bogusz <qboosh@pld-linux.org>
To: linux-kernel@vger.kernel.org, linux-fbdev-devel@lists.sourceforge.net
Cc: pld-kernel@pld-linux.org
Subject: 2.6.7 fbcon: set_con2fb on current console = crash
Date: Fri, 18 Jun 2004 23:50:47 +0200 [thread overview]
Message-ID: <20040618215047.GA4723@satan.blackhosts> (raw)
[-- Attachment #1: Type: text/plain, Size: 980 bytes --]
After upgrade from 2.6.4 to 2.6.7 I noticed that calling set_con2fb
(through FBIOPUT_CON2FBMAP ioctl) on current console (already attached
to fb using this ioctl) causes crash (oops and then recursive oops when
trying to printk on console) and makes console unusable.
That's because take_over_console() calls fbcon_deinit(vc_num)
(which calls fbcon_free_font() on that console display) and then
fbcon_init(vc_num, ...), which copies font data from current fb console.
If current console was just deinit()ed, its fontdata is NULL - and this
pointer is "copied" to the same place, leaving current console with
fontdata==NULL (which leads to oops on nearest putc/putcs).
Attached patch restores 2.6.4 behaviour on set_con2fb (to set font if
it's not set already) - but it's not perfect solution as user font is
still lost (unline on 2.4.x kernels).
Any idea how to preserve user font on set_con2fb() called on current
console?
--
Jakub Bogusz http://cyber.cs.net.pl/~qboosh/
[-- Attachment #2: linux-fbcon-con2fb-crash-workaround.patch --]
[-- Type: text/plain, Size: 707 bytes --]
--- linux-2.6.7/drivers/video/console/fbcon.c.orig 2004-06-16 18:24:04.000000000 +0200
+++ linux-2.6.7/drivers/video/console/fbcon.c 2004-06-18 23:12:35.000000000 +0200
@@ -617,6 +617,15 @@
if (p->userfont) {
REFCOUNT(p->fontdata)++;
charcnt = FNTCHARCNT(p->fontdata);
+ } else if(!p->fontdata) {
+ struct font_desc *font = NULL;
+ if (!fontname[0] || !(font = find_font(fontname)))
+ font = get_default_font(info->var.xres,
+ info->var.yres);
+ vc->vc_font.width = font->width;
+ vc->vc_font.height = font->height;
+ vc->vc_font.data = p->fontdata = font->data;
+ vc->vc_font.charcount = 256; /* FIXME Need to support more fonts */
}
con_copy_unimap(vc->vc_num, display_fg);
next reply other threads:[~2004-06-18 21:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-18 21:50 Jakub Bogusz [this message]
2004-06-19 6:13 ` 2.6.7 fbcon: set_con2fb on current console = crash Antonino A. Daplas
2004-06-19 9:28 ` Geert Uytterhoeven
2004-06-19 10:03 ` Antonino A. Daplas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040618215047.GA4723@satan.blackhosts \
--to=qboosh@pld-linux.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pld-kernel@pld-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).