Xorg hanging during shutdown

If I select Restart from the UI menu then the desktop closes down quickly, reverts to text mode but then the system hangs up for a couple of minutes. The remnants of the boot sequence linger on screen during the wait. Eventually it starts displaying:

Jan 04 14:55:04 richard-desktop kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jan 04 14:55:04 richard-desktop kernel:       Tainted: P           OE     5.9.16-1-MANJARO #1
Jan 04 14:55:04 richard-desktop kernel: INFO: task Xorg:569 blocked for more than 122 seconds.

It does that a few times and then moves on.

NOTE: This only happens after I log in. If I trigger a restart from the login screen then reboot is very quick.

How can I investigate this further?

I tried looking at /var/log/Xorg.0.log and Xorg.1.log but these only seem to log the boot sequence, not the shutdown.

In journalctl, next to every hung_task_timeout_secs message appears this:

Jan 04 14:55:04 richard-desktop kernel: R13: 0000000000000001 R14: 0000000000000000 R15: 00007f2ea0de7900
Jan 04 14:55:04 richard-desktop kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
Jan 04 14:55:04 richard-desktop kernel: RBP: 00007ffe621be060 R08: 0000000000000001 R09: 000000007fffffff
Jan 04 14:55:04 richard-desktop kernel: RDX: 0000000000000002 RSI: 00007ffe621be060 RDI: 00000000ffffff9c
Jan 04 14:55:04 richard-desktop kernel: RAX: ffffffffffffffda RBX: 00007ffe621be0fc RCX: 00007f2ea1c47c1b
Jan 04 14:55:04 richard-desktop kernel: RSP: 002b:00007ffe621bdfc0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
Jan 04 14:55:04 richard-desktop kernel: RIP: 0033:0x7f2ea1c47c1b
Jan 04 14:55:04 richard-desktop kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jan 04 14:55:04 richard-desktop kernel:  do_syscall_64+0x33/0x40
Jan 04 14:55:04 richard-desktop kernel:  __x64_sys_openat+0x54/0x90
Jan 04 14:55:04 richard-desktop kernel:  do_sys_openat2+0xb1/0x160
Jan 04 14:55:04 richard-desktop kernel:  do_filp_open+0x9c/0x140
Jan 04 14:55:04 richard-desktop kernel:  path_openat+0xc1a/0x10b0
Jan 04 14:55:04 richard-desktop kernel:  do_dentry_open+0x14e/0x380
Jan 04 14:55:04 richard-desktop kernel:  ? cdev_device_add+0x90/0x90
Jan 04 14:55:04 richard-desktop kernel:  chrdev_open+0xca/0x240
Jan 04 14:55:04 richard-desktop kernel:  nvidia_frontend_open+0x53/0xa0 [nvidia]
Jan 04 14:55:04 richard-desktop kernel:  ? preempt_count_add+0x49/0xa0
Jan 04 14:55:04 richard-desktop kernel:  ? preempt_count_add+0x68/0xa0
Jan 04 14:55:04 richard-desktop kernel:  nvidia_open+0x1cf/0x530 [nvidia]
Jan 04 14:55:04 richard-desktop kernel:  down+0x3b/0x50
Jan 04 14:55:04 richard-desktop kernel:  ? preempt_count_add+0x68/0xa0
Jan 04 14:55:04 richard-desktop kernel:  __down+0x82/0xd0
Jan 04 14:55:04 richard-desktop kernel:  schedule_timeout+0x12d/0x170
Jan 04 14:55:04 richard-desktop kernel:  schedule+0x46/0xf0
Jan 04 14:55:04 richard-desktop kernel:  __schedule+0x292/0x830
Jan 04 14:55:04 richard-desktop kernel: Call Trace:
Jan 04 14:55:04 richard-desktop kernel: task:Xorg            state:D stack:    0 pid: 6059 ppid:     1 flags:0x00400084

I guess that might indicate an issue with the NVidia driver but I have no idea how to interpret it.

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.9.16-1-MANJARO
OS Type: 64-bit
Processors: 12 × Intel® Core™ i7-8700K CPU @ 3.70GHz
Memory: 31.3 GiB of RAM
Graphics Processor: GeForce GTX 1060 6GB/PCIe/SSE2

can you return

inxi -Fza --no-host
sudo mhwd-kernel -li
sudo mhwd -li
System:    Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 root=UUID=dac3fe26-c59b-4871-a8f7-9dae4fa59c8c rw apparmor=1 
           security=apparmor resume=UUID=c861ea2b-cb94-44ea-9ea9-a0b96bd0ddee udev.log_priority=3 
           Desktop: KDE Plasma 5.20.4 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop System: Gigabyte product: Z390 I AORUS PRO WIFI v: N/A serial: <filter> 
           Mobo: Gigabyte model: Z390 I AORUS PRO WIFI-CF v: x.x serial: <filter> UEFI: American Megatrends v: F5 
           date: 03/14/2019 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse serial: <filter> charge: 55% (should be ignored) 
           rechargeable: yes status: Discharging 
           Device-2: hidpp_battery_1 model: Logitech Wireless Solar Keyboard K750 serial: <filter> charge: 67% 
           rechargeable: yes status: Charging 
