diff options
author | Dave Airlie <airlied@redhat.com> | 2011-01-06 18:57:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 22:15:00 -0500 |
commit | c55c63c6539499379ab4a7e8a5c0f857351fb946 (patch) | |
tree | e9a607c2c47e22a020620c1e6abc95c962e46814 /drivers/tty/vt | |
parent | 1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff) |
vt: fix issue when fbcon wants to takeover a second time.
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>
Diffstat (limited to 'drivers/tty/vt')
-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 76407eca9ab0..4f6ae05eb4f9 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -3545,7 +3545,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
3545 | 3545 | ||
3546 | /* already registered */ | 3546 | /* already registered */ |
3547 | if (con_driver->con == csw) | 3547 | if (con_driver->con == csw) |
3548 | retval = -EINVAL; | 3548 | retval = -EBUSY; |
3549 | } | 3549 | } |
3550 | 3550 | ||
3551 | if (retval) | 3551 | if (retval) |
@@ -3656,7 +3656,12 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt) | |||
3656 | int err; | 3656 | int err; |
3657 | 3657 | ||
3658 | err = register_con_driver(csw, first, last); | 3658 | err = register_con_driver(csw, first, last); |
3659 | 3659 | /* if we get an busy error we still want to bind the console driver | |
3660 | * and return success, as we may have unbound the console driver | ||
3661 | * but not unregistered it. | ||
3662 | */ | ||
3663 | if (err == -EBUSY) | ||
3664 | err = 0; | ||
3660 | if (!err) | 3665 | if (!err) |
3661 | bind_con_driver(csw, first, last, deflt); | 3666 | bind_con_driver(csw, first, last, deflt); |
3662 | 3667 | ||