Thread (13 messages) 13 messages, 2 authors, 2007-04-27

Re: Console unregistration questions

From: Jesse Barnes <hidden>
Date: 2007-04-24 23:42:44

On Tuesday, April 24, 2007, Antonino A. Daplas wrote:
quoted
But since we're using drmfb as a console, the unregister_framebuffer
call silently fails.  fbcon is builtin to the kernel, so when drmfb
exits, unregister_framebuffer will end up calling fbcon's
fbcon_fb_unregistered() function via the notifier chain.  However,
when fbcon_fb_unregistered calls unregister_con_driver(&fb_con) it
ignores the return value, which is bad since unregister_con_driver
left fbcon's routines active (due to fbcon still being bound to the
console) even while unregister_framebuffer freed their underlying
structures.
Okay, we can do that. This was not done before because
unregister_framebuffer was only called on rmmod <module>.  But checking
for the return error and have it propagate to the driver should not be a
problem.

I'll send a patch to you and to akpm soon.
Great!  Thanks.
quoted
  So when unregister_framebuffer returns, the
very next console operation causes an oops or worse (I usually see
hide_cursor->fbcon_cursor die when it tries to get at
info->fbcon_par).

However, it doesn't appear that there's a way for fb drivers to unbind
themselves from the console at unload time, so we have to do it
manually.
You cannot unbind framebuffer drivers independently from the console
layer because the console is holding a reference count on them.

FYI: this was what I did initially, but akpm objected :-).
quoted
Should there be a way to unbind it from driver code?  Maybe by
exporting a wrapper to unbind_con_driver?
Yes, you can expose unbind_con_driver(), I don't mind. You can do it
first in your tree, then when you need it for mainline, let me know.
So using unbind_con_driver is ok since we go through the console layer and 
all the refcounting is kosher?  The only other thing with 
unbind_con_driver is I'm not sure about the other arguments (first, last, 
& default) should be if called from a driver context.

Thanks,
Jesse



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help