Skip to content

Kernel BUG() on Linux 6.8 with Clang 17+ and LTO, rt5640 audio fails #2017

@anh0516

Description

@anh0516

On a Dell Venue 8 Pro 5830, Linux 6.8 with Clang and LTO triggers a BUG() and the rt5640 audio driver to fail. This happens with the older driver and with the newer SOF driver forced with snd-intel-dspcfg.dsp_driver=3 on the kernel command line. It was fine on 6.7, but there were changes to the rt5640 driver in 6.8 that seem to have broken things. This happens with both clang 17 and 18, built from Arch Linux and from my Gentoo box, so that eliminates quite a few variables.

BUG: unable to handle page fault for address: 00000000ffffffff
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0 
Oops: 0000 [#1] PREEMPT SMP
CPU: 2 PID: 196 Comm: (udev-worker) Tainted: G         C         6.8.6-llvm #2
Hardware name: Dell Inc. Venue 8 Pro 5830/09RP78, BIOS A16 02/27/2018
RIP: 0010:strcmp+0x10/0x30
Code: 66 2e 0f 1f 84 00 00 00 00 00 0f b6 14 0e 88 14 08 48 ff c1 84 d2 75 f2 c3 cc 31 c0 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 <0f> b6 0c 07 0f b6 14 06 38 d1 75 0a 48 ff c0 84 c9 75 ed 31 c0 c3
RSP: 0018:ffffc900004bf778 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8880202e4428 RCX: ffff88800495a6a8
RDX: ffff88800495a6a8 RSI: ffffffffa09d0388 RDI: 00000000ffffffff
RBP: ffffc900004bf8c8 R08: 0000000000000000 R09: 0000000000000000
R10: ffff8880202e4400 R11: ffffffffa08cd03f R12: ffff88800378f600
R13: ffff88800495a400 R14: ffffffffa08e30a8 R15: ffff88800495a410
FS:  00007f979c6bd540(0000) GS:ffff888076900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000ffffffff CR3: 0000000003e2d000 CR4: 00000000001006f0
Call Trace:
 <TASK>
 ? __die_body+0x6d/0x120
 ? page_fault_oops+0x37d/0x470
 ? kernelmode_fixup_or_oops+0xf4/0x130
 ? do_user_addr_fault+0x19d/0x6e0
 ? exc_page_fault+0x47/0x70
 ? asm_exc_page_fault+0x22/0x30
 ? snd_byt_rt5640_mc_probe+0x3f/0xcb0 [snd_soc_sst_bytcr_rt5640]
 ? strcmp+0x10/0x30
 snd_byt_rt5640_mc_probe+0x70/0xcb0 [snd_soc_sst_bytcr_rt5640]
 ? idr_alloc_cyclic+0x16a/0x200
 ? kernfs_link_sibling+0xa8/0x190
 ? kernfs_add_one+0x2c0/0x360
 ? 0xffffffffa08cd000
 platform_probe+0x48/0xb0
 really_probe+0x1ce/0x400
 __driver_probe_device+0x146/0x250
 driver_probe_device+0x1e/0x230
 __driver_attach+0x13f/0x2f0
 ? driver_attach+0x20/0x20
 bus_for_each_dev+0x151/0x1e0
 bus_add_driver+0x1e5/0x2f0
 driver_register+0x71/0x170
 ? 0xffffffffa0832000
 do_one_initcall+0xe0/0x350
 ? idr_alloc_cyclic+0x16a/0x200
 ? kernfs_link_sibling+0xa8/0x190
 ? idr_alloc_cyclic+0x16a/0x200
 ? kernfs_link_sibling+0xa8/0x190
 ? kernfs_add_one+0x2c0/0x360
 ? __kernfs_create_file+0xa9/0xe0
 ? sysfs_create_bin_file+0xc4/0x100
 ? kobject_create_and_add+0x72/0xd0
 ? add_notes_attrs+0x190/0x200
 ? free_unref_page+0xa7/0x130
 ? load_module+0x18c3/0x1b20
 do_init_module+0x65/0x480
 __se_sys_finit_module+0x30f/0x480
 do_syscall_64+0x65/0x130
 ? exc_page_fault+0x47/0x70
 entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x7f979d28d15d
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d a3 ab 0d 00 f7 d8 64 89 01 48
RSP: 002b:00007fff65c87008 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 0000560b8e7d3530 RCX: 00007f979d28d15d
RDX: 0000000000000000 RSI: 00007f979d3ac2f0 RDI: 0000000000000018
RBP: 00007f979d3ac2f0 R08: 0000000000000000 R09: 0000560b8e872710
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000020000
R13: 0000560b8e86dd70 R14: 0000560b8e867b80 R15: 0000560b8e872950
 </TASK>
Modules linked in: snd_soc_sst_bytcr_rt5640(+) intel_soc_dts_thermal intel_soc_dts_iosf intel_powerclamp coretemp gpio_keys crct10dif_pclmul crc32_pclmul hid_multitouch hid_sensor_hub ath6kl_sdio(+) polyval_generic gf128mul ath6kl_core ghash_clmulni_intel aesni_intel crypto_simd snd_sof_acpi_intel_byt snd_sof_xtensa_dsp cryptd cfg80211 snd_sof_acpi snd_sof_intel_atom rfkill intel_cstate snd_sof snd_sof_utils intel_bytcrc_pwrsrc snd_intel_sst_acpi i915 snd_soc_acpi_intel_match snd_intel_sst_core snd_soc_sst_atom_hifi2_platform snd_soc_rt5640 snd_intel_dspcfg snd_soc_acpi snd_soc_rl6231 int3401_thermal i2c_algo_bit processor_thermal_device snd_soc_core drm_display_helper processor_thermal_power_floor processor_thermal_wt_hint snd_compress processor_thermal_wt_req drm_buddy ov5693 soc_button_array int3406_thermal dptf_power processor_thermal_rfim video atomisp_mt9m114(C) intel_gtt wmi snd_pcm processor_thermal_mbox v4l2_fwnode processor_thermal_rapl ttm backlight intel_rapl_common snd_timer v4l2_async
 atomisp_gmin_platform(C) vfat int3400_thermal int3403_thermal fat cec acpi_thermal_rel int340x_thermal_zone intel_int0002_vgpio snd videodev i2c_hid_acpi i2c_hid v4l2_cci mc soundcore pwm_lpss_platform pwm_lpss 8250_dw crypto_user mmc_block xhci_pci xhci_pci_renesas xhci_hcd usbcore usb_common sdhci_acpi sdhci mmc_core spi_pxa2xx_platform ext4 crc32c_generic crc32c_intel mbcache crc16 jbd2
CR2: 00000000ffffffff
---[ end trace 0000000000000000 ]---
RIP: 0010:strcmp+0x10/0x30
Code: 66 2e 0f 1f 84 00 00 00 00 00 0f b6 14 0e 88 14 08 48 ff c1 84 d2 75 f2 c3 cc 31 c0 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 <0f> b6 0c 07 0f b6 14 06 38 d1 75 0a 48 ff c0 84 c9 75 ed 31 c0 c3
RSP: 0018:ffffc900004bf778 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8880202e4428 RCX: ffff88800495a6a8
RDX: ffff88800495a6a8 RSI: ffffffffa09d0388 RDI: 00000000ffffffff
RBP: ffffc900004bf8c8 R08: 0000000000000000 R09: 0000000000000000
R10: ffff8880202e4400 R11: ffffffffa08cd03f R12: ffff88800378f600
R13: ffff88800495a400 R14: ffffffffa08e30a8 R15: ffff88800495a410
FS:  00007f979c6bd540(0000) GS:ffff888076900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000ffffffff CR3: 0000000003e2d000 CR4: 00000000001006f0

Additionally, the system hangs on the final stages of reboot or poweroff. I don't know if it is related to this or a separate issue.

Here is my kernel configuration:
config-6.8.6-lto.txt

Being that this is a pretty uncommon piece of hardware, I am happy to test patches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Kernel panic[FEATURE] LTORelated to building the kernel with LLVM Link Time Optimization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions