OpenCloudOS-Kernel/drivers/gpu/drm
Tong Zhang dc739820ff drm/ast: fix memory leak when unload the driver
a connector is leaked upon module unload, it seems that we should do
similar to sample driver as suggested in drm_drv.c.

Adding drm_atomic_helper_shutdown() in ast_pci_remove to prevent leaking.

[  153.822134] WARNING: CPU: 0 PID: 173 at drivers/gpu/drm/drm_mode_config.c:504 drm_mode_config_cle0
[  153.822698] Modules linked in: ast(-) drm_vram_helper drm_ttm_helper ttm [last unloaded: ttm]
[  153.823197] CPU: 0 PID: 173 Comm: modprobe Tainted: G        W         5.11.0-03615-g55f62bc873474
[  153.823708] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-48-gd9c812dda519-4
[  153.824333] RIP: 0010:drm_mode_config_cleanup+0x418/0x470
[  153.824637] Code: 0c 00 00 00 00 48 8b 84 24 a8 00 00 00 65 48 33 04 25 28 00 00 00 75 65 48 81 c0
[  153.825668] RSP: 0018:ffff888103c9fb70 EFLAGS: 00010212
[  153.825962] RAX: ffff888102b0d100 RBX: ffff888102b0c298 RCX: ffffffff818d8b2b
[  153.826356] RDX: dffffc0000000000 RSI: 000000007fffffff RDI: ffff888102b0c298
[  153.826748] RBP: ffff888103c9fba0 R08: 0000000000000001 R09: ffffed1020561857
[  153.827146] R10: ffff888102b0c2b7 R11: ffffed1020561856 R12: ffff888102b0c000
[  153.827538] R13: ffff888102b0c2d8 R14: ffff888102b0c2d8 R15: 1ffff11020793f70
[  153.827935] FS:  00007f24bff456a0(0000) GS:ffff88815b400000(0000) knlGS:0000000000000000
[  153.828380] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  153.828697] CR2: 0000000001c39018 CR3: 0000000103c90000 CR4: 00000000000006f0
[  153.829096] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  153.829486] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  153.829883] Call Trace:
[  153.830024]  ? drmm_mode_config_init+0x930/0x930
[  153.830281]  ? cpumask_next+0x16/0x20
[  153.830488]  ? mnt_get_count+0x66/0x80
[  153.830699]  ? drm_mode_config_cleanup+0x470/0x470
[  153.830972]  drm_managed_release+0xed/0x1c0
[  153.831208]  drm_dev_release+0x3a/0x50
[  153.831420]  release_nodes+0x39e/0x410
[  153.831631]  ? devres_release+0x40/0x40
[  153.831852]  device_release_driver_internal+0x158/0x270
[  153.832143]  driver_detach+0x76/0xe0
[  153.832344]  bus_remove_driver+0x7e/0x100
[  153.832568]  pci_unregister_driver+0x28/0xf0
[  153.832821]  __x64_sys_delete_module+0x268/0x300
[  153.833086]  ? __ia32_sys_delete_module+0x300/0x300
[  153.833357]  ? call_rcu+0x372/0x4f0
[  153.833553]  ? fpregs_assert_state_consistent+0x4d/0x60
[  153.833840]  ? exit_to_user_mode_prepare+0x2f/0x130
[  153.834118]  do_syscall_64+0x33/0x40
[  153.834317]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[  153.834597] RIP: 0033:0x7f24bfec7cf7
[  153.834797] Code: 48 89 57 30 48 8b 04 24 48 89 47 38 e9 1d a0 02 00 48 89 f8 48 89 f7 48 89 d6 41
[  153.835812] RSP: 002b:00007fff72e6cb58 EFLAGS: 00000202 ORIG_RAX: 00000000000000b0
[  153.836234] RAX: ffffffffffffffda RBX: 00007f24bff45690 RCX: 00007f24bfec7cf7
[  153.836623] RDX: 00000000ffffffff RSI: 0000000000000080 RDI: 0000000001c2fb10
[  153.837018] RBP: 0000000001c2fac0 R08: 2f2f2f2f2f2f2f2f R09: 0000000001c2fac0
[  153.837408] R10: fefefefefefefeff R11: 0000000000000202 R12: 0000000001c2fac0
[  153.837798] R13: 0000000001c2f9d0 R14: 0000000000000000 R15: 0000000000000001
[  153.838194] ---[ end trace b92031513bbe596c ]---
[  153.838441] [drm:drm_mode_config_cleanup] *ERROR* connector VGA-1 leaked!

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210222023322.984885-1-ztong0001@gmail.com
2021-02-22 10:32:26 +01:00
..
amd drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
arc drm: Constify drm_driver in drivers that don't modify it 2021-01-05 07:20:36 +02:00
arm drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
armada drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
aspeed drm: use getter/setter functions 2021-02-10 14:10:59 +01:00
ast drm/ast: fix memory leak when unload the driver 2021-02-22 10:32:26 +01:00
atmel-hlcdc drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
bochs drm/bochs: Remove references to struct drm_device.pdev 2021-01-06 15:42:55 +01:00
bridge drm: use getter/setter functions 2021-02-10 14:10:59 +01:00
etnaviv drm/scheduler: provide scheduler score externally 2021-02-05 10:47:11 +01:00
exynos drm for 5.11-rc1 2020-12-14 11:07:56 -08:00
fsl-dcu drm/<drivers>: Constify struct drm_driver 2020-11-06 10:31:26 +01:00
gma500 drm/gma500: Never wait for blits 2021-02-09 13:07:44 +01:00
hisilicon drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
i2c
i810
i915 drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
imx drm/imx: ipuv3-crtc: use drm managed resources 2021-01-04 12:59:34 +01:00
ingenic drm: automatic legacy gamma support 2020-12-15 15:46:03 +02:00
kmb - Add default modes for connectors in unknown state 2021-01-07 13:02:57 +01:00
lib
lima drm/lima: add governor data with pre-defined thresholds 2021-02-07 20:55:08 +08:00
mcde drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
mediatek drm-misc-next for v5.12: 2021-01-07 10:46:32 +01:00
meson drm/meson: dw-hdmi: Enable the iahb clock early enough 2020-11-20 16:41:10 +01:00
mga drm/mga/mga_ioc32: Fix some formatting issues in 'mga_compat_ioctl's header 2021-01-18 15:41:12 +01:00
mgag200 drm/mgag200: Move vmap out of commit tail 2021-02-08 13:00:26 +01:00
msm drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
mxsfb Short summary of fixes pull (less than what git shortlog provides): 2020-12-15 17:25:55 +01:00
nouveau drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
omapdrm drm/omap: dsi: fix unreachable code in dsi_vc_send_short() 2021-01-27 16:21:36 +02:00
panel drm: use getter/setter functions 2021-02-10 14:10:59 +01:00
panfrost drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs 2021-02-15 09:43:33 +01:00
pl111 drm/cma-helper: Implement mmap as GEM CMA object functions 2020-11-30 13:38:27 +01:00
qxl drm/qxl: add lock asserts to qxl_bo_vmap_locked + qxl_bo_vunmap_locked 2021-02-19 09:13:25 +01:00
r128 drm/r128/r128_ioc32: Fix formatting issues in 'r128_compat_ioctl()'s header 2021-01-18 15:41:04 +01:00
radeon drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
rcar-du - Add default modes for connectors in unknown state 2021-01-07 13:02:57 +01:00
rockchip drm: use getter/setter functions 2021-02-10 14:10:59 +01:00
savage drm/savage/savage_bci: Remove set but never used 'aper_rsrc' and 'fb_rsrc' 2020-11-12 20:31:01 +01:00
scheduler drm/scheduler: provide scheduler score externally 2021-02-05 10:47:11 +01:00
selftests drm/selftests/test-drm_dp_mst_helper: Move 'sideband_msg_req_encode_decode' onto the heap 2020-11-17 20:08:29 +01:00
shmobile drm/<drivers>: Constify struct drm_driver 2020-11-06 10:31:26 +01:00
sis
sti drm: sti: Remove unnecessary drm_plane_cleanup() wrapper 2021-01-05 07:20:21 +02:00
stm drm/stm: Fix bus_flags handling 2021-02-15 17:05:59 +01:00
sun4i drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
tdfx drm: Constify drm_driver in drivers that don't modify it 2021-01-05 07:20:36 +02:00
tegra drm for 5.11-rc1 2020-12-14 11:07:56 -08:00
tidss drm/tidss: use devm_platform_ioremap_resource_byname 2020-11-10 14:34:16 +02:00
tilcdc drm/tilcdc: fix raster control register setting 2021-02-18 18:04:11 +02:00
tiny drm/gm12u320: Move vmap out of commit tail 2021-02-08 13:00:44 +01:00
ttm drm/ttm: drop sysfs directory 2021-02-09 17:28:01 +01:00
tve200 drm/tve200: remove unused including <linux/version.h> 2020-12-30 11:25:05 +01:00
udl drm/udl: Move vmap out of commit tail 2021-02-08 13:00:51 +01:00
v3d drm/scheduler: provide scheduler score externally 2021-02-05 10:47:11 +01:00
vboxvideo drm/vboxvideo: Implement cursor plane with struct drm_shadow_plane_state 2021-02-09 14:23:11 +01:00
vc4 drm/vc4: remove unneeded variable: "ret" 2021-02-02 16:59:33 +01:00
vgem drm/prime: split array import functions v4 2020-11-30 15:00:45 +01:00
via via/via_irq: use __func__ to replace string function name 2020-11-27 16:14:02 +01:00
virtio drm/virtio: fix an error code in virtio_gpu_init() 2021-02-03 14:52:44 +01:00
vkms drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
vmwgfx drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
xen drm/prime: split array import functions v4 2020-11-30 15:00:45 +01:00
xlnx drm/<drivers>: Constify struct drm_driver 2020-11-06 10:31:26 +01:00
zte drm: zte: Remove unnecessary drm_plane_cleanup() wrapper 2021-01-05 07:20:24 +02:00
Kconfig drm: Merge CONFIG_DRM_VM into CONFIG_DRM_LEGACY 2021-01-13 14:22:37 +01:00
Makefile drm: Add additional atomic helpers for shadow-buffered planes 2021-02-08 13:00:14 +01:00
drm_agpsupport.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_atomic.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_atomic_helper.c drm: Introduce a drm_crtc_commit_wait helper 2021-01-21 12:11:04 +01:00
drm_atomic_state_helper.c drm: fix some kernel-doc markups 2020-11-16 20:48:20 +01:00
drm_atomic_uapi.c drm: fix oops in drm_atomic_set_crtc_for_connector 2020-11-16 09:56:55 +01:00
drm_auth.c
drm_blend.c drm/doc: introduce new section for standard plane properties 2020-12-17 16:56:40 +01:00
drm_bridge.c
drm_bridge_connector.c gpu/drm: delete same check in if condition 2020-11-02 14:04:53 +01:00
drm_bufs.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_cache.c drm: Include <linux/mem_encrypt.h> in drm_cache.c 2021-01-14 09:42:31 +01:00
drm_client.c drm/client: Depend on GEM object kmap ref-counting 2020-11-24 09:27:54 +01:00
drm_client_modeset.c drm: replace drm_modeset_lock_all() in drm_client_modeset_dpms_legacy() 2021-02-02 16:01:40 +01:00
drm_color_mgmt.c drm: add legacy support for using degamma for gamma 2020-12-15 15:46:03 +02:00
drm_connector.c drm: fix some kernel-doc markups 2020-11-16 20:48:20 +01:00
drm_context.c
drm_crtc.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h drm: Introduce plane and CRTC scaling filter properties 2020-10-21 12:19:54 +03:00
drm_damage_helper.c
drm_debugfs.c
drm_debugfs_crc.c
drm_dma.c
drm_dp_aux_dev.c drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor() 2020-10-15 13:58:54 -04:00
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/drm_dp_helper: Fix spelling issue and add missing description for 'enable_frl_ready_hpd' 2021-01-18 15:49:57 +01:00
drm_dp_mst_topology.c drm/dp_mst: Tune down the WARN modesetting a port with full_pbn=0 2021-02-18 16:41:35 +02:00
drm_dp_mst_topology_internal.h
drm_drv.c drm/drv: Remove initialization of static variables 2021-02-21 19:49:17 -05:00
drm_dsc.c drm/dsc: add helper for calculating rc buffer size from DPCD 2020-12-10 10:49:47 +02:00
drm_dumb_buffers.c drm: Don't export the drm_gem_dumb_destroy() function 2021-01-05 07:20:25 +02:00
drm_edid.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_edid_load.c
drm_encoder.c drm: add drmm_encoder_alloc() 2021-01-04 12:59:33 +01:00
drm_encoder_slave.c
drm_fb_cma_helper.c
drm_fb_helper.c drm/fb-helper: Add a FIXME that generic_setup is very confusing 2020-12-22 12:17:37 +01:00
drm_file.c drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-01-22 16:22:29 +05:30
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c drm/fourcc: Add AXBXGXRX106106106106 format 2020-10-20 20:51:42 +01:00
drm_framebuffer.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_gem.c drm/gem: Export drm_gem_vmap() and drm_gem_vunmap() 2021-02-08 13:00:06 +01:00
drm_gem_atomic_helper.c drm/gem: Export helpers for shadow-buffered planes 2021-02-09 14:23:02 +01:00
drm_gem_cma_helper.c drm/cma-helper: Implement mmap as GEM CMA object functions 2020-11-30 13:38:27 +01:00
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem-helper: Removed drm_gem_shmem_create_object_cached() 2020-11-24 09:10:33 +01:00
drm_gem_ttm_helper.c drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers 2020-11-09 09:17:36 +01:00
drm_gem_vram_helper.c drm/vram-helper: cleanup drm_gem_vram_bo_driver_move_notify 2021-02-12 14:39:07 +01:00
drm_hashtab.c
drm_hdcp.c
drm_internal.h drm: Don't export the drm_gem_dumb_destroy() function 2021-01-05 07:20:25 +02:00
drm_ioc32.c
drm_ioctl.c drm: Give irq_by_busid drm_legacy_ prefix 2020-10-21 18:05:11 +02:00
drm_irq.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h drm: Merge CONFIG_DRM_VM into CONFIG_DRM_LEGACY 2021-01-13 14:22:37 +01:00
drm_legacy_misc.c
drm_lock.c
drm_managed.c drm/dev: Remove drm_dev_init 2020-09-21 10:45:08 +02:00
drm_memory.c drm: Implement drm_need_swiotlb() in drm_cache.c 2021-01-13 14:22:29 +01:00
drm_mipi_dbi.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c drm-misc-next for v5.12: 2021-01-07 13:40:20 +01:00
drm_mode_object.c drm: fix some kernel-doc markups 2020-11-16 20:48:20 +01:00
drm_modes.c drm/modes: Switch to 64bit maths to avoid integer overflow 2021-01-14 19:37:53 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c drm: Added orientation quirk for OneGX1 Pro 2021-01-20 22:33:01 +01:00
drm_pci.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_plane.c drm: Switch to %p4cc format modifier 2021-02-17 12:52:59 +01:00
drm_plane_helper.c
drm_prime.c drm: Set vm_ops to GEM object's values during mmap 2021-01-18 10:37:26 +01:00
drm_print.c
drm_probe_helper.c drm: Add default modes for connectors in unknown state 2021-01-05 07:19:50 +02:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_scdc_helper.c drm: fix some kernel-doc markups 2020-11-16 20:48:20 +01:00
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Add plane-state helpers 2021-02-08 12:59:59 +01:00
drm_syncobj.c drm/syncobj: make lockdep complain on WAIT_FOR_SUBMIT v3 2021-01-20 15:05:45 +01:00
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c drm/vblank: Document drm_crtc_vblank_restore constraints 2021-02-10 12:38:55 +01:00
drm_vblank_work.c
drm_vm.c drm: Upcast struct drm_device.dev to struct pci_device; replace pdev 2021-01-19 09:06:38 +01:00
drm_vma_manager.c
drm_writeback.c