BYT: RPM raw-wakeref not held warn/backtrace with 5.11-rc1 (regression)
I was testing 5.11-rc1 on a Bay Trail based device (Lenovo Yoga Tablet 2 1051L) to see if another (non gfx) issue I was having was fixed. Because of this I had a serial console hooked up (over an USB tty) and I noticed the following backtrace on reboot:
[ 2670.787110] ------------[ cut here ]------------
[ 2670.795365] RPM raw-wakeref not held
[ 2670.802191] WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/i915/intel_runtime_pm.h:106 gen6_write32+0x145/0x1e0 [i915]
[ 2670.809296] Modules linked in: fuse rfcomm uhid cmac bnep pn544_mei mei_phy pn544 hci gpio_keys nfc intel_rapl_msr mei_hdcp intel_soc_dts_thermal intel_powerclamp coretemp kvm_intel iTCO_wdt intel_pmc_bxt brcmfmac iTCO_vendor_support brcmutil kvm cfg80211 irqbypass intel_cstate pcspkr vfat fat cdc_mbim snd_sof_acpi cdc_wdm snd_sof_intel_byt snd_sof_intel_bdw snd_sof_intel_ipc snd_sof cdc_ncm cdc_ether snd_sof_xtensa_dsp ledtrig_audio usbnet snd_intel_sst_acpi joydev snd_soc_acpi_intel_match mii snd_soc_acpi snd_intel_sst_core snd_soc_sst_atom_hifi2_platform snd_intel_dspcfg snd_soc_core hci_uart snd_hdmi_lpe_audio btqca btrtl btbcm snd_compress btintel ac97_bus snd_pcm_dmaengine snd_seq bluetooth processor_thermal_device processor_thermal_rfim processor_thermal_mbox soc_button_array snd_seq_device processor_thermal_rapl dptf_power intel_rapl_common int3406_thermal int3403_thermal int3400_thermal snd_pcm int340x_thermal_zone acpi_thermal_rel intel_soc_dts_iosf intel_int0002_vgpio
[ 2670.809816] acpi_pad spi_pxa2xx_platform snd_timer ecdh_generic rfkill_gpio mei_txe rfkill mei ecc snd lpc_ich dw_dmac soundcore zram ip_tables i915 mmc_block hid_multitouch crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel i2c_algo_bit drm_kms_helper cec drm video sdhci_acpi i2c_hid pwm_lpss_platform sdhci mmc_core pwm_lpss i2c_dev
[ 2670.863253] CPU: 1 PID: 1 Comm: systemd-shutdow Tainted: G W 5.11.0-rc1+ #19
[ 2670.871101] Hardware name: LENOVO 60073/INVALID, BIOS 01WT17WW 08/01/2014
[ 2670.878783] RIP: 0010:gen6_write32+0x145/0x1e0 [i915]
[ 2670.886423] Code: c0 97 e9 0f 0b e9 16 ff ff ff 80 3d a8 ef 23 00 00 0f 85 13 ff ff ff 48 c7 c7 7d d1 4a c0 c6 05 94 ef 23 00 01 e8 52 c0 97 e9 <0f> 0b e9 f9 fe ff ff 80 3d 80 ef 23 00 00 0f 85 f6 fe ff ff 48 c7
[ 2670.894148] RSP: 0018:ffffae4c00047d28 EFLAGS: 00010292
[ 2670.901791] RAX: 0000000000000018 RBX: ffff8e3187b40f10 RCX: 0000000000000040
[ 2670.909488] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000246
[ 2670.917178] RBP: 000000000004400c R08: 0000000000000001 R09: 0000000000000001
[ 2670.924868] R10: ffffae4c00047b58 R11: ffffffffaa961208 R12: 0000000000000000
[ 2670.932550] R13: 0000000000000000 R14: 00000000fee1dead R15: 0000000000000000
[ 2670.940244] FS: 00007fa537eebb80(0000) GS:ffff8e31faa80000(0000) knlGS:0000000000000000
[ 2670.948017] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2670.955763] CR2: 00007fa538f1f420 CR3: 0000000018c1a000 CR4: 00000000001006e0
[ 2670.963524] Call Trace:
[ 2670.971073] intel_irq_reset+0x42a/0x750 [i915]
[ 2670.978607] intel_runtime_pm_disable_interrupts+0xe/0x30 [i915]
[ 2670.986191] i915_driver_shutdown+0x38/0x90 [i915]
[ 2670.993752] pci_device_shutdown+0x34/0x60
[ 2671.001130] device_shutdown+0x160/0x1c0
[ 2671.008477] kernel_restart+0x36/0x60
[ 2671.015627] __do_sys_reboot+0x1d7/0x210
[ 2671.022598] ? finish_task_switch.isra.0+0xa0/0x2c0
[ 2671.029414] ? lockdep_hardirqs_on_prepare+0xff/0x180
[ 2671.036079] ? _raw_spin_unlock_irq+0x24/0x40
[ 2671.042701] ? _raw_spin_unlock_irq+0x24/0x40
[ 2671.049128] ? finish_task_switch.isra.0+0xa0/0x2c0
[ 2671.055380] ? finish_task_switch.isra.0+0x6a/0x2c0
[ 2671.061591] ? __schedule+0x375/0xaf0
[ 2671.067777] ? lockdep_hardirqs_on_prepare+0xff/0x180
[ 2671.073965] ? syscall_enter_from_user_mode+0x27/0x80
[ 2671.080158] do_syscall_64+0x33/0x40
[ 2671.086291] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 2671.092272] RIP: 0033:0x7fa538e52507
[ 2671.098052] Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 89 fa be 69 19 12 28 bf ad de e1 fe b8 a9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 41 b9 0c 00 f7 d8 64 89 02 b8
[ 2671.104270] RSP: 002b:00007ffd025425a8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a9
[ 2671.110293] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa538e52507
[ 2671.116140] RDX: 0000000001234567 RSI: 0000000028121969 RDI: 00000000fee1dead
[ 2671.121960] RBP: 00007ffd025427d0 R08: 0000000000001004 R09: 00007ffd025419a0
[ 2671.127784] R10: 00007ffd02541b60 R11: 0000000000000202 R12: 00007ffd02542638
[ 2671.133595] R13: 0000000000000000 R14: 0000000000000000 R15: 000055f57d024968
[ 2671.139473] irq event stamp: 4910857
[ 2671.145096] hardirqs last enabled at (4910867): [<ffffffffa9162669>] console_unlock+0x4e9/0x600
[ 2671.150691] hardirqs last disabled at (4910876): [<ffffffffa91625dc>] console_unlock+0x45c/0x600
[ 2671.156262] softirqs last enabled at (4910814): [<ffffffffa9e01112>] asm_call_irq_on_stack+0x12/0x20
[ 2671.161891] softirqs last disabled at (4910809): [<ffffffffa9e01112>] asm_call_irq_on_stack+0x12/0x20
[ 2671.167483] ---[ end trace 3be83c8ef5698183 ]---
[ 2671.172992] ------------[ cut here ]------------
[ 2671.178487] RPM wakelock ref not held during HW access
[ 2671.184110] WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/i915/intel_runtime_pm.h:114 gen6_write32+0x16c/0x1e0 [i915]
[ 2671.189965] Modules linked in: fuse rfcomm uhid cmac bnep pn544_mei mei_phy pn544 hci gpio_keys nfc intel_rapl_msr mei_hdcp intel_soc_dts_thermal intel_powerclamp coretemp kvm_intel iTCO_wdt intel_pmc_bxt brcmfmac iTCO_vendor_support brcmutil kvm cfg80211 irqbypass intel_cstate pcspkr vfat fat cdc_mbim snd_sof_acpi cdc_wdm snd_sof_intel_byt snd_sof_intel_bdw snd_sof_intel_ipc snd_sof cdc_ncm cdc_ether snd_sof_xtensa_dsp ledtrig_audio usbnet snd_intel_sst_acpi joydev snd_soc_acpi_intel_match mii snd_soc_acpi snd_intel_sst_core snd_soc_sst_atom_hifi2_platform snd_intel_dspcfg snd_soc_core hci_uart snd_hdmi_lpe_audio btqca btrtl btbcm snd_compress btintel ac97_bus snd_pcm_dmaengine snd_seq bluetooth processor_thermal_device processor_thermal_rfim processor_thermal_mbox soc_button_array snd_seq_device processor_thermal_rapl dptf_power intel_rapl_common int3406_thermal int3403_thermal int3400_thermal snd_pcm int340x_thermal_zone acpi_thermal_rel intel_soc_dts_iosf intel_int0002_vgpio
[ 2671.190457] acpi_pad spi_pxa2xx_platform snd_timer ecdh_generic rfkill_gpio mei_txe rfkill mei ecc snd lpc_ich dw_dmac soundcore zram ip_tables i915 mmc_block hid_multitouch crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel i2c_algo_bit drm_kms_helper cec drm video sdhci_acpi i2c_hid pwm_lpss_platform sdhci mmc_core pwm_lpss i2c_dev
[ 2671.235645] CPU: 1 PID: 1 Comm: systemd-shutdow Tainted: G W 5.11.0-rc1+ #19
[ 2671.242552] Hardware name: LENOVO 60073/INVALID, BIOS 01WT17WW 08/01/2014
[ 2671.249503] RIP: 0010:gen6_write32+0x16c/0x1e0 [i915]
[ 2671.256571] Code: c0 97 e9 0f 0b e9 f9 fe ff ff 80 3d 80 ef 23 00 00 0f 85 f6 fe ff ff 48 c7 c7 d8 f7 47 c0 c6 05 6c ef 23 00 01 e8 2b c0 97 e9 <0f> 0b e9 dc fe ff ff 48 8d 7b 30 be ff ff ff ff e8 4f e4 9d e9 85
[ 2671.263900] RSP: 0018:ffffae4c00047d28 EFLAGS: 00010292
[ 2671.271116] RAX: 000000000000002a RBX: ffff8e3187b40f10 RCX: 0000000000000040
[ 2671.278381] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000246
[ 2671.285641] RBP: 000000000004400c R08: 0000000000000001 R09: 0000000000000001
[ 2671.292895] R10: ffffae4c00047b58 R11: ffffffffaa961208 R12: 0000000000000000
[ 2671.300152] R13: 0000000000000000 R14: 00000000fee1dead R15: 0000000000000000
[ 2671.307408] FS: 00007fa537eebb80(0000) GS:ffff8e31faa80000(0000) knlGS:0000000000000000
[ 2671.314671] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2671.321748] CR2: 00007fa538f1f420 CR3: 0000000018c1a000 CR4: 00000000001006e0
[ 2671.328690] Call Trace:
[ 2671.335414] intel_irq_reset+0x42a/0x750 [i915]
[ 2671.342137] intel_runtime_pm_disable_interrupts+0xe/0x30 [i915]
[ 2671.348701] i915_driver_shutdown+0x38/0x90 [i915]
[ 2671.355094] pci_device_shutdown+0x34/0x60
[ 2671.361165] device_shutdown+0x160/0x1c0
[ 2671.367156] kernel_restart+0x36/0x60
[ 2671.373090] __do_sys_reboot+0x1d7/0x210
[ 2671.379009] ? finish_task_switch.isra.0+0xa0/0x2c0
[ 2671.384788] ? lockdep_hardirqs_on_prepare+0xff/0x180
[ 2671.390399] ? _raw_spin_unlock_irq+0x24/0x40
[ 2671.395974] ? _raw_spin_unlock_irq+0x24/0x40
[ 2671.401530] ? finish_task_switch.isra.0+0xa0/0x2c0
[ 2671.407099] ? finish_task_switch.isra.0+0x6a/0x2c0
[ 2671.412643] ? __schedule+0x375/0xaf0
[ 2671.418168] ? lockdep_hardirqs_on_prepare+0xff/0x180
[ 2671.423660] ? syscall_enter_from_user_mode+0x27/0x80
[ 2671.429164] do_syscall_64+0x33/0x40
[ 2671.434602] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 2671.440031] RIP: 0033:0x7fa538e52507
[ 2671.445450] Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 89 fa be 69 19 12 28 bf ad de e1 fe b8 a9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 8b 15 41 b9 0c 00 f7 d8 64 89 02 b8
[ 2671.451296] RSP: 002b:00007ffd025425a8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a9
[ 2671.457081] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa538e52507
[ 2671.462873] RDX: 0000000001234567 RSI: 0000000028121969 RDI: 00000000fee1dead
[ 2671.468680] RBP: 00007ffd025427d0 R08: 0000000000001004 R09: 00007ffd025419a0
[ 2671.474509] R10: 00007ffd02541b60 R11: 0000000000000202 R12: 00007ffd02542638
[ 2671.480328] R13: 0000000000000000 R14: 0000000000000000 R15: 000055f57d024968
[ 2671.486198] irq event stamp: 4912097
[ 2671.491985] hardirqs last enabled at (4912107): [<ffffffffa9162669>] console_unlock+0x4e9/0x600
[ 2671.497902] hardirqs last disabled at (4912116): [<ffffffffa91625dc>] console_unlock+0x45c/0x600
[ 2671.503833] softirqs last enabled at (4912018): [<ffffffffa9e01112>] asm_call_irq_on_stack+0x12/0x20
[ 2671.509808] softirqs last disabled at (4912135): [<ffffffffa9e01112>] asm_call_irq_on_stack+0x12/0x20
[ 2671.515779] ---[ end trace 3be83c8ef5698184 ]---
This did not happen when I was testing 5.10.0 (and 5.10.2), so this is a regression in 5.11-rc1. I guess this may be fixed by the "drm/i915: Disable outputs during unregister" commit currently in drm-intel-next: https://cgit.freedesktop.org/drm-intel/commit/?h=drm-intel-next&id=9d8fddf8579a2a20d0e8a8b631547069a62b953e
I did not test drm-intel-next. I decided to file a bug anyways because even if this is fixed in drm-intel-next it still needs to be fixed in 5.11.