]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
vt: fix issue when fbcon wants to takeover a second time.
authorDave Airlie <airlied@redhat.com>
Thu, 6 Jan 2011 23:57:41 +0000 (09:57 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 23 Jan 2011 03:15:00 +0000 (19:15 -0800)
With framebuffer handover and multiple GPUs, we get into a
position where the fbcon unbinds the vesafb framebuffer for GPU 1,
but we still have a radeon framebuffer bound from GPU 0, so
we don't unregister the console driver. Then when we tried to bind
the new radeon framebuffer for GPU1 we never get to the bind
call as we fail due to the console being registered already.

This changes the return value to -EBUSY when the driver is
already registered and continues to bind for -EBUSY.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/vt/vt.c

index 76407eca9ab0101567df390b39ea03b1b50e3d58..4f6ae05eb4f946d71a3968f37c867b2d1fe230bd 100644 (file)
@@ -3545,7 +3545,7 @@ int register_con_driver(const struct consw *csw, int first, int last)
 
                /* already registered */
                if (con_driver->con == csw)
-                       retval = -EINVAL;
+                       retval = -EBUSY;
        }
 
        if (retval)
@@ -3656,7 +3656,12 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt)
        int err;
 
        err = register_con_driver(csw, first, last);
-
+       /* if we get an busy error we still want to bind the console driver
+        * and return success, as we may have unbound the console driver
+        * but not unregistered it.
+       */
+       if (err == -EBUSY)
+               err = 0;
        if (!err)
                bind_con_driver(csw, first, last, deflt);