summaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2018-07-25 15:41:54 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-07-25 15:41:54 +0200
commit8c5b044299951acd91e830a688dd920477ea1eda (patch)
tree0a638cff1063c0c10ab8969c3c8d932635cdfffe /include/video
parent88fe4ceb2447773f6d0c6e3642dc46fcd6a4cdd1 (diff)
downloadlinux-8c5b044299951acd91e830a688dd920477ea1eda.tar.bz2
fb: fix lost console when the user unplugs a USB adapter
I have a USB display adapter using the udlfb driver and I use it on an ARM board that doesn't have any graphics card. When I plug the adapter in, the console is properly displayed, however when I unplug and re-plug the adapter, the console is not displayed and I can't access it until I reboot the board. The reason is this: When the adapter is unplugged, dlfb_usb_disconnect calls unlink_framebuffer, then it waits until the reference count drops to zero and then it deallocates the framebuffer. However, the console that is attached to the framebuffer device keeps the reference count non-zero, so the framebuffer device is never destroyed. When the USB adapter is plugged again, it creates a new device /dev/fb1 and the console is not attached to it. This patch fixes the bug by unbinding the console from unlink_framebuffer. The code to unbind the console is moved from do_unregister_framebuffer to a function unbind_console. When the console is unbound, the reference count drops to zero and the udlfb driver frees the framebuffer. When the adapter is plugged back, a new framebuffer is created and the console is attached to it. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Bernie Thompson <bernie@plugable.com> Cc: Ladislav Michl <ladis@linux-mips.org> Cc: stable@vger.kernel.org [b.zolnierkie: preserve old behavior for do_unregister_framebuffer()] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'include/video')
0 files changed, 0 insertions, 0 deletions