"Unpatched return thunk in use" in boot logs

Hello !

I started on CachyOS a week ago and I’ve had a lot of fun so far. I’ve been working on ArchLinux for a few years without really digging into the system, so I still consider myself a newcomer.

When I read the boot logs, I always see this error followed by a stack trace:

kernel: Unpatched return thunk in use. This should not happen!
kernel: WARNING: CPU: 5 PID: 648 at arch/x86/kernel/cpu/bugs.c:3023 __warn_thunk+0x2a/0x40

I don’t understand what the error is and what I need to do to solve the problem. Could anybody help me please?

hi,

This is just a warning. We are looking currnetly from where this is coming from. It wont have any functional issue.

Hello,

Thank you for your feedback.

The last line is a warning but the line above (Unpatched return thunk in use. This should not happen!) is an error. Here is the complete error log:

kernel: Unpatched return thunk in use. This should not happen!
kernel: WARNING: CPU: 10 PID: 571 at arch/x86/kernel/cpu/bugs.c:3023 __warn_thunk+0x2a/0x40
kernel: Modules linked in: snd_hda_codec_realtek(+) snd_soc_hda_codec(+) wl(POE+) snd_hda_codec_generic snd_hda_ext_core mac80211(+) >
kernel:  nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat nf_tables libcrc32c winesync(OE) pkcs8_key_parser i2c_dev crypto_user >
kernel: CPU: 10 PID: 571 Comm: (udev-worker) Tainted: P           OE      6.9.2-2-cachyos #1 26cbb0ec459a0fe5b31f88f86bb7a8f3d6e6830d
kernel: Hardware name: Gigabyte Technology Co., Ltd. Z790 AORUS ELITE AX/Z790 AORUS ELITE AX, BIOS F12a 05/15/2024
kernel: RIP: 0010:__warn_thunk+0x2a/0x40
kernel: Code: 66 0f 1f 00 0f 1f 44 00 00 80 3d e0 40 37 02 00 74 05 c3 cc cc cc cc 48 c7 c7 40 f8 24 87 c6 05 cb 40 37 02 01 e8 76 8e>
kernel: RSP: 0018:ffffacc402003928 EFLAGS: 00010282
kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
kernel: RDX: ffff9e34df921e88 RSI: 0000000000000001 RDI: ffff9e34df921e80
kernel: RBP: ffffacc402003978 R08: 00000000ffffdfff R09: ffff9e34fff79be8
kernel: R10: 00000000ffffdfff R11: 0000000000000003 R12: ffffffffc58adac1
kernel: R13: ffffacc4020039c0 R14: ffff9e2d50593500 R15: ffff9e2d6a6c62f0
kernel: FS:  00007aba5135c640(0000) GS:ffff9e34df900000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00007aba4ff5237b CR3: 0000000126b56000 CR4: 0000000000f50ef0
kernel: PKRU: 55555554
kernel: Call Trace:
kernel:  <TASK>
kernel:  ? __warn_thunk+0x2a/0x40
kernel:  ? __warn.cold+0x8e/0xf3
kernel:  ? __warn_thunk+0x2a/0x40
kernel:  ? report_bug+0xe7/0x200
kernel:  ? handle_bug+0x3c/0x80
kernel:  ? exc_invalid_op+0x19/0xc0
kernel:  ? asm_exc_invalid_op+0x1a/0x20
kernel:  ? __warn_thunk+0x2a/0x40
kernel:  ? __warn_thunk+0x2a/0x40
kernel:  warn_thunk_thunk+0x1a/0x30
kernel:  getvar+0x20/0x70 [wl 7dde08b510a863f0971f4821f30f5d98a7bea68e]
kernel:  ? orc_header+0x13b830/0x13b830 [wl 7dde08b510a863f0971f4821f30f5d98a7bea68e]
kernel:  wl_module_init+0x17/0xa0 [wl 7dde08b510a863f0971f4821f30f5d98a7bea68e]
kernel:  ? do_one_initcall+0x58/0x310
kernel:  ? do_init_module+0x60/0x220
kernel:  ? init_module_from_file+0x89/0xe0
kernel:  ? idempotent_init_module+0x121/0x2b0
kernel:  ? __x64_sys_finit_module+0x5e/0xb0
kernel:  ? do_syscall_64+0x83/0x190
kernel:  ? do_filp_open+0xc4/0x170
kernel:  ? __x64_sys_openat+0x1f5/0x230
kernel:  ? syscall_exit_to_user_mode+0x76/0x1f0
kernel:  ? do_syscall_64+0x8f/0x190
kernel:  ? nvme_irq+0x325/0x350 [nvme 66654b8097ee2e04d79f03f3bdc4aafbcb65034c]
kernel:  ? __pfx_nvme_pci_complete_batch+0x10/0x10 [nvme 66654b8097ee2e04d79f03f3bdc4aafbcb65034c]
kernel:  ? handle_irq_event+0x56/0x80
kernel:  ? sched_clock+0x10/0x30
kernel:  ? sched_clock_cpu+0xb/0x30
kernel:  ? irqtime_account_irq+0x3e/0xc0
kernel:  ? irq_exit_rcu+0x53/0xc0
kernel:  ? entry_SYSCALL_64_after_hwframe+0x76/0x7e
kernel:  </TASK>

