Subject: loading amd-pstate-ut kernel module crashes with PREEMPT_RT

From: Bert Karwatzki <[email-masked]>
Date: Thu, 31 Jul 2025 11:23:15 +0200

When loading the amd-pstate-ut kernel module (which is supposed to test
the amd-pstate cpufreq driver) the following crash occurs (most of the 
time the loading has to be repeated several times):

Log from 6.16.0 with PREEMPT_RT (captured via netconsole):
Jul 30 19:11:59 localhost 15,1193,53902050,-,caller=T3076;netconsole-setup: Test log message to verify netconsole configuration.
Jul 30 19:12:07 localhost 6,1194,62487297,-,caller=T3115;amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid\x09 success!
Jul 30 19:12:07 localhost 6,1195,62487302,-,caller=T3115;amd_pstate_ut: 2    amd_pstate_ut_check_enabled\x09 success!
Jul 30 19:12:07 localhost 6,1196,62487507,-,caller=T3115;amd_pstate_ut: 3    amd_pstate_ut_check_perf\x09 success!
Jul 30 19:12:07 localhost 6,1197,62487510,-,caller=T3115;amd_pstate_ut: 4    amd_pstate_ut_check_freq\x09 success!
Jul 30 19:12:08 localhost 6,1198,63369470,-,caller=T3115;amd_pstate_ut: 5    amd_pstate_ut_check_driver\x09 success!
Jul 30 19:12:12 localhost 6,1199,67167450,-,caller=T3118;amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid\x09 success!
Jul 30 19:12:12 localhost 6,1200,67167455,-,caller=T3118;amd_pstate_ut: 2    amd_pstate_ut_check_enabled\x09 success!
Jul 30 19:12:12 localhost 6,1201,67167687,-,caller=T3118;amd_pstate_ut: 3    amd_pstate_ut_check_perf\x09 success!
Jul 30 19:12:12 localhost 6,1202,67167691,-,caller=T3118;amd_pstate_ut: 4    amd_pstate_ut_check_freq\x09 success!
Jul 30 19:12:13 localhost 6,1203,68061094,-,caller=T3118;amd_pstate_ut: 5    amd_pstate_ut_check_driver\x09 success!
Jul 30 19:12:15 localhost 6,1204,69813892,-,caller=T3120;amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid\x09 success!
Jul 30 19:12:15 localhost 6,1205,69813896,-,caller=T3120;amd_pstate_ut: 2    amd_pstate_ut_check_enabled\x09 success!
Jul 30 19:12:15 localhost 6,1206,69814122,-,caller=T3120;amd_pstate_ut: 3    amd_pstate_ut_check_perf\x09 success!
Jul 30 19:12:15 localhost 6,1207,69814126,-,caller=T3120;amd_pstate_ut: 4    amd_pstate_ut_check_freq\x09 success!
Jul 30 19:12:16 localhost 3,1208,70350248,-,caller=T0;BUG: scheduling while atomic: swapper/4/0/0x00000005
Jul 30 19:12:16 localhost 3,1209,70350250,-,caller=T0;BUG: scheduling while atomic: swapper/0/0/0x00000005
Jul 30 19:12:16 localhost 4,1210,70350253,-,caller=T0;Modules linked in:
Jul 30 19:12:16 localhost 4,1211,70350255,-,caller=T0;Modules linked in: amd_pstate_ut(+)
Jul 30 19:12:16 localhost 4,1212,70350256,c,caller=T0; amd_pstate_ut(+) netconsole
Jul 30 19:12:16 localhost 4,1213,70350259,c,caller=T0; netconsole ccm
Jul 30 19:12:16 localhost 4,1214,70350260,c,caller=T0; ccm snd_seq_dummy
Jul 30 19:12:16 localhost 4,1215,70350263,c,caller=T0; snd_seq_dummy snd_hrtimer
Jul 30 19:12:16 localhost 4,1216,70350264,c,caller=T0; snd_hrtimer snd_seq_midi
Jul 30 19:12:16 localhost 4,1217,70350265,c,caller=T0; snd_seq_midi snd_seq_midi_event snd_seq_midi_event
Jul 30 19:12:16 localhost 4,1218,70350266,c,caller=T0; snd_rawmidi snd_rawmidi
Jul 30 19:12:16 localhost 4,1219,70350267,c,caller=T0; snd_seq snd_seq
Jul 30 19:12:16 localhost 4,1220,70350269,c,caller=T0; snd_seq_device snd_seq_device
Jul 30 19:12:16 localhost 4,1221,70350270,c,caller=T0; rfcomm bnep rfcomm nls_ascii bnep
Jul 30 19:12:16 localhost 4,1222,70350273,c,caller=T0; nls_cp437 vfat
Jul 30 19:12:16 localhost 4,1223,70350275,c,caller=T0; nls_ascii fat
Jul 30 19:12:16 localhost 4,1224,70350276,c,caller=T0; nls_cp437 snd_ctl_led
Jul 30 19:12:16 localhost 4,1225,70350278,c,caller=T0; vfat snd_hda_codec_realtek
Jul 30 19:12:16 localhost 4,1226,70350279,c,caller=T0; fat snd_hda_codec_generic
Jul 30 19:12:16 localhost 4,1227,70350280,c,caller=T0; snd_ctl_led snd_hda_scodec_component
Jul 30 19:12:16 localhost 4,1228,70350281,c,caller=T0; snd_hda_codec_realtek
Jul 30 19:12:16 localhost 4,1229,70350281,c,caller=T0; snd_hda_codec_hdmi
Jul 30 19:12:16 localhost 4,1230,70350283,c,caller=T0; snd_hda_codec_generic btusb
Jul 30 19:12:16 localhost 4,1231,70350283,c,caller=T0; snd_hda_scodec_component snd_hda_codec_hdmi
Jul 30 19:12:16 localhost 4,1232,70350283,c,caller=T0; btrtl btintel
Jul 30 19:12:16 localhost 4,1233,70350285,c,caller=T0; btusb btrtl snd_hda_intel btintel btbcm snd_hda_intel btmtk
Jul 30 19:12:16 localhost 4,1234,70350289,c,caller=T0; btbcm snd_intel_dspcfg
Jul 30 19:12:16 localhost 4,1235,70350290,c,caller=T0; btmtk snd_intel_dspcfg
Jul 30 19:12:16 localhost 4,1236,70350290,c,caller=T0; snd_hda_codec
Jul 30 19:12:16 localhost 4,1237,70350292,c,caller=T0; snd_hda_codec snd_acp3x_pdm_dma snd_acp3x_pdm_dma snd_soc_dmic snd_soc_dmic snd_acp3x_rn
Jul 30 19:12:16 localhost 4,1238,70350295,c,caller=T0; snd_acp3x_rn uvcvideo uvcvideo snd_hwdep snd_hwdep videobuf2_vmalloc
Jul 30 19:12:16 localhost 4,1239,70350297,c,caller=T0; videobuf2_vmalloc videobuf2_memops videobuf2_memops bluetooth bluetooth snd_soc_core
Jul 30 19:12:16 localhost 4,1240,70350300,c,caller=T0; snd_soc_core snd_hda_core
Jul 30 19:12:16 localhost 4,1241,70350301,c,caller=T0; snd_hda_core uvc
Jul 30 19:12:16 localhost 4,1242,70350302,c,caller=T0; uvc videobuf2_v4l2
Jul 30 19:12:16 localhost 4,1243,70350302,c,caller=T0; videobuf2_v4l2 snd_pcm_oss
Jul 30 19:12:16 localhost 4,1244,70350304,c,caller=T0; snd_pcm_oss videodev
Jul 30 19:12:16 localhost 4,1245,70350304,c,caller=T0; videodev snd_mixer_oss
Jul 30 19:12:16 localhost 4,1246,70350307,c,caller=T0; snd_mixer_oss snd_pcm
Jul 30 19:12:16 localhost 4,1247,70350307,c,caller=T0; snd_pcm snd_rn_pci_acp3x
Jul 30 19:12:16 localhost 4,1248,70350309,c,caller=T0; snd_rn_pci_acp3x snd_acp_config
Jul 30 19:12:16 localhost 4,1249,70350309,c,caller=T0; snd_acp_config videobuf2_common
Jul 30 19:12:16 localhost 4,1250,70350311,c,caller=T0; videobuf2_common snd_timer
Jul 30 19:12:16 localhost 4,1251,70350311,c,caller=T0; snd_timer snd_soc_acpi
Jul 30 19:12:16 localhost 4,1252,70350313,c,caller=T0; snd_soc_acpi msi_wmi
Jul 30 19:12:16 localhost 4,1253,70350313,c,caller=T0; msi_wmi ecdh_generic
Jul 30 19:12:16 localhost 4,1254,70350315,c,caller=T0; ecdh_generic ecc
Jul 30 19:12:16 localhost 4,1255,70350316,c,caller=T0; ecc mc
Jul 30 19:12:16 localhost 4,1256,70350316,c,caller=T0; mc sparse_keymap
Jul 30 19:12:16 localhost 4,1257,70350319,c,caller=T0; sparse_keymap wmi_bmof
Jul 30 19:12:16 localhost 4,1258,70350318,c,caller=T0; wmi_bmof edac_mce_amd
Jul 30 19:12:16 localhost 4,1259,70350321,c,caller=T0; edac_mce_amd snd
Jul 30 19:12:16 localhost 4,1260,70350321,c,caller=T0; snd k10temp
Jul 30 19:12:16 localhost 4,1261,70350322,c,caller=T0; k10temp ccp
Jul 30 19:12:16 localhost 4,1262,70350324,c,caller=T0; ccp soundcore
Jul 30 19:12:16 localhost 4,1263,70350324,c,caller=T0; soundcore snd_pci_acp3x
Jul 30 19:12:16 localhost 4,1264,70350326,c,caller=T0; snd_pci_acp3x ac
Jul 30 19:12:16 localhost 4,1265,70350327,c,caller=T0; ac battery
Jul 30 19:12:16 localhost 4,1266,70350327,c,caller=T0; battery button
Jul 30 19:12:16 localhost 4,1267,70350329,c,caller=T0; button joydev
Jul 30 19:12:16 localhost 4,1268,70350329,c,caller=T0; joydev hid_sensor_prox
Jul 30 19:12:16 localhost 4,1269,70350332,c,caller=T0; hid_sensor_prox hid_sensor_magn_3d
Jul 30 19:12:16 localhost 4,1270,70350333,c,caller=T0; hid_sensor_magn_3d hid_sensor_accel_3d
Jul 30 19:12:16 localhost 4,1271,70350334,c,caller=T0; hid_sensor_accel_3d hid_sensor_gyro_3d
Jul 30 19:12:16 localhost 4,1272,70350335,c,caller=T0; hid_sensor_gyro_3d hid_sensor_als
Jul 30 19:12:16 localhost 4,1273,70350336,c,caller=T0; hid_sensor_als hid_sensor_trigger
Jul 30 19:12:16 localhost 4,1274,70350336,c,caller=T0; hid_sensor_trigger evdev
Jul 30 19:12:16 localhost 4,1275,70350338,c,caller=T0; evdev industrialio_triggered_buffer
Jul 30 19:12:16 localhost 4,1276,70350338,c,caller=T0; industrialio_triggered_buffer kfifo_buf
Jul 30 19:12:16 localhost 4,1277,70350339,c,caller=T0; kfifo_buf industrialio
Jul 30 19:12:16 localhost 4,1278,70350342,c,caller=T0; industrialio amd_pmc
Jul 30 19:12:16 localhost 4,1279,70350342,c,caller=T0; amd_pmc hid_sensor_iio_common
Jul 30 19:12:16 localhost 4,1280,70350344,c,caller=T0; hid_sensor_iio_common mt7921e
Jul 30 19:12:16 localhost 4,1281,70350344,c,caller=T0; mt7921e mt7921_common
Jul 30 19:12:16 localhost 4,1282,70350345,c,caller=T0; mt7921_common mt792x_lib
Jul 30 19:12:16 localhost 4,1283,70350346,c,caller=T0; mt792x_lib mt76_connac_lib
Jul 30 19:12:16 localhost 4,1284,70350348,c,caller=T0; mt76_connac_lib mt76
Jul 30 19:12:16 localhost 4,1285,70350348,c,caller=T0; mt76 mac80211
Jul 30 19:12:16 localhost 4,1286,70350349,c,caller=T0; mac80211 libarc4
Jul 30 19:12:16 localhost 4,1287,70350351,c,caller=T0; libarc4 cfg80211
Jul 30 19:12:16 localhost 4,1288,70350351,c,caller=T0; cfg80211 rfkill
Jul 30 19:12:16 localhost 4,1289,70350353,c,caller=T0; rfkill msr
Jul 30 19:12:16 localhost 4,1290,70350353,c,caller=T0; msr fuse
Jul 30 19:12:16 localhost 4,1291,70350355,c,caller=T0; fuse nvme_fabrics
Jul 30 19:12:16 localhost 4,1292,70350356,c,caller=T0; nvme_fabrics efi_pstore
Jul 30 19:12:16 localhost 4,1293,70350355,c,caller=T0; efi_pstore configfs
Jul 30 19:12:16 localhost 4,1294,70350357,c,caller=T0; configfs efivarfs
Jul 30 19:12:16 localhost 4,1295,70350357,c,caller=T0; efivarfs autofs4
Jul 30 19:12:16 localhost 4,1296,70350358,c,caller=T0; autofs4 ext4
Jul 30 19:12:16 localhost 4,1297,70350360,c,caller=T0; ext4 mbcache
Jul 30 19:12:16 localhost 4,1298,70350360,c,caller=T0; mbcache jbd2
Jul 30 19:12:16 localhost 4,1299,70350362,c,caller=T0; jbd2 usbhid
Jul 30 19:12:16 localhost 4,1300,70350362,c,caller=T0; usbhid amdgpu
Jul 30 19:12:16 localhost 4,1301,70350365,c,caller=T0; amdgpu drm_client_lib
Jul 30 19:12:16 localhost 4,1302,70350364,c,caller=T0; drm_client_lib i2c_algo_bit
Jul 30 19:12:16 localhost 4,1303,70350366,c,caller=T0; i2c_algo_bit drm_ttm_helper
Jul 30 19:12:16 localhost 4,1304,70350366,c,caller=T0; drm_ttm_helper ttm
Jul 30 19:12:16 localhost 4,1305,70350368,c,caller=T0; ttm drm_panel_backlight_quirks
Jul 30 19:12:16 localhost 4,1306,70350368,c,caller=T0; drm_panel_backlight_quirks drm_exec
Jul 30 19:12:16 localhost 4,1307,70350370,c,caller=T0; drm_exec drm_suballoc_helper
Jul 30 19:12:16 localhost 4,1308,70350369,c,caller=T0; drm_suballoc_helper cec
Jul 30 19:12:16 localhost 4,1309,70350371,c,caller=T0; cec xhci_pci
Jul 30 19:12:16 localhost 4,1310,70350371,c,caller=T0; xhci_pci amdxcp
Jul 30 19:12:16 localhost 4,1311,70350373,c,caller=T0; amdxcp drm_buddy
Jul 30 19:12:16 localhost 4,1312,70350372,c,caller=T0; drm_buddy hid_sensor_hub
Jul 30 19:12:16 localhost 4,1313,70350373,c,caller=T0; hid_sensor_hub xhci_hcd
Jul 30 19:12:16 localhost 4,1314,70350375,c,caller=T0; xhci_hcd mfd_core
Jul 30 19:12:16 localhost 4,1315,70350374,c,caller=T0; mfd_core gpu_sched
Jul 30 19:12:16 localhost 4,1316,70350376,c,caller=T0; gpu_sched hid_multitouch
Jul 30 19:12:16 localhost 4,1317,70350377,c,caller=T0; hid_multitouch hid_generic
Jul 30 19:12:16 localhost 4,1318,70350378,c,caller=T0; hid_generic psmouse
Jul 30 19:12:16 localhost 4,1319,70350377,c,caller=T0; psmouse drm_display_helper
Jul 30 19:12:16 localhost 4,1320,70350379,c,caller=T0; drm_display_helper i2c_hid_acpi
Jul 30 19:12:16 localhost 4,1321,70350380,c,caller=T0; i2c_hid_acpi usbcore
Jul 30 19:12:16 localhost 4,1322,70350380,c,caller=T0; usbcore amd_sfh
Jul 30 19:12:16 localhost 4,1323,70350381,c,caller=T0; amd_sfh nvme
Jul 30 19:12:16 localhost 4,1324,70350382,c,caller=T0; nvme i2c_hid
Jul 30 19:12:16 localhost 4,1325,70350383,c,caller=T0; i2c_hid drm_kms_helper
Jul 30 19:12:16 localhost 4,1326,70350382,c,caller=T0; drm_kms_helper hid
Jul 30 19:12:16 localhost 4,1327,70350384,c,caller=T0; hid serio_raw
Jul 30 19:12:16 localhost 4,1328,70350384,c,caller=T0; serio_raw r8169
Jul 30 19:12:16 localhost 4,1329,70350384,c,caller=T0; r8169 nvme_core
Jul 30 19:12:16 localhost 4,1330,70350386,c,caller=T0; nvme_core crc16
Jul 30 19:12:16 localhost 4,1331,70350387,c,caller=T0; crc16 usb_common
Jul 30 19:12:16 localhost 4,1332,70350388,c,caller=T0; usb_common i2c_piix4
Jul 30 19:12:16 localhost 4,1333,70350387,c,caller=T0; i2c_piix4 i2c_smbus
Jul 30 19:12:16 localhost 4,1334,70350389,c,caller=T0; i2c_smbus i2c_designware_platform
Jul 30 19:12:16 localhost 4,1335,70350389,c,caller=T0; i2c_designware_platform i2c_designware_core
Jul 30 19:12:16 localhost 4,1336,70350391,c,caller=T0; i2c_designware_core [last unloaded: amd_pstate_ut]
Jul 30 19:12:16 localhost 4,1337,70350390,c,caller=T0; [last unloaded: amd_pstate_ut]
Jul 30 19:12:16 localhost 4,1338,70350391,c,caller=T0; 
Jul 30 19:12:16 localhost 3,1339,70350392,-,caller=T0;Preemption disabled at:
Jul 30 19:12:16 localhost 3,1340,70350393,-,caller=T0;Preemption disabled at:
Jul 30 19:12:16 localhost 3,1341,70350393,-,caller=T0;[<ffffffffac32438d>] schedule_preempt_disabled+0x1d/0x30
Jul 30 19:12:16 localhost 3,1342,70350392,-,caller=T0;[<ffffffffabaccd27>] migrate_enable+0x87/0xf0
Jul 30 19:12:16 localhost 4,1343,70350399,-,caller=T0;CPU: 4 UID: 0 PID: 0 Comm: swapper/4 Not tainted 6.16.0-stable #856 PREEMPT_{RT,(full)} 
Jul 30 19:12:16 localhost 4,1344,70350401,-,caller=T0;Hardware name: Micro-Star International Co., Ltd. Alpha 15 B5EEK/MS-158L, BIOS E158LAMS.10F 11/11/2024
Jul 30 19:12:16 localhost 4,1345,70350403,-,caller=T0;Call Trace:
Jul 30 19:12:16 localhost 4,1346,70350405,-,caller=T0; <IRQ>
Jul 30 19:12:16 localhost 4,1347,70350407,-,caller=T0; dump_stack_lvl+0x4b/0x70
Jul 30 19:12:16 localhost 4,1348,70350410,-,caller=T0; ? migrate_enable+0x87/0xf0
Jul 30 19:12:16 localhost 4,1349,70350412,-,caller=T0; __schedule_bug.cold+0x73/0x80
Jul 30 19:12:16 localhost 4,1350,70350415,-,caller=T0; __schedule+0xf8a/0x1340
Jul 30 19:12:16 localhost 4,1351,70350417,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1352,70350419,-,caller=T0; ? migrate_enable+0xca/0xf0
Jul 30 19:12:16 localhost 4,1353,70350421,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1354,70350423,-,caller=T0; ? rt_read_unlock+0x2f/0x1a0
Jul 30 19:12:16 localhost 4,1355,70350424,-,caller=T0; ? rt_read_lock+0x40/0xf0
Jul 30 19:12:16 localhost 4,1356,70350426,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1357,70350428,-,caller=T0; schedule_rtlock+0x21/0x40
Jul 30 19:12:16 localhost 4,1358,70350431,-,caller=T0; rtlock_slowlock_locked+0x316/0xed0
Jul 30 19:12:16 localhost 4,1359,70350433,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1360,70350435,-,caller=T0; ? sched_clock_cpu+0x62/0x1e0
Jul 30 19:12:16 localhost 4,1361,70350439,-,caller=T0; rt_read_lock+0x86/0xf0
Jul 30 19:12:16 localhost 4,1362,70350441,-,caller=T0; cpufreq_cpu_get+0x1c/0x70
Jul 30 19:12:16 localhost 4,1363,70350445,-,caller=T0; amd_pstate_update+0x30/0xf0
Jul 30 19:12:16 localhost 4,1364,70350448,-,caller=T0; amd_pstate_adjust_perf+0xd4/0x100
Jul 30 19:12:16 localhost 4,1365,70350450,-,caller=T0; sugov_update_single_perf+0x102/0x180
Jul 30 19:12:16 localhost 4,1366,70350453,-,caller=T0; update_load_avg+0x6d1/0x6e0
Jul 30 19:12:16 localhost 4,1367,70350456,-,caller=T0; enqueue_entity+0x31/0x320
Jul 30 19:12:16 localhost 4,1368,70350458,-,caller=T0; enqueue_task_fair+0x123/0x660
Jul 30 19:12:16 localhost 4,1369,70350460,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1370,70350462,-,caller=T0; ? profile_tick+0x2f/0x70
Jul 30 19:12:16 localhost 4,1371,70350464,-,caller=T0; enqueue_task+0x30/0x110
Jul 30 19:12:16 localhost 4,1372,70350467,-,caller=T0; ttwu_do_activate+0x6a/0x1b0
Jul 30 19:12:16 localhost 4,1373,70350470,-,caller=T0; try_to_wake_up+0x292/0x4e0
Jul 30 19:12:16 localhost 4,1374,70350472,-,caller=T0; __irq_exit_rcu+0xd9/0x120
Jul 30 19:12:16 localhost 4,1375,70350475,-,caller=T0; sysvec_apic_timer_interrupt+0x8d/0xb0
Jul 30 19:12:16 localhost 4,1376,70350478,-,caller=T0; </IRQ>
Jul 30 19:12:16 localhost 4,1377,70350479,-,caller=T0; <TASK>
Jul 30 19:12:16 localhost 4,1378,70350480,-,caller=T0; asm_sysvec_apic_timer_interrupt+0x1a/0x20
Jul 30 19:12:16 localhost 4,1379,70350482,-,caller=T0;RIP: 0010:cpuidle_enter_state+0xab/0x2b0
Jul 30 19:12:16 localhost 4,1380,70350484,-,caller=T0;Code: 45 40 40 0f 84 0a 01 00 00 e8 e1 05 7d ff e8 9c f2 ff ff 31 ff 49 89 c5 e8 d2 16 7c ff 45 84 ff 0f 85 e1 00 00 00 fb 45 85 f6 <0f> 88 c1 00 00 00 48 8b 04 24 49 63 f6 48 6b ce 68 49 29 c5 48 89
Jul 30 19:12:16 localhost 4,1381,70350485,-,caller=T0;RSP: 0018:fffface4801d7e78 EFLAGS: 00000202
Jul 30 19:12:16 localhost 4,1382,70350487,-,caller=T0;RAX: ffff8b26f194b000 RBX: ffff8b23c5942800 RCX: 0000001061336233
Jul 30 19:12:16 localhost 4,1383,70350488,-,caller=T0;RDX: 0000001061336233 RSI: ffffffffac6b1014 RDI: ffffffffac6b2e6e
Jul 30 19:12:16 localhost 4,1384,70350489,-,caller=T0;RBP: 0000000000000001 R08: 0000000000000000 R09: 000001d1a94a2000
Jul 30 19:12:16 localhost 4,1385,70350490,-,caller=T0;R10: 0000000000000003 R11: 00000000000019a9 R12: ffffffffac8c7a20
Jul 30 19:12:16 localhost 4,1386,70350491,-,caller=T0;R13: 0000001061336233 R14: 0000000000000001 R15: 0000000000000000
Jul 30 19:12:16 localhost 4,1387,70350494,-,caller=T0; ? cpuidle_enter_state+0x9e/0x2b0
Jul 30 19:12:16 localhost 4,1388,70350496,-,caller=T0; cpuidle_enter+0x28/0x40
Jul 30 19:12:16 localhost 4,1389,70350499,-,caller=T0; do_idle+0x1c2/0x240
Jul 30 19:12:16 localhost 4,1390,70350502,-,caller=T0; cpu_startup_entry+0x24/0x30
Jul 30 19:12:16 localhost 4,1391,70350503,-,caller=T0; start_secondary+0x112/0x130
Jul 30 19:12:16 localhost 4,1392,70350506,-,caller=T0; common_startup_64+0x13e/0x148
Jul 30 19:12:16 localhost 4,1393,70350511,-,caller=T0; </TASK>
Jul 30 19:12:16 localhost 4,1394,70350514,-,caller=T0;CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G        W           6.16.0-stable #856 PREEMPT_{RT,(full)} 
Jul 30 19:12:16 localhost 4,1395,70350517,-,caller=T0;Tainted: [W]=WARN
Jul 30 19:12:16 localhost 4,1396,70350517,-,caller=T0;Hardware name: Micro-Star International Co., Ltd. Alpha 15 B5EEK/MS-158L, BIOS E158LAMS.10F 11/11/2024
Jul 30 19:12:16 localhost 4,1397,70350518,-,caller=T0;Call Trace:
Jul 30 19:12:16 localhost 4,1398,70350519,-,caller=T0; <IRQ>
Jul 30 19:12:16 localhost 4,1399,70350521,-,caller=T0; dump_stack_lvl+0x4b/0x70
Jul 30 19:12:16 localhost 4,1400,70350523,-,caller=T0; ? schedule_preempt_disabled+0x1d/0x30
Jul 30 19:12:16 localhost 4,1401,70350525,-,caller=T0; __schedule_bug.cold+0x73/0x80
Jul 30 19:12:16 localhost 4,1402,70350527,-,caller=T0; __schedule+0xf8a/0x1340
Jul 30 19:12:16 localhost 4,1403,70350529,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1404,70350530,-,caller=T0; ? migrate_enable+0xca/0xf0
Jul 30 19:12:16 localhost 4,1405,70350533,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1406,70350534,-,caller=T0; ? rt_read_unlock+0x2f/0x1a0
Jul 30 19:12:16 localhost 4,1407,70350536,-,caller=T0; ? rt_read_lock+0x40/0xf0
Jul 30 19:12:16 localhost 4,1408,70350537,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1409,70350540,-,caller=T0; schedule_rtlock+0x21/0x40
Jul 30 19:12:16 localhost 4,1410,70350541,-,caller=T0; rtlock_slowlock_locked+0x316/0xed0
Jul 30 19:12:16 localhost 4,1411,70350544,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1412,70350545,-,caller=T0; ? sched_clock_cpu+0x62/0x1e0
Jul 30 19:12:16 localhost 4,1413,70350549,-,caller=T0; rt_read_lock+0x86/0xf0
Jul 30 19:12:16 localhost 4,1414,70350551,-,caller=T0; cpufreq_cpu_get+0x1c/0x70
Jul 30 19:12:16 localhost 4,1415,70350553,-,caller=T0; amd_pstate_update+0x30/0xf0
Jul 30 19:12:16 localhost 4,1416,70350556,-,caller=T0; amd_pstate_adjust_perf+0xd4/0x100
Jul 30 19:12:16 localhost 4,1417,70350558,-,caller=T0; sugov_update_single_perf+0x102/0x180
Jul 30 19:12:16 localhost 4,1418,70350560,-,caller=T0; update_load_avg+0x6d1/0x6e0
Jul 30 19:12:16 localhost 4,1419,70350563,-,caller=T0; enqueue_entity+0x31/0x320
Jul 30 19:12:16 localhost 4,1420,70350565,-,caller=T0; enqueue_task_fair+0x123/0x660
Jul 30 19:12:16 localhost 4,1421,70350567,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 19:12:16 localhost 4,1422,70350569,-,caller=T0; ? profile_tick+0x2f/0x70
Jul 30 19:12:16 localhost 4,1423,70350571,-,caller=T0; enqueue_task+0x30/0x110
Jul 30 19:12:16 localhost 4,1424,70350573,-,caller=T0; ttwu_do_activate+0x6a/0x1b0
Jul 30 19:12:16 localhost 4,1425,70350575,-,caller=T0; try_to_wake_up+0x292/0x4e0
Jul 30 19:12:16 localhost 4,1426,70350578,-,caller=T0; __irq_exit_rcu+0xd9/0x120
Jul 30 19:12:16 localhost 4,1427,70350580,-,caller=T0; sysvec_apic_timer_interrupt+0x8d/0xb0
Jul 30 19:12:16 localhost 4,1428,70350583,-,caller=T0; </IRQ>
Jul 30 19:12:16 localhost 4,1429,70350583,-,caller=T0; <TASK>
Jul 30 19:12:16 localhost 4,1430,70350584,-,caller=T0; asm_sysvec_apic_timer_interrupt+0x1a/0x20
Jul 30 19:12:16 localhost 4,1431,70350586,-,caller=T0;RIP: 0010:cpuidle_enter_state+0xab/0x2b0
Jul 30 19:12:16 localhost 4,1432,70350587,-,caller=T0;Code: 45 40 40 0f 84 0a 01 00 00 e8 e1 05 7d ff e8 9c f2 ff ff 31 ff 49 89 c5 e8 d2 16 7c ff 45 84 ff 0f 85 e1 00 00 00 fb 45 85 f6 <0f> 88 c1 00 00 00 48 8b 04 24 49 63 f6 48 6b ce 68 49 29 c5 48 89
Jul 30 19:12:16 localhost 4,1433,70350589,-,caller=T0;RSP: 0018:ffffffffac803e20 EFLAGS: 00000202
Jul 30 19:12:16 localhost 4,1434,70350590,-,caller=T0;RAX: ffff8b26f184b000 RBX: ffff8b23c2206c00 RCX: 000000106133622a
Jul 30 19:12:16 localhost 4,1435,70350591,-,caller=T0;RDX: 000000106133622a RSI: ffffffffac6b1014 RDI: ffffffffac6b2e6e
Jul 30 19:12:16 localhost 4,1436,70350592,-,caller=T0;RBP: 0000000000000001 R08: 0000000000000000 R09: 000001d1a94a2000
Jul 30 19:12:16 localhost 4,1437,70350593,-,caller=T0;R10: 0000000000000003 R11: 000000000000189a R12: ffffffffac8c7a20
Jul 30 19:12:16 localhost 4,1438,70350594,-,caller=T0;R13: 000000106133622a R14: 0000000000000001 R15: 0000000000000000
Jul 30 19:12:16 localhost 4,1439,70350597,-,caller=T0; cpuidle_enter+0x28/0x40
Jul 30 19:12:16 localhost 4,1440,70350599,-,caller=T0; do_idle+0x1c2/0x240
Jul 30 19:12:16 localhost 4,1441,70350602,-,caller=T0; cpu_startup_entry+0x24/0x30
Jul 30 19:12:16 localhost 4,1442,70350603,-,caller=T0; rest_init+0xb8/0xc0
Jul 30 19:12:16 localhost 4,1443,70350605,-,caller=T0; start_kernel+0x896/0x8a0
Jul 30 19:12:16 localhost 4,1444,70350609,-,caller=T0; x86_64_start_reservations+0x24/0x30
Jul 30 19:12:16 localhost 4,1445,70350612,-,caller=T0; x86_64_start_kernel+0xc6/0xd0
Jul 30 19:12:16 localhost 4,1446,70350614,-,caller=T0; common_startup_64+0x13e/0x148
Jul 30 19:12:16 localhost 4,1447,70350618,-,caller=T0; </TASK>
Jul 30 19:12:16 localhost 4,1448,71444259,-,caller=C11;[drm] Fence fallback timer expired on ring comp_1.1.0
Jul 30 19:12:16 localhost 4,1449,71452256,-,caller=C11;[drm] Fence fallback timer expired on ring sdma0
Jul 30 19:12:17 localhost 4,1450,71948258,-,caller=C10;[drm] Fence fallback timer expired on ring comp_1.1.0
Jul 30 19:12:17 localhost 4,1451,72453257,-,caller=C14;[drm] Fence fallback timer expired on ring comp_1.1.0
Jul 30 19:12:18 localhost 4,1452,72956257,-,caller=C12;[drm] Fence fallback timer expired on ring comp_1.1.0
Jul 30 19:12:18 localhost 4,1453,72956262,-,caller=C2;[drm] Fence fallback timer expired on ring gfx
Jul 30 19:12:18 localhost 4,1454,73460258,-,caller=C14;[drm] Fence fallback timer expired on ring gfx
Jul 30 19:12:19 localhost 4,1455,73964256,-,caller=C12;[drm] Fence fallback timer expired on ring gfx
Jul 30 19:12:19 localhost 4,1456,74468255,-,caller=C14;[drm] Fence fallback timer expired on ring gfx
Jul 30 19:12:20 localhost 4,1457,75198257,-,caller=C15;[drm] Fence fallback timer expired on ring gfx

