1 From 4899d3181465e16d548af03b7825c4b06e0f0e44 Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Thu, 28 Apr 2022 16:11:34 +0100
4 Subject: [PATCH] Revert "fbdev: Hot-unplug firmware fb devices on
7 This reverts commit c894ac44786cfed383a6c6b20c1bfb12eb96018a.
9 drivers/video/fbdev/core/fbmem.c | 29 +++--------------------------
10 include/linux/fb.h | 1 -
11 2 files changed, 3 insertions(+), 27 deletions(-)
13 --- a/drivers/video/fbdev/core/fbmem.c
14 +++ b/drivers/video/fbdev/core/fbmem.c
16 #include <linux/init.h>
17 #include <linux/linux_logo.h>
18 #include <linux/proc_fs.h>
19 -#include <linux/platform_device.h>
20 #include <linux/seq_file.h>
21 #include <linux/console.h>
22 #include <linux/kmod.h>
23 @@ -1606,36 +1605,18 @@ static void do_remove_conflicting_frameb
24 /* check all firmware fbs and kick off if the base addr overlaps */
25 for_each_registered_fb(i) {
26 struct apertures_struct *gen_aper;
27 - struct device *device;
29 if (!(registered_fb[i]->flags & FBINFO_MISC_FIRMWARE))
32 gen_aper = registered_fb[i]->apertures;
33 - device = registered_fb[i]->device;
34 if (fb_do_apertures_overlap(gen_aper, a) ||
35 (primary && gen_aper && gen_aper->count &&
36 gen_aper->ranges[0].base == VGA_FB_PHYS)) {
38 printk(KERN_INFO "fb%d: switching to %s from %s\n",
39 i, name, registered_fb[i]->fix.id);
42 - * If we kick-out a firmware driver, we also want to remove
43 - * the underlying platform device, such as simple-framebuffer,
44 - * VESA, EFI, etc. A native driver will then be able to
45 - * allocate the memory range.
47 - * If it's not a platform device, at least print a warning. A
48 - * fix would add code to remove the device from the system.
50 - if (dev_is_platform(device)) {
51 - registered_fb[i]->forced_out = true;
52 - platform_device_unregister(to_platform_device(device));
54 - pr_warn("fb%d: cannot remove device\n", i);
55 - do_unregister_framebuffer(registered_fb[i]);
57 + do_unregister_framebuffer(registered_fb[i]);
61 @@ -1973,13 +1954,9 @@ EXPORT_SYMBOL(register_framebuffer);
63 unregister_framebuffer(struct fb_info *fb_info)
65 - bool forced_out = fb_info->forced_out;
68 - mutex_lock(®istration_lock);
69 + mutex_lock(®istration_lock);
70 do_unregister_framebuffer(fb_info);
72 - mutex_unlock(®istration_lock);
73 + mutex_unlock(®istration_lock);
75 EXPORT_SYMBOL(unregister_framebuffer);
77 --- a/include/linux/fb.h
78 +++ b/include/linux/fb.h
79 @@ -502,7 +502,6 @@ struct fb_info {
82 bool skip_vt_switch; /* no VT switch on suspend/resume required */
83 - bool forced_out; /* set when being removed by another driver */
86 static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {