diff options
author | Dave Airlie <airlied@redhat.com> | 2011-01-07 09:57:41 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-24 14:54:25 -0800 |
commit | 385979a2a621ab3c0d740d552ad243f82697cd48 (patch) | |
tree | 032baefd8676767c8034a580e5a036792a3411a2 | |
parent | 91c7f5956bb12cc73d7f31c2f9abdcedced5af9f (diff) | |
download | lwn-385979a2a621ab3c0d740d552ad243f82697cd48.tar.gz lwn-385979a2a621ab3c0d740d552ad243f82697cd48.zip |
vt: fix issue when fbcon wants to takeover a second time.
commit c55c63c6539499379ab4a7e8a5c0f857351fb946 upstream.
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>
-rw-r--r-- | drivers/tty/vt/vt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index a8ec48ed14d9..913069930723 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3524,7 +3524,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) @@ -3635,7 +3635,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); |