Log from 6.16.0 with PREEMPT_RT and CONFIG_LOCKDEP (captured via netconsole):
Jul 30 23:15:25 localhost 15,1253,92127003,-,caller=T3190;netconsole-setup: Test log message to verify netconsole configuration.
Jul 30 23:15:28 localhost 6,1254,95294787,-,caller=T3228;amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid\x09 success!
Jul 30 23:15:28 localhost 6,1255,95294791,-,caller=T3228;amd_pstate_ut: 2    amd_pstate_ut_check_enabled\x09 success!
Jul 30 23:15:28 localhost 6,1256,95295373,-,caller=T3228;amd_pstate_ut: 3    amd_pstate_ut_check_perf\x09 success!
Jul 30 23:15:28 localhost 6,1257,95295383,-,caller=T3228;amd_pstate_ut: 4    amd_pstate_ut_check_freq\x09 success!
Jul 30 23:15:28 localhost 4,1258,95314275,-,caller=T0; 
Jul 30 23:15:28 localhost 4,1259,95314277,-,caller=T0;============================= 
Jul 30 23:15:28 localhost 4,1260,95314278,-,caller=T0;[ BUG: Invalid wait context ]
Jul 30 23:15:28 localhost 4,1261,95314279,-,caller=T0;6.16.0-lockdep #861 Not tainted
Jul 30 23:15:28 localhost 4,1262,95314280,-,caller=T0;----------------------------- 
Jul 30 23:15:28 localhost 4,1263,95314281,-,caller=T0;swapper/0/0 is trying to lock:
Jul 30 23:15:28 localhost 4,1264,95314282,c,caller=T0;ffffffffa5f763e8 (cpufreq_driver_lock){++++}-{3:3}, at: cpufreq_cpu_get+0x1c/0x70
Jul 30 23:15:28 localhost 4,1265,95314291,-,caller=T0;other info that might help us debug this:
Jul 30 23:15:28 localhost 4,1266,95314291,-,caller=T0;context-{2: 2}
Jul 30 23:15:28 localhost 4,1267,95314292,-,caller=T0;2 locks held by swapper/0/0:
Jul 30 23:15:28 localhost 4,1268,95314294,-,caller=T0; #0: ffff941800808958 (&p->pi_lock){-...}-{2:2}, at: try_to_wake_up+0x61/0x880
Jul 30 23:15:28 localhost 4,1269,95314301,-,caller=T0; #1: ffff941ade62bd58 (&rq->__lock){-...}-{2:2}, at: raw_spin_rq_lock_nested+0x23/0x80
Jul 30 23:15:28 localhost 4,1270,95314306,-,caller=T0;stack backtrace:
Jul 30 23:15:28 localhost 4,1271,95314308,-,caller=T0;CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.16.0-lockdep #861 PREEMPT_{RT,(full)} 
Jul 30 23:15:28 localhost 4,1272,95314311,-,caller=T0;Hardware name: Micro-Star International Co., Ltd. Alpha 15 B5EEK/MS-158L, BIOS E158LAMS.10F 11/11/2024
Jul 30 23:15:28 localhost 4,1273,95314312,-,caller=T0;Call Trace:
Jul 30 23:15:28 localhost 4,1274,95314314,-,caller=T0; <IRQ>
Jul 30 23:15:28 localhost 4,1275,95314315,-,caller=T0; dump_stack_lvl+0x5b/0x80
Jul 30 23:15:28 localhost 4,1276,95314320,-,caller=T0; __lock_acquire+0xf82/0x2620
Jul 30 23:15:28 localhost 4,1277,95314325,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 23:15:28 localhost 4,1278,95314327,-,caller=T0; ? __lock_acquire+0x48a/0x2620
Jul 30 23:15:28 localhost 4,1279,95314331,-,caller=T0; lock_acquire+0xca/0x2d0
Jul 30 23:15:28 localhost 4,1280,95314334,-,caller=T0; ? cpufreq_cpu_get+0x1c/0x70
Jul 30 23:15:28 localhost 4,1281,95314337,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 23:15:28 localhost 4,1282,95314341,-,caller=T0; rt_read_lock+0x56/0x2f0
Jul 30 23:15:28 localhost 4,1283,95314345,-,caller=T0; ? cpufreq_cpu_get+0x1c/0x70
Jul 30 23:15:28 localhost 4,1284,95314347,-,caller=T0; ? srso_alias_return_thunk+0x5/0xfbef5
Jul 30 23:15:28 localhost 4,1285,95314350,-,caller=T0; cpufreq_cpu_get+0x1c/0x70
Jul 30 23:15:28 localhost 4,1286,95314352,-,caller=T0; amd_pstate_adjust_perf+0x1e/0x100
Jul 30 23:15:28 localhost 4,1287,95314354,-,caller=T0; ? sugov_get_util+0x34/0x90
Jul 30 23:15:28 localhost 4,1288,95314358,-,caller=T0; sugov_update_single_perf+0x102/0x180
Jul 30 23:15:28 localhost 4,1289,95314362,-,caller=T0; ? sugov_update_single_freq+0x230/0x230
Jul 30 23:15:28 localhost 4,1290,95314365,-,caller=T0; update_load_avg+0x876/0x8c0
Jul 30 23:15:28 localhost 4,1291,95314369,-,caller=T0; enqueue_entity+0x31/0x390
Jul 30 23:15:28 localhost 4,1292,95314373,-,caller=T0; enqueue_task_fair+0x120/0x830
Jul 30 23:15:28 localhost 4,1293,95314378,-,caller=T0; enqueue_task+0x30/0x160
Jul 30 23:15:28 localhost 4,1294,95314381,-,caller=T0; ttwu_do_activate+0x9c/0x320
Jul 30 23:15:28 localhost 4,1295,95314387,-,caller=T0; try_to_wake_up+0x2b6/0x880
Jul 30 23:15:28 localhost 4,1296,95314393,-,caller=T0; __irq_exit_rcu+0xe4/0x140
Jul 30 23:15:28 localhost 4,1297,95314397,-,caller=T0; irq_exit_rcu+0x9/0x30
Jul 30 23:15:28 localhost 4,1298,95314400,-,caller=T0; sysvec_call_function_single+0x8d/0xb0
Jul 30 23:15:28 localhost 4,1299,95314404,-,caller=T0; </IRQ>
Jul 30 23:15:28 localhost 4,1300,95314405,-,caller=T0; <TASK>
Jul 30 23:15:28 localhost 4,1301,95314407,-,caller=T0; asm_sysvec_call_function_single+0x1a/0x20
Jul 30 23:15:28 localhost 4,1302,95314410,-,caller=T0;RIP: 0010:cpuidle_enter_state+0x10a/0x530
Jul 30 23:15:28 localhost 4,1303,95314414,-,caller=T0;Code: 14 e5 00 48 0f a3 05 95 c5 8f 00 0f 82 b6 02 00 00 31 ff e8 98 0e 63 ff 45 84 ff 0f 85 9a 02 00 00 e8 4a aa 72 ff fb 45 85 f6 <0f> 88 e5 01 00 00 48 8b 04 24 49 63 ce 48 6b d1 68 49 29 c5 48 89
Jul 30 23:15:28 localhost 4,1304,95314416,-,caller=T0;RSP: 0018:ffffffffa5e03e20 EFLAGS: 00000202
Jul 30 23:15:28 localhost 4,1305,95314419,-,caller=T0;RAX: 000000000016dcc3 RBX: ffff941802124000 RCX: 0000000000000000
Jul 30 23:15:28 localhost 4,1306,95314421,-,caller=T0;RDX: 0000000000000000 RSI: ffffffffa5b5fdc6 RDI: ffffffffa5b4511d
Jul 30 23:15:28 localhost 4,1307,95314422,-,caller=T0;RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000000
Jul 30 23:15:28 localhost 4,1308,95314424,-,caller=T0;R10: 0000000000000001 R11: 0000000000020000 R12: ffffffffa5f4c880
Jul 30 23:15:28 localhost 4,1309,95314425,-,caller=T0;R13: 00000016312c553c R14: 0000000000000002 R15: 0000000000000000
Jul 30 23:15:28 localhost 4,1310,95314436,-,caller=T0; cpuidle_enter+0x28/0x40
Jul 30 23:15:28 localhost 4,1311,95314440,-,caller=T0; do_idle+0x1d5/0x260
Jul 30 23:15:28 localhost 4,1312,95314446,-,caller=T0; cpu_startup_entry+0x24/0x30
Jul 30 23:15:28 localhost 4,1313,95314450,-,caller=T0; rest_init+0x148/0x150
Jul 30 23:15:28 localhost 4,1314,95314453,-,caller=T0; start_kernel+0x92c/0x930
Jul 30 23:15:28 localhost 4,1315,95314462,-,caller=T0; x86_64_start_reservations+0x24/0x30
Jul 30 23:15:28 localhost 4,1316,95314465,-,caller=T0; x86_64_start_kernel+0xc6/0xd0
Jul 30 23:15:28 localhost 4,1317,95314468,-,caller=T0; common_startup_64+0x13e/0x148
Jul 30 23:15:28 localhost 4,1318,95314479,-,caller=T0; </TASK>

