2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/video/fbdev
Saurabh Sengar ea2f45ab0e fbdev: hyperv_fb: Allow graceful removal of framebuffer
When a Hyper-V framebuffer device is unbind, hyperv_fb driver tries to
release the framebuffer forcefully. If this framebuffer is in use it
produce the following WARN and hence this framebuffer is never released.

[   44.111220] WARNING: CPU: 35 PID: 1882 at drivers/video/fbdev/core/fb_info.c:70 framebuffer_release+0x2c/0x40
< snip >
[   44.111289] Call Trace:
[   44.111290]  <TASK>
[   44.111291]  ? show_regs+0x6c/0x80
[   44.111295]  ? __warn+0x8d/0x150
[   44.111298]  ? framebuffer_release+0x2c/0x40
[   44.111300]  ? report_bug+0x182/0x1b0
[   44.111303]  ? handle_bug+0x6e/0xb0
[   44.111306]  ? exc_invalid_op+0x18/0x80
[   44.111308]  ? asm_exc_invalid_op+0x1b/0x20
[   44.111311]  ? framebuffer_release+0x2c/0x40
[   44.111313]  ? hvfb_remove+0x86/0xa0 [hyperv_fb]
[   44.111315]  vmbus_remove+0x24/0x40 [hv_vmbus]
[   44.111323]  device_remove+0x40/0x80
[   44.111325]  device_release_driver_internal+0x20b/0x270
[   44.111327]  ? bus_find_device+0xb3/0xf0

Fix this by moving the release of framebuffer and assosiated memory
to fb_ops.fb_destroy function, so that framebuffer framework handles
it gracefully.

While we fix this, also replace manual registrations/unregistration of
framebuffer with devm_register_framebuffer.