CPU:       Info: 6-Core model: Intel Core i7-8700K bits: 64 type: MT MCP arch: Kaby Lake note: check family: 6 
           model-id: 9E (158) stepping: A (10) microcode: DE L2 cache: 12 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 88824 
           Speed: 4300 MHz min/max: 800/4700 MHz Core speeds (MHz): 1: 4300 2: 4300 3: 4300 4: 4300 5: 4300 6: 4300 7: 4300 
           8: 4300 9: 4300 10: 4300 11: 4300 12: 4300 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling 
           Type: srbds mitigation: Microcode 
           Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable 
Graphics:  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] driver: nvidia v: 455.45.01 alternate: nouveau,nvidia_drm 
           bus ID: 01:00.0 chip ID: 10de:1c03 
           Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: nvidia display ID: :0 screens: 1 
           Screen-1: 0 s-res: 5120x1440 s-dpi: 80 s-size: 1626x457mm (64.0x18.0") s-diag: 1689mm (66.5") 
           Monitor-1: DP-2 res: 5120x1440 dpi: 130048 size: 1x1mm (0.0x0.0") diag: 1mm (0.1") 
           OpenGL: renderer: GeForce GTX 1060 6GB/PCIe/SSE2 v: 4.6.0 NVIDIA 455.45.01 direct render: Yes 
Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: Gigabyte driver: snd_hda_intel v: kernel 
           alternate: snd_soc_skl,snd_sof_pci bus ID: 00:1f.3 chip ID: 8086:a348 
           Device-2: NVIDIA GP106 High Definition Audio driver: snd_hda_intel v: kernel bus ID: 01:00.1 chip ID: 10de:10f1 
           Device-3: KYE Systems (Mouse Systems) PC-LM1E Camera type: USB driver: snd-usb-audio,uvcvideo bus ID: 1-5:4 
           chip ID: 0458:6006 serial: <filter> 
           Device-4: Logitech [G533 Wireless Headset Dongle] type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-3:12 
           chip ID: 046d:0a66 
           Sound Server: ALSA v: k5.9.16-1-MANJARO 
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel bus ID: 00:14.3 chip ID: 8086:a370 
           IF: wlo1 state: down mac: <filter> 
           Device-2: Intel Ethernet I219-V vendor: Gigabyte driver: e1000e v: kernel port: efa0 bus ID: 00:1f.6 
           chip ID: 8086:15bc 
           IF: eno2 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IF-ID-1: docker0 state: down mac: <filter> 
           IF-ID-2: ppp0 state: unknown speed: N/A duplex: N/A mac: N/A 
Drives:    Local Storage: total: 2.26 TiB used: 1.66 TiB (73.5%) 
           SMART Message: Required tool smartctl not installed. Check --recommends 
           ID-1: /dev/sda maj-min: 8:0 vendor: SanDisk model: SDSSDHII480G size: 447.13 GiB block size: physical: 512 B 
           logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 00RL 
           ID-2: /dev/sdb maj-min: 8:16 vendor: Crucial model: CT2000MX500SSD1 size: 1.82 TiB block size: physical: 4096 B 
           logical: 512 B speed: 6.0 Gb/s serial: <filter> rev: 023 
Partition: ID-1: / raw size: 395.5 GiB size: 388.29 GiB (98.18%) used: 75 GiB (19.3%) fs: ext4 dev: /dev/sda4 maj-min: 8:4 
           ID-2: /boot/efi raw size: 100 MiB size: 98.4 MiB (98.45%) used: 266 KiB (0.3%) fs: vfat dev: /dev/sda2 maj-min: 8:2 
           ID-3: /home raw size: 1.72 TiB size: 1.7 TiB (98.37%) used: 1.57 TiB (92.4%) fs: ext4 dev: /dev/sdb3 maj-min: 8:19 
Swap:      Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 32 GiB used: 2.5 MiB (0.0%) priority: -2 dev: /dev/sda3 maj-min: 8:3 
Sensors:   System Temperatures: cpu: 57.0 C mobo: 27.8 C gpu: nvidia temp: 42 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 28% 
Info:      Processes: 349 Uptime: 16h 31m wakeups: 198 Memory: 31.3 GiB used: 11.84 GiB (37.8%) Init: systemd v: 247 
           Compilers: gcc: 10.2.0 clang: 11.0.0 Packages: 1810 pacman: 1806 lib: 511 flatpak: 4 Shell: Bash v: 5.1.0 
           running in: konsole inxi: 3.2.01 

Currently running: 5.9.16-1-MANJARO (linux59)
The following kernels are installed in your system:
   * linux510
   * linux54
   * linux59

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
          video-nvidia            2020.11.30               false            PCI


Warning: No installed USB configs!

@stephane are you still about?

have you checked this with
boot linux5.4 or linux510 ?

possible that came from drivers nvidia > 450 series
why have you video-linux driver installed ?

press Esc to Get grub on boot
or change on /etc/default/grub
GRUB_TIMEOUT_STYLE=menu

sudo nano /etc/default/grub ( Ctrl+X to save )
sudo update-grub

510 of the kernel doesn’t boot properly for me. That’s why I’ve stuck with 5.9 for now. I’ve actually had this issue for a while so it’s possible I had it on 5.4. Installing now and will re-test.

Why would you think that NVidia >450 might be the issue?

I have video-linux installed because the last time I tried to remove, everything broke!

Not sure why you’re asking me to change the grub menu style.

Good shout on the kernel. 5.4 seems to work as expected.
Where do you think is the best place to report the bug? The Manjaro, KDE or Kernel bug tracker?