[BUG] v5.12: lockdep issue during hdcp_create_workspace() - key not registered
Brief summary of the problem:
A locking bug is occurring in kernel 5.12 during a call by hdcp_create_workqueue()
. This happens during every boot while the amdgpu driver is being probed.
Hardware description:
- CPU: AMD Ryzen 3 3200G CPU with integrated Radeon Vega 8 (Picasso) graphics
- System Board: Gigabyte B450M DS3H (rev. 1.x)
- System Memory: Corsair VENGEANCE LPX 16GB (4 x 4GB) DDR4 DRAM 2800MHz C16 Memory Kit
- Display(s): AOC Q3279VWF
- Type of Display Connection: DVI (display) to HDMI (system board) cable
System information:
- Distribution: Fedora 34
- Custom kernel: 5.12 mainline (vanilla), built from the Fedora/ARK packaging scripts, using the debug configuration for x86_64
- AMD package version: No package
How to reproduce the issue:
The bug appears in dmesg output during every boot. The stack trace has been decoded using scripts/decode_stacktrace.sh
— the line numbers below correspond to the v5.12 tag in Linus's tree (this is a vanilla kernel).
This is happening with the current release of linux-firmware (20210315), as well as the latest snapshot (which has newer amdgpu binaries).
Attached files:
[ 12.659179] BUG: key ffff9248900cd148 has not been registered!
[ 12.665429] ------------[ cut here ]------------
[ 12.670371] DEBUG_LOCKS_WARN_ON(1)
[ 12.670376] WARNING: CPU: 0 PID: 340 at lockdep_init_map_type (kernel/locking/lockdep.c:4687 (discriminator 7))
[ 12.684058] Modules linked in: amdgpu(+) drm_ttm_helper ttm crct10dif_pclmul crc32_pclmul crc32c_intel iommu_v2 r8169 nvme ghash_clmulni_intel gpu_sched i2c_algo_bit drm_kms_helper cec ccp nvme_core drm sp5100_tco wmi video pinctrl_amd fuse
[ 12.706792] CPU: 0 PID: 340 Comm: systemd-udevd Not tainted 5.12.0-2.vanilla.fc34.x86_64 #1
[ 12.715700] Hardware name: Gigabyte Technology Co., Ltd. B450M DS3H/B450M DS3H-CF, BIOS F61a 03/29/2021
<...>
[ 12.817369] Call Trace:
[ 12.819991] __kernfs_create_file (fs/kernfs/file.c:998)
[ 12.824581] sysfs_add_file_mode_ns (fs/sysfs/file.c:324)
[ 12.829334] ? init_timer_key (kernel/time/timer.c:816)
[ 12.833527] sysfs_create_bin_file (fs/sysfs/file.c:558)
[ 12.838115] hdcp_create_workqueue (drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:648) amdgpu
[ 12.843964] amdgpu_dm_init.isra.0.cold (drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1481) amdgpu
[ 12.850303] ? lock_acquire (kernel/locking/lockdep.c:437 kernel/locking/lockdep.c:5513 kernel/locking/lockdep.c:5476)
[ 12.854303] ? lock_is_held_type (kernel/locking/lockdep.c:5254 kernel/locking/lockdep.c:5550)
[ 12.858779] ? smum_send_msg_to_smc_with_parameter (drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smumgr.c:169) amdgpu
[ 12.865954] ? find_held_lock (kernel/locking/lockdep.c:5004)
[ 12.870065] ? smum_send_msg_to_smc_with_parameter (drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/smumgr.c:169) amdgpu
[ 12.877258] ? psp_set_srm (drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:396) amdgpu
[ 12.882124] ? hdcp_update_display (drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_hdcp.c:431) amdgpu
[ 12.887914] ? arch_jump_label_transform (arch/x86/kernel/jump_label.c:99)
[ 12.892945] ? sched_clock_cpu (kernel/sched/clock.c:371)
[ 12.897051] dm_hw_init (drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1712) amdgpu
[ 12.901526] amdgpu_device_init.cold (drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:295) amdgpu
[ 12.907703] ? _raw_spin_unlock_irqrestore (./arch/x86/include/asm/paravirt.h:658 ./arch/x86/include/asm/irqflags.h:145 ./include/linux/spinlock_api_smp.h:160 kernel/locking/spinlock.c:191)
[ 12.913015] amdgpu_driver_load_kms (drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:157 (discriminator 6)) amdgpu
[ 12.918773] amdgpu_pci_probe (drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:1221) amdgpu
<...>
[ 13.080685] irq event stamp: 473111
[ 13.084439] hardirqs last enabled at (473111): console_unlock (./arch/x86/include/asm/paravirt.h:658 (discriminator 1) ./arch/x86/include/asm/irqflags.h:145 (discriminator 1) kernel/printk/printk.c:2605 (discriminator 1))
[ 13.093750] hardirqs last disabled at (473110): console_unlock (kernel/printk/printk.c:2520 (discriminator 1))
[ 13.103033] softirqs last enabled at (472598): __irq_exit_rcu (kernel/softirq.c:221 kernel/softirq.c:422)
[ 13.112215] softirqs last disabled at (472593): __irq_exit_rcu (kernel/softirq.c:221 kernel/softirq.c:422)
[ 13.121412] ---[ end trace 30950ddb63448b6a ]---
Edited by David Ward