Takashi Iwai
fe9ae05cfb
fbdev: Fix incorrect page mapping clearance at fb_deferred_io_release()
...
The recent fix for the deferred I/O by the commit
3efc61d952 ("fbdev: Fix invalid page access after closing deferred I/O devices")
caused a regression when the same fb device is opened/closed while
it's being used. It resulted in a frozen screen even if something
is redrawn there after the close. The breakage is because the patch
was made under a wrong assumption of a single open; in the current
code, fb_deferred_io_release() cleans up the page mapping of the
pageref list and it calls cancel_delayed_work_sync() unconditionally,
where both are no correct behavior for multiple opens.
This patch adds a refcount for the opens of the device, and applies
the cleanup only when all files get closed.
As both fb_deferred_io_open() and _close() are called always in the
fb_info lock (mutex), it's safe to use the normal int for the
refcounting.
Also, a useless BUG_ON() is dropped.
Fixes: 3efc61d952 ("fbdev: Fix invalid page access after closing deferred I/O devices")
Cc: <stable@vger.kernel.org >
Signed-off-by: Takashi Iwai <tiwai@suse.de >
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20230308105012.1845-1-tiwai@suse.de
2023-03-10 14:13:02 +01:00
..
2022-11-16 13:26:25 +01:00
2023-03-10 14:13:02 +01:00
2022-12-14 20:01:51 +01:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2022-12-14 20:01:50 +01:00
2022-11-16 13:26:25 +01:00
2022-04-12 22:06:10 +02:00
2022-11-16 13:26:25 +01:00
2022-08-24 21:53:41 +02:00
2022-12-14 20:01:50 +01:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2022-11-24 11:05:43 +10:00
2022-12-14 20:01:50 +01:00
2022-12-14 20:01:50 +01:00
2022-07-18 07:54:20 +02:00
2021-02-24 13:38:31 -08:00
2019-06-19 17:09:55 +02:00
2022-07-26 08:56:22 +02:00
2022-07-18 07:54:17 +02:00
2021-07-21 13:09:21 +02:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2019-04-01 17:46:55 +02:00
2022-07-18 07:56:18 +02:00
2022-01-30 19:38:35 +01:00
2022-06-20 20:19:50 +02:00
2022-02-16 10:54:42 +01:00
2022-01-29 22:24:25 +01:00
2022-05-03 16:04:22 +02:00
2022-08-24 22:06:15 +02:00
2020-03-09 11:12:19 +01:00
2022-11-16 13:26:25 +01:00
2020-12-08 18:34:08 +01:00
2020-12-08 18:34:08 +01:00
2020-01-15 17:31:50 +01:00
2023-02-28 09:20:04 +01:00
2022-11-16 13:26:25 +01:00
2022-08-24 22:06:15 +02:00
2019-12-05 10:57:53 +02:00
2022-12-14 20:01:50 +01:00
2019-05-30 11:26:32 -07:00
2022-11-24 11:05:43 +10:00
2019-06-19 17:09:55 +02:00
2022-12-14 20:01:50 +01:00
2022-07-18 07:54:20 +02:00
2022-06-20 18:21:25 +02:00
2022-12-14 20:01:50 +01:00
2022-08-24 22:06:15 +02:00
2022-07-18 07:54:20 +02:00
2020-10-17 08:23:14 +02:00
2020-02-19 10:58:22 -08:00
2022-10-18 10:28:41 +02:00
2020-12-08 18:34:50 +01:00
2020-07-20 11:47:29 +02:00
2022-11-16 13:26:25 +01:00
2022-05-03 16:04:22 +02:00
2021-05-21 15:04:05 +02:00
2020-06-09 09:39:13 -07:00
2022-07-18 07:54:20 +02:00
2022-12-13 11:59:58 -08:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2022-10-08 15:20:08 +02:00
2022-12-14 20:01:51 +01:00
2020-12-08 18:34:08 +01:00
2020-07-20 11:47:29 +02:00
2022-04-21 15:00:45 +02:00
2019-12-05 10:57:53 +02:00
2022-05-03 16:04:22 +02:00
2022-04-19 12:06:18 +01:00
2022-11-16 13:26:25 +01:00
2022-01-29 22:24:25 +01:00
2022-07-28 16:22:12 +10:00
2020-12-08 18:34:08 +01:00
2022-04-04 08:55:23 +02:00
2022-12-14 20:01:50 +01:00
2022-11-16 13:26:25 +01:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-01-30 08:04:01 -08:00
2020-12-04 01:01:22 +11:00
2022-11-16 13:26:25 +01:00
2022-06-20 20:12:17 +02:00
2022-04-19 16:29:03 +02:00
2022-08-24 22:06:15 +02:00
2022-12-14 20:01:50 +01:00
2019-08-26 10:02:02 +02:00
2022-07-18 07:54:20 +02:00
2020-11-29 22:51:07 +01:00
2020-08-20 17:48:12 +02:00
2020-08-20 17:48:12 +02:00
2022-03-24 16:19:43 -07:00
2022-11-16 13:26:25 +01:00
2022-07-18 07:54:18 +02:00
2020-04-17 15:50:11 +02:00
2020-09-25 16:34:50 +02:00
2020-01-30 08:04:01 -08:00
2022-12-14 20:01:51 +01:00
2019-06-12 20:28:11 +02:00
2022-08-24 22:06:15 +02:00
2022-11-16 13:26:25 +01:00
2022-10-18 10:22:28 +02:00
2019-04-01 17:46:59 +02:00
2022-11-16 13:26:25 +01:00
2022-12-14 20:01:50 +01:00
2022-12-14 20:01:48 +01:00
2022-11-16 13:26:25 +01:00
2022-06-04 15:47:03 +02:00
2022-10-18 10:22:28 +02:00
2022-11-16 13:26:25 +01:00
2022-08-24 22:06:15 +02:00
2022-11-16 13:26:25 +01:00
2022-08-24 22:06:15 +02:00
2022-11-16 13:26:25 +01:00
2022-11-16 13:26:25 +01:00
2019-12-05 10:57:53 +02:00
2022-11-16 13:26:25 +01:00
2022-10-08 15:20:08 +02:00
2022-12-14 20:01:51 +01:00
2022-07-18 07:54:20 +02:00
2019-05-30 11:26:32 -07:00
2022-05-28 19:26:56 +02:00
2019-12-05 10:57:53 +02:00
2022-10-08 15:20:09 +02:00
2020-04-17 15:50:08 +02:00
2019-06-05 17:36:37 +02:00
2022-11-16 13:26:25 +01:00
2022-01-29 22:24:26 +01:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2020-03-02 16:32:04 +01:00
2020-12-08 18:34:36 +01:00
2022-12-02 11:25:02 +01:00
2022-10-20 08:36:41 +02:00