On Wednesday 22 July 2009, Andy Walls wrote:
> On Wed, 2009-07-22 at 08:00 +0100, Ian Armstrong wrote:
> > In the event that an error occurs when trying to unregister the
> > framebuffer, the ivtvfb module should issue a warning, but behaviour
> > beyond this point is undefined. Given that you shouldn't be able to
> > unload the module if the framebuffer is in use, this situation should
> > never arise.
>
> If unregister_framebuffer() fails ivtvfb issues the warning that the
> framebuffer was in use (which doesn't strcitly have to be the case I
> think, but ivtvfb has no insight into the failure mode). A failure mode
> in unregister_framebuffer() is the FB_EVENT_FB_UNBIND notification
> returning failure.
The framebuffer *is* failing to unbind, so this is where it's going wrong.
The problem occurs if the user specifies something like fbcon=vc:64-63 as a
kernel option to stop fbcon binding any framebuffers. When ivtvfb (or any
other framebuffer driver) is unloaded, it will unregister itself via
unregister_framebuffer(), which in turn requests that fbcon unbind the
framebuffer. This isn't normally a problem, but with the above fbcon option it
will fail since fbcon was never allowed to bind any framebuffer. This failure
prevents the framebuffer from being released properly, though by this point
the module is committed to being unloaded.
The attached patch fixes it by making fbcon_fb_unbind() return no error when
the console range to bind to has a start number higher than the end number.
This patch was tested on a 2.6.30 kernel.
--
Ian
--- drivers/video/console/fbcon.c.old 2009-07-22 19:28:19.000000000 +0100
+++ drivers/video/console/fbcon.c 2009-07-22 19:29:26.000000000 +0100
@@ -2936,6 +2936,9 @@ static int fbcon_fb_unbind(int idx)
{
int i, new_idx = -1, ret = 0;
+ if (first_fb_vc > last_fb_vc)
+ return 0;
+
for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] != idx &&
con2fb_map[i] != -1) {
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel