Thomas Zimmermann
7ac9be96b0
drm/radeon: Disable outputs when releasing fbdev client
Disable the modesetting pipeline before release the radeon's fbdev
client. Fixes the following error:
[ 17.217408] WARNING: CPU: 5 PID: 1464 at drivers/gpu/drm/ttm/ttm_bo.c:326 ttm_bo_release+0x27e/0x2d0 [ttm]
[ 17.217418] Modules linked in: edac_mce_amd radeon(+) drm_ttm_helper ttm video drm_suballoc_helper drm_display_helper kvm irqbypass drm_kms_helper syscopyarea crc32_pclmul sysfillrect sha512_ssse3 sysimgblt sha512_generic cfbfillrect cfbimgblt wmi_bmof aesni_intel cfbcopyarea crypto_simd cryptd k10temp acpi_cpufreq wmi dm_mod
[ 17.217432] CPU: 5 PID: 1464 Comm: systemd-udevd Not tainted 6.4.0-rc4+ #1
[ 17.217436] Hardware name: Micro-Star International Co., Ltd. MS-7A38/B450M PRO-VDH MAX (MS-7A38), BIOS B.G0 07/26/2022
[ 17.217438] RIP: 0010:ttm_bo_release+0x27e/0x2d0 [ttm]
[ 17.217444] Code: 48 89 43 38 48 89 43 40 48 8b 5c 24 30 48 8b b5 40 08 00 00 48 8b 6c 24 38 48 83 c4 58 e9 7a 49 f7 e0 48 89 ef e9 6c fe ff ff <0f> 0b 48 83 7b 20 00 0f 84 b7 fd ff ff 0f 0b 0f 1f 00 e9 ad fd ff
[ 17.217448] RSP: 0018:ffffc9000095fbb0 EFLAGS: 00010202
[ 17.217451] RAX: 0000000000000001 RBX: ffff8881052c8de0 RCX: 0000000000000000
[ 17.217453] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff8881052c8de0
[ 17.217455] RBP: ffff888104a66e00 R08: ffff8881052c8de0 R09: ffff888104a7cf08
[ 17.217457] R10: ffffc9000095fbe0 R11: ffffc9000095fbe8 R12: ffff8881052c8c78
[ 17.217458] R13: ffff8881052c8c78 R14: dead000000000100 R15: ffff88810528b108
[ 17.217460] FS: 00007f319fcbb8c0(0000) GS:ffff88881a540000(0000) knlGS:0000000000000000
[ 17.217463] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 17.217464] CR2: 000055dc8b0224a0 CR3: 000000010373d000 CR4: 0000000000750ee0
[ 17.217466] PKRU: 55555554
[ 17.217468] Call Trace:
[ 17.217470] <TASK>
[ 17.217472] ? __warn+0x97/0x160
[ 17.217476] ? ttm_bo_release+0x27e/0x2d0 [ttm]
[ 17.217481] ? report_bug+0x1ec/0x200
[ 17.217487] ? handle_bug+0x3c/0x70
[ 17.217490] ? exc_invalid_op+0x1f/0x90
[ 17.217493] ? preempt_count_sub+0xb5/0x100
[ 17.217496] ? asm_exc_invalid_op+0x16/0x20
[ 17.217500] ? ttm_bo_release+0x27e/0x2d0 [ttm]
[ 17.217505] ? ttm_resource_move_to_lru_tail+0x1ab/0x1d0 [ttm]
[ 17.217511] radeon_bo_unref+0x1a/0x30 [radeon]
[ 17.217547] radeon_gem_object_free+0x20/0x30 [radeon]
[ 17.217579] radeon_fbdev_fb_destroy+0x57/0x90 [radeon]
[ 17.217616] unregister_framebuffer+0x72/0x110
[ 17.217620] drm_client_dev_unregister+0x6d/0xe0
[ 17.217623] drm_dev_unregister+0x2e/0x90
[ 17.217626] drm_put_dev+0x26/0x90
[ 17.217628] pci_device_remove+0x44/0xc0
[ 17.217631] really_probe+0x257/0x340
[ 17.217635] __driver_probe_device+0x73/0x120
[ 17.217638] driver_probe_device+0x2c/0xb0
[ 17.217641] __driver_attach+0xa0/0x150
[ 17.217643] ? __pfx___driver_attach+0x10/0x10
[ 17.217646] bus_for_each_dev+0x67/0xa0
[ 17.217649] bus_add_driver+0x10e/0x210
[ 17.217651] driver_register+0x5c/0x120
[ 17.217653] ? __pfx_radeon_module_init+0x10/0x10 [radeon]
[ 17.217681] do_one_initcall+0x44/0x220
[ 17.217684] ? kmalloc_trace+0x37/0xc0
[ 17.217688] do_init_module+0x64/0x240
[ 17.217691] __do_sys_finit_module+0xb2/0x100
[ 17.217694] do_syscall_64+0x3b/0x90
[ 17.217697] entry_SYSCALL_64_after_hwframe+0x72/0xdc
[ 17.217700] RIP: 0033:0x7f319feaa5a9
[ 17.217702] Code: 08 89 e8 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 27 08 0d 00 f7 d8 64 89 01 48
[ 17.217706] RSP: 002b:00007ffc6bf3e7f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[ 17.217709] RAX: ffffffffffffffda RBX: 00005607204f3170 RCX: 00007f319feaa5a9
[ 17.217710] RDX: 0000000000000000 RSI: 00007f31a002eefd RDI: 0000000000000018
[ 17.217712] RBP: 00007f31a002eefd R08: 0000000000000000 R09: 00005607204f1860
[ 17.217714] R10: 0000000000000018 R11: 0000000000000246 R12: 0000000000020000
[ 17.217716] R13: 0000000000000000 R14: 0000560720522450 R15: 0000560720255899
[ 17.217718] </TASK>
[ 17.217719] ---[ end trace 0000000000000000 ]---
The buffer object backing the fbdev emulation got pinned twice: by the
fb_probe helper radeon_fbdev_create_pinned_object() and the modesetting
code when the framebuffer got displayed. It only got unpinned once by
the fbdev helper radeon_fbdev_destroy_pinned_object(). Hence TTM's BO-
release function complains about the pin counter. Forcing the outputs
off also undoes the modesettings pin increment.
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Reported-by: Borislav Petkov <bp@alien8.de>
Closes: https://lore.kernel.org/dri-devel/20230603174814.GCZHt83pN+wNjf63sC@fat_crate.local/
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: e317a69fe8 ("drm/radeon: Implement client-based fbdev emulation")
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2023-06-13 17:08:11 -04:00
..
2022-06-21 17:54:53 -04:00
2022-02-07 13:04:25 -08:00
2020-11-16 15:56:34 -05:00
2023-01-18 09:25:31 +01:00
2022-04-25 11:17:45 +02:00
2023-03-01 22:37:25 -05:00
2022-12-15 12:18:19 -05:00
2020-11-16 15:56:35 -05:00
2022-04-11 13:50:35 -04:00
2022-09-13 14:32:58 -04:00
2022-04-26 11:43:51 -04:00
2020-11-16 15:56:35 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00
2022-04-19 13:58:32 -04:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2022-06-20 23:53:55 +03:00
2021-05-25 23:47:24 -04:00
2023-03-01 17:18:19 +01:00
2020-11-13 00:11:53 -05:00
2023-03-31 11:18:42 -04:00
2020-11-16 15:56:34 -05:00
2022-06-06 14:43:41 -04:00
2020-11-16 15:56:34 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:34 -05:00
2021-05-13 10:45:15 -04:00
2022-06-20 23:53:55 +03:00
2022-06-23 17:21:49 -04:00
2023-01-18 09:25:31 +01:00
2021-06-22 16:51:45 -04:00
2021-06-22 16:51:45 -04:00
2022-09-13 14:52:14 -04:00
2020-11-16 15:56:34 -05:00
2021-09-23 15:17:28 -04:00
2020-11-16 15:56:35 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2023-01-13 13:13:57 +01:00
2021-05-10 15:46:50 +02:00
2023-01-18 09:25:31 +01:00
2021-05-25 23:47:30 -04:00
2022-11-04 16:05:53 -04:00
2020-11-16 15:56:34 -05:00
2022-11-10 15:29:00 -05:00
2020-11-16 15:56:33 -05:00
2022-11-29 11:03:38 -05:00
2021-01-06 15:43:46 +01:00
2023-01-18 09:25:31 +01:00
2022-10-27 11:42:58 +02:00
2023-01-16 15:04:13 +10:00
2020-11-16 15:56:33 -05:00
2023-03-31 11:18:42 -04:00
2023-01-18 10:00:03 +01:00
2023-03-31 11:18:42 -04:00
2023-03-31 11:18:42 -04:00
2023-01-18 09:25:31 +01:00
2023-06-13 17:08:11 -04:00
2021-09-14 09:25:30 +02:00
2021-05-19 22:32:24 -04:00
2023-06-07 17:00:20 -04:00
2021-01-06 15:43:46 +01:00
2023-03-01 17:18:19 +01:00
2023-05-24 15:11:15 -04:00
2023-03-31 11:18:42 -04:00
2021-08-10 20:13:49 +02:00
2023-01-18 09:25:31 +01:00
2023-01-18 09:25:31 +01:00
2020-11-16 15:56:33 -05:00
2023-01-18 09:25:31 +01:00
2022-04-07 12:53:54 +02:00
2023-03-31 11:18:42 -04:00
2022-10-27 11:42:58 +02:00
2023-03-01 17:18:19 +01:00
2022-12-06 10:28:12 +01:00
2020-11-16 15:56:33 -05:00
2022-12-06 12:54:14 +01:00
2020-11-16 15:56:35 -05:00
2021-02-18 16:43:10 -05:00
2023-03-01 17:18:19 +01:00
2023-03-01 17:18:19 +01:00
2022-05-03 16:08:48 +10:00
2022-10-27 11:42:58 +02:00
2023-02-23 10:29:20 +01:00
2021-05-26 20:56:29 +02:00
2022-04-07 12:53:54 +02:00
2021-12-14 16:11:02 -05:00
2022-04-06 17:38:25 +02:00
2023-03-31 11:18:42 -04:00
2021-06-22 16:51:45 -04:00
2022-06-20 23:53:55 +03:00
2021-06-22 16:51:45 -04:00
2021-01-06 15:43:46 +01:00
2021-06-22 16:51:45 -04:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:34 -05:00
2020-11-16 15:56:35 -05:00
2022-06-20 23:53:55 +03:00
2020-11-16 15:56:34 -05:00
2022-04-06 10:20:25 -04:00
2020-11-16 15:56:34 -05:00
2022-04-26 11:43:57 -04:00
2020-11-16 15:56:35 -05:00
2022-01-18 17:43:36 -05:00
2020-11-16 15:56:35 -05:00
2021-05-13 10:45:29 -04:00
2020-10-27 17:43:42 -04:00
2020-11-13 00:12:30 -05:00
2020-11-13 00:12:30 -05:00
2020-11-16 15:56:35 -05:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2021-02-18 16:43:09 -05:00
2020-11-16 15:56:35 -05:00
2020-11-16 15:56:35 -05:00