I've just experienced an Issue that I think may be a regression.
I'm enabling a device which incorporates a lis2dw12 accelerometer, currently I am running 6.12 lts, so 6.12.29 as of typing this message.
My first issue is a Panic:
[ 0.281814] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000c0 [ 0.290626] Mem abort info: [ 0.293465] ESR = 0x0000000096000004 [ 0.297230] EC = 0x25: DABT (current EL), IL = 32 bits [ 0.302558] SET = 0, FnV = 0 [ 0.305619] EA = 0, S1PTW = 0 [ 0.308766] FSC = 0x04: level 0 translation fault [ 0.313649] Data abort info: [ 0.316534] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 0.322032] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 0.327093] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 0.332413] [00000000000000c0] user address but active_mm is swapper [ 0.338774] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 0.345044] Modules linked in: [ 0.348106] CPU: 2 UID: 0 PID: 43 Comm: kworker/u16:1 Not tainted 6.12.28-00054-gf24728d836e5 #13 [ 0.356983] Hardware name: GOcontroll Moduline Mini (DT) [ 0.362297] Workqueue: events_unbound deferred_probe_work_func [ 0.368143] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.375109] pc : device_set_deferred_probe_reason+0x58/0x84 [ 0.380686] lr : device_set_deferred_probe_reason+0x50/0x84 [ 0.386262] sp : ffff8000816d34d0 [ 0.389577] x29: ffff8000816d34d0 x28: ffff000004099d08 x27: ffff0000040998f0 [ 0.396724] x26: 0000000030a40000 x25: ffff000004099be4 x24: ffff00003fdf2758 [ 0.403870] x23: 000000000000000f x22: ffff8000816d3508 x21: ffff000000260a20 [ 0.411017] x20: ffff00000409a808 x19: ffff800081299db8 x18: ffffffffffffffff [ 0.418163] x17: 00007fff7e57efff x16: ffff8000815ad000 x15: ffff0000002617da [ 0.425309] x14: 0000000000000001 x13: 0a7365696c707075 x12: 7320656c62616e65 [ 0.432454] x11: 0000000669b8cb4b x10: 0000000000000020 x9 : ffff8000816d3590 [ 0.439599] x8 : ffff8000816d3590 x7 : 0000000000000000 x6 : ffff800080fe16a6 [ 0.446745] x5 : ffff000000260a3f x4 : ffff800080fc3912 x3 : 0000000000000000 [ 0.453890] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000260a20 [ 0.461037] Call trace: [ 0.463485] device_set_deferred_probe_reason+0x58/0x84 [ 0.468715] dev_err_probe+0xa0/0xec [ 0.472296] st_sensors_power_enable+0x50/0x60 [ 0.476748] st_accel_i2c_probe+0x70/0xe0 [ 0.480763] i2c_device_probe+0xfc/0x2d8 [ 0.484692] really_probe+0xc0/0x394 [ 0.488271] __driver_probe_device+0x7c/0x14c [ 0.492631] driver_probe_device+0x3c/0x120 [ 0.496818] __device_attach_driver+0xbc/0x160 [ 0.501265] bus_for_each_drv+0x88/0xe8 [ 0.505108] __device_attach+0xa0/0x1b4 [ 0.508949] device_initial_probe+0x14/0x20 [ 0.513135] bus_probe_device+0xb0/0xbc [ 0.516974] device_add+0x594/0x7a4 [ 0.520469] device_register+0x20/0x3c [ 0.524224] i2c_new_client_device+0x19c/0x3d0 [ 0.528671] of_i2c_register_device+0xd4/0xfc [ 0.533033] of_i2c_register_devices+0x6c/0x140 [ 0.537568] i2c_register_adapter+0x1f4/0x728 [ 0.541929] __i2c_add_numbered_adapter+0x58/0xa8 [ 0.546637] i2c_add_adapter+0xa0/0xd0 [ 0.550389] i2c_add_numbered_adapter+0x2c/0x38 [ 0.554924] i2c_imx_probe+0x2b0/0x6d4 [ 0.558679] platform_probe+0x68/0xdc [ 0.562347] really_probe+0xc0/0x394 [ 0.565926] __driver_probe_device+0x7c/0x14c [ 0.570286] driver_probe_device+0x3c/0x120 [ 0.574473] __device_attach_driver+0xbc/0x160 [ 0.578920] bus_for_each_drv+0x88/0xe8 [ 0.582763] __device_attach+0xa0/0x1b4 [ 0.586602] device_initial_probe+0x14/0x20 [ 0.590790] bus_probe_device+0xb0/0xbc [ 0.594628] deferred_probe_work_func+0xb8/0x11c [ 0.599250] process_one_work+0x180/0x2dc [ 0.603265] worker_thread+0x2c0/0x3e0 [ 0.607017] kthread+0x110/0x120 [ 0.610252] ret_from_fork+0x10/0x20 [ 0.613836] Code: 911a8021 97f9326d f9402681 aa0003f5 (f9406020) [ 0.619931] ---[ end trace 0000000000000000 ]--- [ 0.624551] Kernel panic - not syncing: Oops: Fatal exception [ 0.630299] SMP: stopping secondary CPUs [ 0.634543] Kernel Offset: disabled [ 0.638032] CPU features: 0x00,00000080,00200000,4200420b [ 0.643433] Memory Limit: none
It seems that indio_dev->dev is not initialized in st_sensors_power_enable(), this causes an issue when devm_regulator_bulk_get_enable() fails and then calls dev_err_probe with an uninitialized device.
To fix this I added:
indio_dev->dev = client->dev;
just before the call to st_sensors_power_enable() in drivers/iio/accel/st_accel_i2c.c
This fixed the kernel panic but showed another issue:
0.440413] sysfs: cannot create duplicate filename '/devices/platform/soc@0/30800000.bus/30a40000.i2c/i2c-2/2-0018' [ 0.440422] CPU: 0 UID: 0 PID: 43 Comm: kworker/u16:1 Not tainted 6.12.29+ #6 [ 0.440430] Hardware name: GOcontroll Moduline Mini (DT) [ 0.440435] Workqueue: events_unbound deferred_probe_work_func [ 0.440449] Call trace: [ 0.440452] dump_backtrace+0xd0/0x120 [ 0.440462] show_stack+0x18/0x24 [ 0.440469] dump_stack_lvl+0x60/0x80 [ 0.440478] dump_stack+0x18/0x24 [ 0.440483] sysfs_warn_dup+0x64/0x80 [ 0.440491] sysfs_create_dir_ns+0xf4/0x120 [ 0.440496] kobject_add_internal+0xb4/0x2d0 [ 0.440504] kobject_add+0x9c/0x108 [ 0.440511] device_add+0xb0/0x7a4 [ 0.440519] cdev_device_add+0x50/0xbc [ 0.440525] __iio_device_register+0x718/0x924 [ 0.440535] __devm_iio_device_register+0x28/0x8c [ 0.440542] st_accel_common_probe+0xd4/0xf0 [ 0.440550] st_accel_i2c_probe+0xa0/0xe0 [ 0.440556] i2c_device_probe+0xfc/0x2d8 [ 0.440563] really_probe+0xc0/0x394 [ 0.440568] __driver_probe_device+0x7c/0x14c [ 0.440573] driver_probe_device+0x3c/0x120 [ 0.440578] __device_attach_driver+0xbc/0x160 [ 0.440583] bus_for_each_drv+0x88/0xe8 [ 0.440590] __device_attach+0xa0/0x1b4 [ 0.440595] device_initial_probe+0x14/0x20 [ 0.440601] bus_probe_device+0xb0/0xbc [ 0.440605] deferred_probe_work_func+0xb8/0x11c [ 0.440610] process_one_work+0x180/0x2dc [ 0.440616] worker_thread+0x2c0/0x3e0 [ 0.440621] kthread+0x110/0x120 [ 0.440628] ret_from_fork+0x10/0x20 [ 0.440636] kobject: kobject_add_internal failed for 2-0018 with -EEXIST, don't try to register things with the same name in the same directory. [ 0.453688] st-accel-i2c 2-0018: probe with driver st-accel-i2c failed with error -17
In /sys/bus/i2c/devices I can indeed see 2-0018 present, but it doesn't show up on the iio bus (/sys/bus/iio/devices), so I am guessing somewhere in the driver it registers it before it should, and then again when it should.
This is where my ability to fix thing fizzles out and so here I am asking for assistance.
Kind regards, Maud
On 25/05/21 10:53AM, Maud Spierings wrote:
I've just experienced an Issue that I think may be a regression.
I'm enabling a device which incorporates a lis2dw12 accelerometer, currently I am running 6.12 lts, so 6.12.29 as of typing this message.
Could you check whether the latest mainline release (at the time this is v6.15-rc7) is also affected? If that's not the case the bug might already be fixed ^_^
Also as you said that this is a regression, what is the last revision that the accelerometer worked with?
This is where my ability to fix thing fizzles out and so here I am asking for assistance.
Kind regards, Maud
Cheers, Chris
On 5/21/25 11:29, Christian Heusel wrote:
On 25/05/21 10:53AM, Maud Spierings wrote:
I've just experienced an Issue that I think may be a regression.
I'm enabling a device which incorporates a lis2dw12 accelerometer, currently I am running 6.12 lts, so 6.12.29 as of typing this message.
Could you check whether the latest mainline release (at the time this is v6.15-rc7) is also affected? If that's not the case the bug might already be fixed ^_^
Unfortunately doesn't seem to be the case, still gets the panic. I also tried 6.12(.0), but that also has the panic, so it is definitely older than this lts.
Also as you said that this is a regression, what is the last revision that the accelerometer worked with?
Thats a difficult one to pin down, I'm moving from the nxp vendor kernel to mainline, the last working one that I know sure is 5.10.72 of that vendor kernel.
This is where my ability to fix thing fizzles out and so here I am asking for assistance.
Kind regards, Maud
Cheers, Chris
linux-stable-mirror@lists.linaro.org