Log from 6.16.0 without PREEMPT_RT and with CONFIG_LOCKDEP (no crash occurs here):
[   27.272344] [   T2632] amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid	 success!
[   27.272355] [   T2632] amd_pstate_ut: 2    amd_pstate_ut_check_enabled	 success!
[   27.272637] [   T2632] amd_pstate_ut: 3    amd_pstate_ut_check_perf	 success!
[   27.272648] [   T2632] amd_pstate_ut: 4    amd_pstate_ut_check_freq	 success!

[   27.280572] [    T943] =============================
[   27.280575] [    T943] [ BUG: Invalid wait context ]
[   27.280578] [    T943] 6.16.0-nortlockdep #862 Not tainted
[   27.280582] [    T943] -----------------------------
[   27.280584] [    T943] mt76-tx phy0/943 is trying to lock:
[   27.280587] [    T943] ffffffff9055a678 (cpufreq_driver_lock){....}-{3:3}, at: cpufreq_cpu_get+0x1e/0x80
[   27.280600] [    T943] other info that might help us debug this:
[   27.280602] [    T943] context-{5:5}
[   27.280605] [    T943] 1 lock held by mt76-tx phy0/943:
[   27.280608] [    T943]  #0: ffff8a245e66ac58 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x23/0x80
[   27.280619] [    T943] stack backtrace:
[   27.280622] [    T943] CPU: 1 UID: 0 PID: 943 Comm: mt76-tx phy0 Not tainted 6.16.0-nortlockdep #862 PREEMPT(full) 
[   27.280625] [    T943] Hardware name: Micro-Star International Co., Ltd. Alpha 15 B5EEK/MS-158L, BIOS E158LAMS.10F 11/11/2024
[   27.280626] [    T943] Call Trace:
[   27.280627] [    T943]  <TASK>
[   27.280629] [    T943]  dump_stack_lvl+0x5b/0x80
[   27.280633] [    T943]  __lock_acquire+0xf82/0x2620
[   27.280637] [    T943]  ? srso_alias_return_thunk+0x5/0xfbef5
[   27.280640] [    T943]  ? __lock_acquire+0x48a/0x2620
[   27.280643] [    T943]  lock_acquire+0xca/0x2d0
[   27.280646] [    T943]  ? cpufreq_cpu_get+0x1e/0x80
[   27.280651] [    T943]  _raw_read_lock_irqsave+0x74/0x90
[   27.280654] [    T943]  ? cpufreq_cpu_get+0x1e/0x80
[   27.280656] [    T943]  cpufreq_cpu_get+0x1e/0x80
[   27.280658] [    T943]  amd_pstate_adjust_perf+0x1e/0x100
[   27.280660] [    T943]  ? sugov_get_util+0x34/0x90
[   27.280663] [    T943]  sugov_update_single_perf+0x102/0x180
[   27.280667] [    T943]  ? sugov_update_single_freq+0x230/0x230
[   27.280669] [    T943]  dequeue_task_rt+0xf3/0x230
[   27.280674] [    T943]  ? mt76_wcid_alloc+0x70/0x70 [mt76]
[   27.280679] [    T943]  __schedule+0x1b8/0x1810
[   27.280683] [    T943]  ? srso_alias_return_thunk+0x5/0xfbef5
[   27.280685] [    T943]  ? schedule+0xeb/0x120
[   27.280687] [    T943]  ? srso_alias_return_thunk+0x5/0xfbef5
[   27.280689] [    T943]  ? lock_release+0x175/0x2b0
[   27.280692] [    T943]  ? mt76_wcid_alloc+0x70/0x70 [mt76]
[   27.280697] [    T943]  schedule+0x38/0x120
[   27.280699] [    T943]  __mt76_worker_fn+0x8b/0x90 [mt76]
[   27.280705] [    T943]  kthread+0x109/0x200
[   27.280708] [    T943]  ? kthreads_online_cpu+0x100/0x100
[   27.280710] [    T943]  ret_from_fork+0x25a/0x2c0
[   27.280713] [    T943]  ? __switch_to+0x11b/0x560
[   27.280715] [    T943]  ? kthreads_online_cpu+0x100/0x100
[   27.280718] [    T943]  ret_from_fork_asm+0x11/0x20
[   27.280724] [    T943]  </TASK>
[   28.461993] [   T2632] amd_pstate_ut: 5    amd_pstate_ut_check_driver	 success!

The crash also occurs in versions 6.{13,14,15} when compiled with PREEMPT_RT

Bert Karwatzki