* RE: fbcon sleeping function call from illegal context
@ 2003-03-26 14:31 Thomas Molina
2003-03-26 14:48 ` Thomas Schlichter
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Molina @ 2003-03-26 14:31 UTC (permalink / raw)
To: jsimmons; +Cc: Linux Kernel Mailing List
you wrote
----------------------
Please try my patch I sent to Ben. I attached it to this email for people
to try it.
diff -urN -X /home/jsimmons/dontdiff
linus-2.5/drivers/video/console/fbcon.c \
fbdev-2.5/drivers/video/console/fbcon.c
--- linus-2.5/drivers/video/console/fbcon.c Sat Mar 22 21:45:23 2003
+++ fbdev-2.5/drivers/video/console/fbcon.c Tue Mar 25 12:03:56 2003
--------------------
One hunk applied with fuzz and two hunks were rejected when applied both
to 2.5.66 stock and bk-latest. I fixed up the rejects by hand and
compiled a new kernel against bk-latest. I am running with that version
now, which doesn't emit the string of messages I reported originally. The
only minor anomaly I note is the cursor is a three-segment underscore
rather than a solid underscore.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: fbcon sleeping function call from illegal context 2003-03-26 14:31 fbcon sleeping function call from illegal context Thomas Molina @ 2003-03-26 14:48 ` Thomas Schlichter 2003-03-26 16:58 ` Thomas Molina 0 siblings, 1 reply; 5+ messages in thread From: Thomas Schlichter @ 2003-03-26 14:48 UTC (permalink / raw) To: Thomas Molina, jsimmons; +Cc: Linux Kernel Mailing List [-- Attachment #1.1: body text --] [-- Type: text/plain, Size: 851 bytes --] Am Mittwoch, 26. März 2003 15:31 schrieb Thomas Molina: > One hunk applied with fuzz and two hunks were rejected when applied both > to 2.5.66 stock and bk-latest. I fixed up the rejects by hand and > compiled a new kernel against bk-latest. I am running with that version > now, which doesn't emit the string of messages I reported originally. The > only minor anomaly I note is the cursor is a three-segment underscore > rather than a solid underscore. I had the same problems patching my 2.5.66 and so applied the patch by hand, too. The problem with the wrong shaped cursor was here, too, I solved it with the attached patch. The 'data' area was not initialized correctly. The patch also uses 'memset()' to generate the 'mask' instead of writing the bytes by hand... I hope this helps you,too! Thomas Schlichter [-- Attachment #1.2: fbcon.patch --] [-- Type: text/x-diff, Size: 1573 bytes --] --- linux-2.5.66/drivers/video/console/fbcon.c.patched Wed Mar 26 15:16:41 2003 +++ linux-2.5.66/drivers/video/console/fbcon.c Wed Mar 26 15:27:15 2003 @@ -1001,7 +1001,7 @@ int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; int fgshift = (vc->vc_hi_font_mask) ? 9 : 8; int height, width, size, c; - int w, cur_height, i = 0; + int w, cur_height; char *font, *mask, *data; if (cursor->set & FB_CUR_SETCUR) @@ -1021,7 +1021,8 @@ cursor->set |= FB_CUR_SETSIZE; } - size = ((width + 7) >> 3) * height; + w = (width + 7) >> 3; + size = w * height; data = kmalloc(size, GFP_KERNEL); @@ -1034,10 +1035,7 @@ return; } - if (cursor->set & FB_CUR_SETSIZE) { - memset(data, 0xff, size); - cursor->set |= FB_CUR_SETSHAPE; - } + memset(data, 0xff, size); c = scr_readw((u16 *) vc->vc_pos); @@ -1053,8 +1051,6 @@ cursor->set |= FB_CUR_SETDEST; } - w = (width + 7) >> 3; - switch (vc->vc_cursor_type & 0x0f) { case CUR_NONE: cur_height = 0; @@ -1078,13 +1074,15 @@ } size = (height - cur_height) * w; - while (size--) - mask[i++] = 0; - size = cur_height * w; - while (size--) - mask[i++] = 0xff; - if (!info->cursor.mask || (memcmp(mask, info->cursor.mask, w*height))) + if (size) + memset(mask, 0x00, size); + + if (cur_height) + memset(mask + size, 0xff, cur_height * w); + + if ((cursor->set & FB_CUR_SETSIZE) || !info->cursor.mask || + memcmp(mask, info->cursor.mask, w*height)) cursor->set |= FB_CUR_SETSHAPE; cursor->image.width = width; [-- Attachment #2: signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: fbcon sleeping function call from illegal context 2003-03-26 14:48 ` Thomas Schlichter @ 2003-03-26 16:58 ` Thomas Molina 2003-03-26 18:33 ` James Simmons 0 siblings, 1 reply; 5+ messages in thread From: Thomas Molina @ 2003-03-26 16:58 UTC (permalink / raw) To: Thomas Schlichter; +Cc: jsimmons, Linux Kernel Mailing List On Wed, 26 Mar 2003, Thomas Schlichter wrote: Running with the patch as posted by Mr. Simmons I didn't get any further instances of the sleeping function call from illegal context messages I reported before, until screenblanking went into effect. I then got the following: Mar 26 10:45:03 dad kernel: Debug: sleeping function called from illegal context at mm/slab.c:1723 Mar 26 10:45:03 dad kernel: Call Trace: Mar 26 10:45:03 dad kernel: [<c011d7bf>] __might_sleep+0x4f/0x90 Mar 26 10:45:03 dad kernel: [<c0149611>] kmalloc+0x1a1/0x1c0 Mar 26 10:45:03 dad kernel: [<c0233b65>] accel_cursor+0xd5/0x320 Mar 26 10:45:03 dad kernel: [<c0233edf>] fbcon_cursor+0x12f/0x160 Mar 26 10:45:03 dad kernel: [<c011b74a>] __wake_up_common+0x3a/0x60 Mar 26 10:45:03 dad kernel: [<c01ef99b>] clear_selection+0x1b/0x60 Mar 26 10:45:03 dad kernel: [<c01f2623>] hide_cursor+0x63/0xa0 Mar 26 10:45:03 dad kernel: [<c01f65df>] timer_do_blank_screen+0x4f/0x1b0 Mar 26 10:45:03 dad kernel: [<c01f6870>] blank_screen+0x0/0x20 Mar 26 10:45:03 dad kernel: [<c01f688a>] blank_screen+0x1a/0x20 Mar 26 10:45:03 dad kernel: [<c012ab32>] run_timer_softirq+0x132/0x3c0 Mar 26 10:45:03 dad kernel: [<c0125de1>] do_softirq+0xa1/0xb0 Mar 26 10:45:03 dad kernel: [<c010bdec>] do_IRQ+0x1fc/0x320 Mar 26 10:45:03 dad kernel: [<c0109fdc>] common_interrupt+0x18/0x20 Mar 26 10:45:03 dad kernel: [<c0116c1b>] apm_bios_call_simple+0x7b/0xa0 Mar 26 10:45:03 dad kernel: [<c0116d99>] apm_do_idle+0x29/0x80 Mar 26 10:45:03 dad kernel: [<c0116ead>] apm_cpu_idle+0x7d/0x150 Mar 26 10:45:03 dad kernel: [<c0116e30>] apm_cpu_idle+0x0/0x150 Mar 26 10:45:03 dad kernel: [<c0106fc0>] default_idle+0x0/0x30 Mar 26 10:45:03 dad kernel: [<c0107061>] cpu_idle+0x31/0x40 Mar 26 10:45:03 dad kernel: [<c0105000>] rest_init+0x0/0x30 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: fbcon sleeping function call from illegal context 2003-03-26 16:58 ` Thomas Molina @ 2003-03-26 18:33 ` James Simmons 2003-03-26 21:57 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt 0 siblings, 1 reply; 5+ messages in thread From: James Simmons @ 2003-03-26 18:33 UTC (permalink / raw) To: Thomas Molina Cc: Thomas Schlichter, Benjamin Herrenschmidt, Linux Kernel Mailing List, Linux Fbdev development list > Running with the patch as posted by Mr. Simmons I didn't get any further > instances of the sleeping function call from illegal context messages I > reported before, until screenblanking went into effect. I then got the > following: Oh no!!! I just look at the console timer blanking code. It calls alot of stuff. Not only does this mean we are limited in using kmalloc if we need it but also using a semaphore to sync up the fb_pixmap stuff. At present we use a spinlock. I tried it with a semphore but it kept hosing my system. Now I know why. What should be done is the console blank timer be passed onto console_callback. P.S I reversed some of the cursor changes. It uses static buffers again until we have these issues solved. The code works as long as you don't use more than one framebuffer device but it is rock solid like before for a single framebuffer device. I will have a patch ready in the hour. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-fbdev-devel] Re: fbcon sleeping function call from illegal context 2003-03-26 18:33 ` James Simmons @ 2003-03-26 21:57 ` Benjamin Herrenschmidt 0 siblings, 0 replies; 5+ messages in thread From: Benjamin Herrenschmidt @ 2003-03-26 21:57 UTC (permalink / raw) To: James Simmons Cc: Thomas Molina, Thomas Schlichter, Linux Kernel Mailing List, Linux Fbdev development list On Wed, 2003-03-26 at 19:33, James Simmons wrote: > > Running with the patch as posted by Mr. Simmons I didn't get any further > > instances of the sleeping function call from illegal context messages I > > reported before, until screenblanking went into effect. I then got the > > following: > > Oh no!!! I just look at the console timer blanking code. It calls alot of > stuff. Not only does this mean we are limited in using kmalloc if we need > it but also using a semaphore to sync up the fb_pixmap stuff. At present > we use a spinlock. I tried it with a semphore but it kept hosing my > system. Now I know why. Junk. Move that console blanking stuff to process context too. Actually, I've never fully understood some of the console blanking code, especially the PM callback in there which does really weird things. On pmacs, this code cause the screen to first blank, then unblank, then blank again when the machine is going to sleep. Ben. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-03-26 21:45 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-03-26 14:31 fbcon sleeping function call from illegal context Thomas Molina 2003-03-26 14:48 ` Thomas Schlichter 2003-03-26 16:58 ` Thomas Molina 2003-03-26 18:33 ` James Simmons 2003-03-26 21:57 ` [Linux-fbdev-devel] " Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®