android_kernel_motorola_sm6225/include/video
Mikulas Patocka c014cae8e1 udlfb: handle unplug properly
commit 68a958a915ca912b8ce71b9eea7445996f6e681e upstream.

The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.

The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.

This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
  instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
  cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
  be called by the framebuffer subsystem when no processes have the
  framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
  from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
  and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
  doesn't free the device under us.

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>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27 10:09:03 +01:00
..
atmel_lcdc.h
aty128.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
broadsheetfb.h
cirrus.h
cvisionppc.h
da8xx-fb.h
display_timing.h video: display_timing: Add flags to select the edge when the sync is driven 2016-11-02 10:48:18 +02:00
edid.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gbe.h
hecubafb.h
ili9320.h
imx-ipu-image-convert.h gpu: ipu-v3: Add queued image conversion support 2016-09-19 08:30:27 +02:00
imx-ipu-v3.h gpu: ipu-v3: prg: add modifier support 2017-12-19 12:49:11 +01:00
kyro.h drivers/video/fbdev/kyrofb: Use arch_phys_wc_add() and pci_ioremap_wc_bar() 2015-08-25 09:59:44 +02:00
mach64.h
maxinefb.h
mbxfb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
metronomefb.h
mipi_display.h drm: Add support for pps and compression mode command packet 2018-07-25 07:51:05 -04:00
mmp_disp.h
neomagic.h
newport.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of_display_timing.h video: of: display_timing: Remove of_display_timings_exist() function 2018-03-12 17:06:54 +01:00
of_videomode.h
omap-panel-data.h omapdss: omap-panel-data.h: Remove connector_type from atv pdata 2016-06-03 16:06:32 +03:00
omapfb_dss.h media: include/video/omapfb_dss.h: use IS_ENABLED() 2018-05-05 11:45:51 -04:00
omapvrfb.h
permedia2.h
platform_lcd.h
pm3fb.h
pmag-ba-fb.h
pmagb-b-fb.h
pxa168fb.h
radeon.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
s1d13xxxfb.h
sa1100fb.h
samsung_fimd.h drm/exynos: add macro to get the address of START_S reg 2015-08-31 00:27:37 +09:00
sh_mobile_lcdc.h video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support 2018-05-14 15:47:30 +02:00
sisfb.h
sstfb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tdfx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tgafb.h
trident.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
udlfb.h udlfb: handle unplug properly 2019-02-27 10:09:03 +01:00
uvesafb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vga.h arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead 2015-08-10 23:07:05 -04:00
videomode.h
w100fb.h