Fixes: 68a2d20b79 ("drivers/video: add Hyper-V Synthetic Video Frame Buffer Driver")

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1740845791-19977-3-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1740845791-19977-3-git-send-email-ssengar@linux.microsoft.com>
2025-03-09 23:56:29 +00:00
..
aty fbdev: radeon: Use const 'struct bin_attribute' callbacks 2024-12-22 07:03:42 +01:00
core fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE 2024-12-17 18:06:10 +01:00
geode video/nomodeset: Select nomodeset= parameter with CONFIG_VIDEO 2024-01-23 10:11:38 +01:00
i810 fbdev/i810fb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:55:32 +02:00
kyro fbdev: kyro: add missing MODULE_DESCRIPTION() macro 2024-06-13 23:10:41 +02:00
matrox move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
mb862xx fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
mmp video: fbdev: mmp: switch to use spi_alloc_host() 2024-09-30 01:12:06 +02:00
nvidia Backmerge v6.12-rc6 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2024-11-04 14:25:33 +10:00
omap fbdev: omap: use threaded IRQ for LCD DMA 2025-01-09 00:37:54 +01:00
omap2 fbdev: omapfb: Use syscon_regmap_lookup_by_phandle_args 2025-01-12 18:12:35 +01:00
riva fbdev: rivafb: Use backlight power constants 2024-09-30 16:35:40 +02:00
savage fbdev: savage: Handle err return when savagefb_check_var failed 2024-04-25 12:04:18 +02:00
sis fbdev: sisfb: Fix strbuf array overflow 2024-09-28 00:42:11 +02:00
via fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
68328fb.c fbdev/68328fb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:54:16 +02:00
acornfb.c fbdev/acornfb: Fix name of fb_ops initializer macro 2023-11-29 12:20:08 +01:00
acornfb.h
amifb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
arcfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
arkfb.c fbcon: Increase maximum font width x height to 64 x 128 2024-03-16 08:29:48 +01:00
asiliantfb.c
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h
atafb.c fbdev/atafb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:54:38 +02:00
atafb.h
atmel_lcdfb.c Backmerge v6.12-rc6 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next 2024-11-04 14:25:33 +10:00
au1100fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
au1100fb.h
au1200fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
au1200fb.h
broadsheetfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
bt431.h
bt455.h
bw2.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
c2p_core.h
c2p_iplan2.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
c2p_planar.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
c2p.h
carminefb_regs.h
carminefb.c
carminefb.h
cg3.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
cg6.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
cg14.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
chipsfb.c fbdev: chipsfb: Use backlight power constants 2024-09-30 16:35:28 +02:00
cirrusfb.c fbdev/cirrusfb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:54:52 +02:00
clps711x-fb.c - Improved handling of LCD power states and interactions with the fbdev subsystem. 2024-11-22 16:29:57 -08:00
cobalt_lcdfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
controlfb.c fbdev/controlfb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:54:59 +02:00
controlfb.h
cyber2000fb.c This cycle, I2C removes the currently unused CLASS_DDC support 2024-01-18 17:29:01 -08:00
cyber2000fb.h
dnfb.c fbdev/dnfb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:55:07 +02:00
edid.h
efifb.c fbdev: efifb: Change the return value type to void 2025-01-09 00:29:42 +01:00
ep93xx-fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
ffb.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
fm2fb.c
fsl-diu-fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
g364fb.c fbdev/g364fb: fix build failure with mips 2023-09-02 08:18:40 -07:00
gbefb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
goldfishfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
grvga.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
gxt4500.c
hecubafb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
hgafb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
hitfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
hpfb.c fbdev: hpfb: Fix an error handling path in hpfb_dio_probe() 2024-08-30 18:42:38 +02:00
hyperv_fb.c fbdev: hyperv_fb: Allow graceful removal of framebuffer 2025-03-09 23:56:29 +00:00
i740_reg.h
i740fb.c fbdev: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
imsttfb.c fbdev: imsttfb: convert comma to semicolon 2024-09-02 13:54:26 +02:00
imxfb.c - Improved handling of LCD power states and interactions with the fbdev subsystem. 2024-11-22 16:29:57 -08:00
Kconfig fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE 2024-12-17 18:06:10 +01:00
leo.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
macfb.c
macmodes.c fbdev: macmodes: add missing MODULE_DESCRIPTION() macro 2024-06-13 23:10:41 +02:00
macmodes.h
Makefile fbdev: da8xx: remove the driver 2024-10-15 10:08:23 +02:00
maxinefb.c
metronomefb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
n411.c
neofb.c fbdev/neofb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:55:48 +02:00
ocfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
offb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
p9100.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
platinumfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
platinumfb.h
pm2fb.c fbdev/pm2fb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:56:00 +02:00
pm3fb.c fbdev/pm3fb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:56:04 +02:00
pmag-aa-fb.c
pmag-ba-fb.c
pmagb-b-fb.c
ps3fb.c fbdev: Push pgprot_decrypted() into mmap implementations 2023-11-29 12:20:44 +01:00
pvr2fb.c fbdev/pvr2fb: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:56:08 +02:00
pxa3xx-gcu.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
pxa3xx-gcu.h
pxa3xx-regs.h
pxa168fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
pxa168fb.h
pxafb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
pxafb.h
q40fb.c
s1d13xxxfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
s3c-fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
s3fb.c fbcon: Increase maximum font width x height to 64 x 128 2024-03-16 08:29:48 +01:00
sa1100fb.c fbdev: Push pgprot_decrypted() into mmap implementations 2023-11-29 12:20:44 +01:00
sa1100fb.h
sbuslib.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
sbuslib.h fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
sh7760fb.c fbdev: sh7760fb: Fix a possible memory leak in sh7760fb_alloc_mem() 2024-11-14 15:26:27 +01:00
sh_mobile_lcdcfb.c fbdev: lcdcfb: Use backlight helper 2025-01-21 14:16:39 +01:00
sh_mobile_lcdcfb.h
simplefb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
skeletonfb.c
sm501fb.c fbdev: sm501fb: Use str_enabled_disabled() helper in sm501fb_init_fb() 2025-01-12 18:10:01 +01:00
sm712.h
sm712fb.c fbdev/sm712fb: Use correct initializer macros for struct fb_ops 2023-11-29 12:20:10 +01:00
smscufx.c fbdev: smscufx: Make I2C terminology more inclusive 2024-07-11 12:07:48 +02:00
ssd1307fb.c fbdev: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-24 15:57:42 +02:00
sstfb.c fbdev: sstfb: Make CONFIG_FB_DEVICE optional 2024-10-15 10:07:31 +02:00
stifb.c fbdev: stifb: Fix crash in stifb_blank() 2024-01-23 09:13:24 +01:00
sunxvr500.c fbdev/sunxvr500: Initialize fb_ops to fbdev I/O-memory helpers 2023-10-19 12:56:55 +02:00
sunxvr1000.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
sunxvr2500.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
tcx.c fbdev: Constify struct sbus_mmap_map 2024-10-15 10:07:32 +02:00
tdfxfb.c fbdev: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
tgafb.c vt: remove superfluous CONFIG_HW_CONSOLE 2024-01-27 19:03:51 -08:00
tridentfb.c fbdev: remove I2C_CLASS_DDC support 2024-01-18 21:10:41 +01:00
udlfb.c fbdev: udlfb: Use const 'struct bin_attribute' callback 2024-12-22 07:03:42 +01:00
uvesafb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
valkyriefb.c
valkyriefb.h
vesafb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
vfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
vga16fb.c fbdev: vga16fb: fix orig_video_isVGA confusion 2025-01-19 22:33:52 +01:00
vt8500lcdfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
vt8500lcdfb.h
vt8623fb.c fbcon: Increase maximum font width x height to 64 x 128 2024-03-16 08:29:48 +01:00
wm8505fb_regs.h
wm8505fb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
wmt_ge_rops.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00
wmt_ge_rops.h
xen-fbfront.c fbdev: xen-fbfront: Assign fb_info->device 2024-09-11 07:58:18 +02:00
xilinxfb.c fbdev: Switch back to struct platform_driver::remove() 2024-10-08 21:47:18 +02:00