I’m getting this error as well. I am actually trying to troubleshoot why a builtin Audio & HID device connected to USB port 6 internally on the mobo is having a “couldn’t find an input interrupt endpoint”

[Fri Jun  7 19:53:31 2024] CPU: 0 PID: 344 Comm: (udev-worker) Tainted: P           OE      6.9.3-3-cachyos #1 1a5e77d7b355623414c1078762262153474ab471
[Fri Jun  7 19:53:31 2024] Hardware name: INTEL Default string/IPC-ADN2L, BIOS 5.27 09/25/2023
[Fri Jun  7 19:53:31 2024] RIP: 0010:__warn_thunk+0x2a/0x40
[Fri Jun  7 19:53:31 2024] Code: 66 0f 1f 00 0f 1f 44 00 00 80 3d 00 47 37 02 00 74 05 c3 cc cc cc cc 48 c7 c7 f8 ed c3 83 c6 05 eb 46 37 02 01 e8 b6 90 06 00 <0f> 0b c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[Fri Jun  7 19:53:31 2024] RSP: 0018:ffffbbbc005df890 EFLAGS: 00010282
[Fri Jun  7 19:53:31 2024] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
[Fri Jun  7 19:53:31 2024] RDX: ffff943b6fa21a08 RSI: 0000000000000001 RDI: ffff943b6fa21a00
[Fri Jun  7 19:53:31 2024] RBP: ffffbbbc005df8e0 R08: 00000000ffffefff R09: ffffffff844b39a8
[Fri Jun  7 19:53:31 2024] R10: 00000000ffffefff R11: 0000000000000003 R12: ffffffffc20adac1
[Fri Jun  7 19:53:31 2024] R13: ffffbbbc005df928 R14: ffff943807ee2c00 R15: ffff9438004af110
[Fri Jun  7 19:53:31 2024] FS:  00007b53d8a14640(0000) GS:ffff943b6fa00000(0000) knlGS:0000000000000000
[Fri Jun  7 19:53:31 2024] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Fri Jun  7 19:53:31 2024] CR2: 00007ded72f748e0 CR3: 0000000101536000 CR4: 0000000000f50ef0
[Fri Jun  7 19:53:31 2024] PKRU: 55555554
[Fri Jun  7 19:53:31 2024] Call Trace:
[Fri Jun  7 19:53:31 2024]  <TASK>
[Fri Jun  7 19:53:31 2024]  ? __warn_thunk+0x2a/0x40
[Fri Jun  7 19:53:31 2024]  ? __warn.cold+0x8e/0xf3
[Fri Jun  7 19:53:31 2024]  ? __warn_thunk+0x2a/0x40
[Fri Jun  7 19:53:31 2024]  ? report_bug+0xe7/0x200
[Fri Jun  7 19:53:31 2024]  ? console_unlock+0x84/0x130
[Fri Jun  7 19:53:31 2024]  ? handle_bug+0x3c/0x80
[Fri Jun  7 19:53:31 2024]  ? exc_invalid_op+0x19/0xc0
[Fri Jun  7 19:53:31 2024]  ? asm_exc_invalid_op+0x1a/0x20
[Fri Jun  7 19:53:31 2024]  ? __warn_thunk+0x2a/0x40
[Fri Jun  7 19:53:31 2024]  warn_thunk_thunk+0x1a/0x30
[Fri Jun  7 19:53:31 2024]  getvar+0x20/0x70 [wl a5eeed223e9c453479d2637af3803fa5e7824bc5]
[Fri Jun  7 19:53:31 2024]  ? __UNIQUE_ID_vermagic478+0x4443b7f1a703/0x4443b7f1a703 [wl a5eeed223e9c453479d2637af3803fa5e7824bc5]
[Fri Jun  7 19:53:31 2024]  wl_module_init+0x17/0xa0 [wl a5eeed223e9c453479d2637af3803fa5e7824bc5]
[Fri Jun  7 19:53:31 2024]  ? do_one_initcall+0x58/0x310
[Fri Jun  7 19:53:31 2024]  ? do_init_module+0x60/0x220
[Fri Jun  7 19:53:31 2024]  ? init_module_from_file+0x89/0xe0
[Fri Jun  7 19:53:31 2024]  ? idempotent_init_module+0x121/0x2b0
[Fri Jun  7 19:53:31 2024]  ? __x64_sys_finit_module+0x5e/0xb0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x83/0x190
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? switch_fpu_return+0x4e/0xd0
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? __pfx_page_put_link+0x10/0x10
[Fri Jun  7 19:53:31 2024]  ? __x64_sys_openat+0x1f5/0x230
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? switch_fpu_return+0x4e/0xd0
[Fri Jun  7 19:53:31 2024]  ? syscall_exit_to_user_mode+0x76/0x1f0
[Fri Jun  7 19:53:31 2024]  ? do_syscall_64+0x8f/0x190
[Fri Jun  7 19:53:31 2024]  ? sched_clock+0x10/0x30
[Fri Jun  7 19:53:31 2024]  ? sched_clock_cpu+0xb/0x30
[Fri Jun  7 19:53:31 2024]  ? irqtime_account_irq+0x3e/0xc0
[Fri Jun  7 19:53:31 2024]  ? irq_exit_rcu+0x53/0xc0
[Fri Jun  7 19:53:31 2024]  ? entry_SYSCALL_64_after_hwframe+0x76/0x7e
[Fri Jun  7 19:53:31 2024]  </TASK>
[Fri Jun  7 19:53:31 2024] ---[ end trace 0000000000000000 ]---

