lede/target/linux/bcm27xx/patches-6.12/950-0317-fbdev-Don-t-cancel-deferred-work-if-pagelist-empty.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

37 lines
1.4 KiB
Diff

From 34f783bc6656d41dff26630f10f89dfdfbdb5097 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Wed, 29 Mar 2023 09:49:36 +0100
Subject: [PATCH] fbdev: Don't cancel deferred work if pagelist empty
Since [1], the fbdev deferred IO framework is careful to cancel
pending updates on close to prevent dirty pages being accessed after
they may have been reused. However, this is not necessary in the case
that the pagelist is empty, and drivers that don't make use of the
pagelist may have wanted updates cancelled for no good reason.
Avoid penalising fbdev drivers that don't make use of the pagelist by
making the cancelling of deferred IO on close conditional on there
being a non-empty pagelist.
See: https://github.com/raspberrypi/linux/issues/5398
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1] 3efc61d95259 ("fbdev: Fix invalid page access after closing deferred I/O devices")
---
drivers/video/fbdev/core/fb_defio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -346,7 +346,8 @@ static void fb_deferred_io_lastclose(str
{
unsigned long i;
- flush_delayed_work(&info->deferred_work);
+ if (!list_empty(&info->fbdefio->pagereflist))
+ flush_delayed_work(&info->deferred_work);
/* clear out the mapping that we setup */
for (i = 0; i < info->npagerefs; ++i)