]> git.hungrycats.org Git - linux/commit
fbdev: flush deferred IO before closing
authorNam Cao <namcao@linutronix.de>
Mon, 18 Dec 2023 09:57:31 +0000 (10:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:55:13 +0000 (08:55 +0100)
commit2655757a3f101dba744087033a5c7dbab26cae48
tree2ff5ff3dab6c30d303117160f69a99660321f94a
parent15492bab739317b452c2297e460501e1568fc3ab
fbdev: flush deferred IO before closing

[ Upstream commit 33cd6ea9c0673517cdb06ad5c915c6f22e9615fc ]

When framebuffer gets closed, the queued deferred IO gets cancelled. This
can cause some last display data to vanish. This is problematic for users
who send a still image to the framebuffer, then close the file: the image
may never appear.

To ensure none of display data get lost, flush the queued deferred IO
first before closing.

Another possible solution is to delete the cancel_delayed_work_sync()
instead. The difference is that the display may appear some time after
closing. However, the clearing of page mapping after this needs to be
removed too, because the page mapping is used by the deferred work. It is
not completely obvious whether it is okay to not clear the page mapping.
For a patch intended for stable trees, go with the simple and obvious
solution.

Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support")
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: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/core/fb_defio.c