Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 736898 - sys-kernel/gentoo-sources-5.7.8 .. 5.7.12 - WARNING: CPU: 0 PID: 496333 at drivers/i2c/busses/i2c-designware-common.c:247 i2c_dw_clk_rate+0x11/0x20 [i2c_designware_core]
Summary: sys-kernel/gentoo-sources-5.7.8 .. 5.7.12 - WARNING: CPU: 0 PID: 496333 at dr...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-12 16:43 UTC by Liam Dennehy
Modified: 2020-08-12 22:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liam Dennehy 2020-08-12 16:43:12 UTC
Performing `modprobe designware_core_platform` causes the following kernel event in kernel-5.7.12:


kernel: ------------[ cut here ]------------
kernel: WARNING: CPU: 0 PID: 496333 at drivers/i2c/busses/i2c-designware-common.c:247 i2c_dw_clk_rate+0x11/0x20 [i2c_designware_core]
kernel: Modules linked in: i2c_designware_platform(+) i2c_designware_core elan_i2c i2c_hid ctr ccm rfcomm af_packet bridge stp llc cmac algif_skcipher xt_MASQUERADE xt_mark bnep iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter ip_tables x_tables dm_thin_pool dm_persistent_data dm_bio_prison dm_bufio sha1_generic vxlan ip6_udp_tunnel udp_tunnel macvlan overlay nfs lockd grace sunrpc fscache ext4 mbcache jbd2 btusb btintel bluetooth ecdh_generic ecc crc16 uvcvideo videobuf2_vmalloc videobuf2_memops mousedev videobuf2_v4l2 videodev usbhid videobuf2_common iwlmvm mac80211 snd_hda_codec_generic libarc4 snd_hda_codec_hdmi snd_hda_intel iwlwifi snd_intel_dspcfg wmi_bmof snd_hda_codec snd_hwdep snd_hda_core amdgpu snd_pcm snd_timer kvm_amd k10temp cfg80211 kvm input_leds irqbypass crc32_pclmul led_class gpu_sched hwmon snd rfkill soundcore wmi ttm battery ac [last unloaded: i2c_designware_core]
kernel: CPU: 0 PID: 496333 Comm: modprobe Tainted: G        W         5.7.8-gentoo #19
kernel: Hardware name: LENOVO 81YQ/LNVNB161216, BIOS E7CN25WW 05/19/2020
kernel: RIP: 0010:i2c_dw_clk_rate+0x11/0x20 [i2c_designware_core]
kernel: Code: 0f 45 c1 a8 01 75 be 5b 5d 41 5c c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8b 47 58 48 85 c0 74 08 e8 92 cb ad d9 89 c0 c3 <0f> 0b c3 66 66 2e 0f 1f 84 00 00 00 00 00 90 48 8b 97 00 05 00 00
kernel: RSP: 0018:ffffab4942d83af8 EFLAGS: 00010246
kernel: RAX: 0000000000000000 RBX: ffffa3c43b4e1028 RCX: 00000000aeffff00
kernel: RDX: 0000000000000000 RSI: 00000000000000f4 RDI: ffffa3c43b4e1028
kernel: RBP: 0000000000ffffae R08: 0000000000000000 R09: ffffa3c6e95a1540
kernel: R10: ffffab4942d83a58 R11: ffffa3c6e95a15e8 R12: 000000000000012c
kernel: R13: 000000000000012c R14: 0000000000000000 R15: ffffffffc0f54100
kernel: FS:  00007f937fac0740(0000) GS:ffffa3c6ef000000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00005621e42e2120 CR3: 00000000b02e6000 CR4: 0000000000340ef0
kernel: Call Trace:
kernel:  i2c_dw_probe+0xf2/0x330 [i2c_designware_core]
kernel:  dw_i2c_plat_probe+0x2b9/0x550 [i2c_designware_platform]
kernel:  platform_drv_probe+0x3d/0x90
kernel:  really_probe+0x28d/0x2d0
kernel:  driver_probe_device+0x59/0xd0
kernel:  device_driver_attach+0x68/0x70
kernel:  __driver_attach+0x54/0xc0
kernel:  ? device_driver_attach+0x70/0x70
kernel:  bus_for_each_dev+0x75/0xc0
kernel:  bus_add_driver+0x198/0x1e0
kernel:  driver_register+0x67/0xb0
kernel:  ? 0xffffffffc0369000
kernel:  do_one_initcall+0x41/0x210
kernel:  ? free_vmap_area_noflush+0xa0/0x110
kernel:  ? kmem_cache_alloc_trace+0x195/0x230
kernel:  ? do_init_module+0x1e/0x210
kernel:  do_init_module+0x56/0x210
kernel:  load_module+0x204f/0x23c0
kernel:  ? frob_text.isra.0+0x20/0x20
kernel:  __do_sys_finit_module+0xfd/0x120
kernel:  do_syscall_64+0x43/0x130
kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
kernel: RIP: 0033:0x7f937fbbb339
kernel: Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 27 1b 0c 00 f7 d8 64 89 01 48
kernel: RSP: 002b:00007ffda0e58638 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
kernel: RAX: ffffffffffffffda RBX: 000056096efb1c50 RCX: 00007f937fbbb339
kernel: RDX: 0000000000000000 RSI: 000056096ec83390 RDI: 0000000000000004
kernel: RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000000
kernel: R10: 0000000000000004 R11: 0000000000000246 R12: 000056096ec83390
kernel: R13: 0000000000000000 R14: 000056096efb1b80 R15: 000056096efb1c50
kernel: ---[ end trace 0ccc3133a6805855 ]---
kernel: i2c_hid i2c-ELAN0001:00: HID over i2c has not been provided an Int IRQ
kernel: i2c_hid: probe of i2c-ELAN0001:00 failed with error -22
Comment 1 Liam Dennehy 2020-08-12 18:19:43 UTC
Well this is rather random:

