kernel_samsung_a53x/drivers/video/fbdev
Nam Cao 6f8ea5132e fbdev: flush deferred work in fb_deferred_io_fsync()
commit 15e4c1f462279b4e128f27de48133e0debe9e0df upstream.

The driver's fsync() is supposed to flush any pending operation to
hardware. It is implemented in this driver by cancelling the queued
deferred IO first, then schedule it for "immediate execution" by calling
schedule_delayed_work() again with delay=0. However, setting delay=0
only means the work is scheduled immediately, it does not mean the work
is executed immediately. There is no guarantee that the work is finished
after schedule_delayed_work() returns. After this driver's fsync()
returns, there can still be pending work. Furthermore, if close() is
called by users immediately after fsync(), the pending work gets
cancelled and fsync() may do nothing.

To ensure that the deferred IO completes, use flush_delayed_work()
instead. Write operations to this driver either write to the device
directly, or invoke schedule_delayed_work(); so by flushing the
workqueue, it can be guaranteed that all previous writes make it to the
device.

Fixes: 5e841b88d23d ("fb: fsync() method for deferred I/O flush.")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-18 12:12:47 +01:00
..
aty fbdev: atyfb: only use ioremap_uc() on i386 and ia64 2024-11-18 10:58:46 +01:00
core fbdev: flush deferred work in fb_deferred_io_fsync() 2024-11-18 12:12:47 +01:00
geode Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i810 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intelfb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kyro Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
matrox Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mb862xx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvidia Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
riva Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
savage Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vermilion Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
via Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
68328fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acornfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acornfb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amba-clcd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amifb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arcfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arkfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asiliantfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb_iplan2p2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb_iplan2p4.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb_iplan2p8.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb_mfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atafb_utils.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atmel_lcdfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
au1100fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
au1100fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
au1200fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
au1200fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
broadsheetfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bt431.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bt455.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bw2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
c2p.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
c2p_core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
c2p_iplan2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
c2p_planar.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
carminefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
carminefb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
carminefb_regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cg3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cg6.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cg14.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chipsfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cirrusfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clps711x-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cobalt_lcdfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
controlfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
controlfb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cyber2000fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cyber2000fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
da8xx-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dnfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
edid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
efifb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ep93xx-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ffb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fm2fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsl-diu-fb.c fbdev: fsl-diu-fb: mark wr_reg_wa() static 2024-11-18 11:43:11 +01:00
g364fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gbefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
goldfishfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
grvga.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gxt4500.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hecubafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hgafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hitfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hpfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hyperv_fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i740_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i740fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imsttfb.c fbdev: imsttfb: fix a resource leak in probe 2024-11-18 11:43:11 +01:00
imxfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
macfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
macmodes.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
macmodes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
maxinefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
metronomefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mx3fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
n411.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
neofb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
offb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
p9100.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
platinumfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
platinumfb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pm2fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pm3fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmag-aa-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmag-ba-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmagb-b-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ps3fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pvr2fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa3xx-gcu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa3xx-gcu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa168fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa168fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxafb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
q40fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s1d13xxxfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3c-fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3c2410fb-regs-lcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3c2410fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3c2410fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sa1100fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sbuslib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sbuslib.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh7760fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh_mobile_lcdcfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh_mobile_lcdcfb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
simplefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skeletonfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm501fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm712.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm712fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smscufx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ssd1307fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sstfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sticore.h fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2024-11-18 12:11:12 +01:00
stifb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxvr500.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxvr1000.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxvr2500.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tdfxfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tgafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tmiofb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tridentfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udlfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvesafb.c fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() 2024-11-18 10:58:46 +01:00
valkyriefb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
valkyriefb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vesafb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vga16fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vt8500lcdfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vt8500lcdfb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vt8623fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
w100fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
w100fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wm8505fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wm8505fb_regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wmt_ge_rops.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wmt_ge_rops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xen-fbfront.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xilinxfb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00