and my endpoint error

[Fri Jun  7 19:53:43 2024] usb 1-6: new full-speed USB device number 13 using xhci_hcd
[Fri Jun  7 19:53:43 2024] usb 1-6: Device not responding to setup address.
[Fri Jun  7 19:53:43 2024] usb 1-6: Device not responding to setup address.
[Fri Jun  7 19:53:44 2024] usb 1-6: device not accepting address 13, error -71
[Fri Jun  7 19:53:44 2024] usb 1-6: WARN: invalid context state for evaluate context command.
[Fri Jun  7 21:21:12 2024] usbhid 1-6:1.3: couldn't find an input interrupt endpoint
[Fri Jun  7 21:21:29 2024] usb 1-6: USB disconnect, device number 47
[Fri Jun  7 21:21:29 2024] usb 1-6: new full-speed USB device number 48 using xhci_hcd
[Fri Jun  7 21:21:29 2024] usb 1-6: New USB device found, idVendor=0573, idProduct=1573, bcdDevice=80.07
[Fri Jun  7 21:21:29 2024] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Fri Jun  7 21:21:29 2024] usb 1-6: Product: USB Audio and HID
[Fri Jun  7 21:21:29 2024] usb 1-6: Manufacturer: CSCTEK
[Fri Jun  7 21:21:29 2024] usb 1-6: SerialNumber: A34004801402
[Fri Jun  7 21:21:29 2024] usb 1-6: Warning! Unlikely big volume range (=511), cval->res is probably wrong.
[Fri Jun  7 21:21:29 2024] usb 1-6: [5] FU [Mic Capture Volume] ch = 1, val = -8192/-1/16
[Fri Jun  7 21:21:29 2024] usb 1-6: Warning! Unlikely big volume range (=896), cval->res is probably wrong.
[Fri Jun  7 21:21:29 2024] usb 1-6: [6] FU [PCM Playback Volume] ch = 2, val = -16384/-2048/16
[Fri Jun  7 21:21:29 2024] usbhid 1-6:1.3: couldn't find an input interrupt endpoint

this endpoint error keep happening over and over again. As you can see I am up to device 47.

I am also seeing this error on the PCI bus (which I’m fairly confident that USB port 6 is connected to)