$ diff designware-no-warning.config designware-warning.config
309c309
< CONFIG_X86_AMD_PLATFORM_DEVICE=y
---
> # CONFIG_X86_AMD_PLATFORM_DEVICE is not set

So, enable CONFIG_X86_AMD_PLATFORM_DEVICE and no more kernel warning...
Comment 2 Michael 'veremitz' Everitt 2020-08-12 19:41:14 UTC
(In reply to Liam Dennehy from comment #1)
> Well this is rather random:
> 
> $ diff designware-no-warning.config designware-warning.config
> 309c309
> < CONFIG_X86_AMD_PLATFORM_DEVICE=y
> ---
> > # CONFIG_X86_AMD_PLATFORM_DEVICE is not set
> 
> So, enable CONFIG_X86_AMD_PLATFORM_DEVICE and no more kernel warning...

Something that trickles down from that must be causing it .. from the report, its related to some i2c driver code. This is likely a sledgehammer fix whilst the real bug is identified ..
Comment 3 Liam Dennehy 2020-08-12 22:46:47 UTC
It may be more foundational than trickle down. From https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/x86/Kconfig?h=v5.7.12&id=67da9e2c2b730b9b788ace749d22d769cf11ee2b#n638

> I2C and UART depend on COMMON_CLK to set clock.

Relevant code from warning in 5.7.12
drivers/i2c/busses/i2c-designware-common.c:241
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/i2c/busses/i2c-designware-common.c?h=v5.7.12&id=67da9e2c2b730b9b788ace749d22d769cf11ee2b#n241

```
unsigned long i2c_dw_clk_rate(struct dw_i2c_dev *dev)
{
        /*
         * Clock is not necessary if we got LCNT/HCNT values directly from
         * the platform code.
         */
        if (WARN_ON_ONCE(!dev->get_clk_rate_khz))
                return 0;
        return dev->get_clk_rate_khz(dev);
}

```

It seems this platform driver is serving a clock other modules/drivers depend on?