[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 0000000119586280 trb-start 0000000119586290 trb-end 0000000119586290 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 0000000119586290 trb-start 00000001195862a0 trb-end 00000001195862a0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862a0 trb-start 00000001195862b0 trb-end 00000001195862b0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862b0 trb-start 00000001195862c0 trb-end 00000001195862c0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862c0 trb-start 00000001195862d0 trb-end 00000001195862d0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862d0 trb-start 00000001195862e0 trb-end 00000001195862e0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862e0 trb-start 00000001195862f0 trb-end 00000001195862f0 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 00000001195862f0 trb-start 0000000119586300 trb-end 0000000119586300 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 0000000119586300 trb-start 0000000119586310 trb-end 0000000119586310 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 0000000119586310 trb-start 0000000119586320 trb-end 0000000119586320 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 1 comp_code 1
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: Looking for event-dma 0000000119586320 trb-start 0000000119586330 trb-end 0000000119586330 seg-start 0000000119586000 seg-end 0000000119586ff0
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 13 ep 1 with no TDs queued?
[Fri Jun  7 19:53:43 2024] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 13 ep 1 with no TDs queued?

I have extracted my ACPI tables and currently trying to see if I can fix but no luck so far. Think we need to raise with the kernel team.

my nuc specs are:

OS: CachyOS x86_64 
Host: Intel IPC-ADN2L 
Kernel: 6.9.3-3-cachyos 
Uptime: 1 hour, 46 mins 
Packages: 1082 (pacman) 
Shell: fish 3.7.1 
Resolution: 1920x1280 
Terminal: /dev/pts/1 
CPU: Intel N95 (4) @ 3.400GHz 
GPU: Intel Alder Lake-N [UHD Graphics] 
Memory: 1711MiB / 15767MiB 

dmesg

Hello there! Here’s my trace, for if it helps understanding the issue. Besides the log warnings, all systems are functional (thank you for your efforts!)

type or paste cod  kernel: Unpatched return thunk in use. This should not happen!
  kernel: Modules linked in: wl(POE+) snd_compress(+) mac80211(+) ac97_bus crct10dif_pclmul snd_pcm_dmaengine crc32_>
  kernel:  spi_intel_pci spi_intel xhci_pci_renesas nvme_auth vmd nvidia_drm(POE) nvidia_uvm(POE) nvidia_modeset(POE>
  kernel: CPU: 13 PID: 749 Comm: (udev-worker) Tainted: P           OE      6.9.3-4-cachyos #1 aa35fbc740c32fb981595>
  kernel: Hardware name: ASUS System Product Name/ROG MAXIMUS Z790 HERO, BIOS 1402 09/26/2023
  kernel: RIP: 0010:__warn_thunk+0x2a/0x40
  kernel: Code: 66 0f 1f 00 0f 1f 44 00 00 80 3d 00 47 37 02 00 74 05 c3 cc cc cc cc 48 c7 c7 10 ef c3 8f c6 05 eb 4>
  kernel: RSP: 0018:ffffae95826bb9a8 EFLAGS: 00010286
  kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
  kernel: RDX: ffff99c63f6a1a08 RSI: 0000000000000001 RDI: ffff99c63f6a1a00
  kernel: RBP: ffffae95826bb9f8 R08: 00000000ffffdfff R09: ffff99c67ff721a8
  kernel: R10: 00000000ffffdfff R11: 0000000000000003 R12: ffffffffc5a34ac1
  kernel: R13: ffffae95826bba40 R14: ffff99b6cdae8b00 R15: ffff99b6e6b82848
  kernel: FS:  00007ebeeb767640(0000) GS:ffff99c63f680000(0000) knlGS:0000000000000000
  kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  kernel: CR2: 00005eb167c94058 CR3: 0000000105df0000 CR4: 0000000000f50ef0
  kernel: PKRU: 55555554
  kernel: Call Trace:
  kernel:  <TASK>
  kernel:  ? __warn_thunk+0x2a/0x40
  kernel:  ? __warn.cold+0x8e/0xf3
  kernel:  ? __warn_thunk+0x2a/0x40
  kernel:  ? report_bug+0xe7/0x200
  kernel:  ? handle_bug+0x3c/0x80
  kernel:  ? exc_invalid_op+0x19/0xc0
  kernel:  ? asm_exc_invalid_op+0x1a/0x20
  kernel:  ? __warn_thunk+0x2a/0x40
  kernel:  ? __warn_thunk+0x2a/0x40
  kernel:  warn_thunk_thunk+0x1a/0x30
  kernel:  getvar+0x20/0x70 [wl 0715d27e622caacf4a9ace3272607f3b499ca2c8]
  kernel:  ? __UNIQUE_ID_vermagic478+0x516a3b348703/0x516a3b348703 [wl 0715d27e622caacf4a9ace3272607f3b499ca2c8]
  kernel:  wl_module_init+0x17/0xa0 [wl 0715d27e622caacf4a9ace3272607f3b499ca2c8]
  kernel:  ? do_one_initcall+0x58/0x310
  kernel:  ? do_init_module+0x60/0x220
  kernel:  ? init_module_from_file+0x89/0xe0
  kernel:  ? idempotent_init_module+0x121/0x2b0
  kernel:  ? __x64_sys_finit_module+0x5e/0xb0
  kernel:  ? do_syscall_64+0x83/0x190
  kernel:  ? switch_fpu_return+0x4e/0xd0
  kernel:  ? syscall_exit_to_user_mode+0x76/0x1f0
  kernel:  ? do_syscall_64+0x8f/0x190
  kernel:  ? do_filp_open+0xc4/0x170
  kernel:  ? __x64_sys_openat+0xc1/0x230
  kernel:  ? syscall_exit_to_user_mode+0x76/0x1f0
  kernel:  ? do_syscall_64+0x8f/0x190
  kernel:  ? switch_fpu_return+0x4e/0xd0
  kernel:  ? entry_SYSCALL_64_after_hwframe+0x76/0x7e
  kernel:  </TASK>e here