22 Nov 2015 fzort   » (Journeyer)

Xperia E1 kernel tweaking (5)

Aaaand... another bug!

<4>[ 0.217984] WARNING: at /home/fzort/projects/xperia/kernel/fs/sysfs/dir.c:508 sysfs_add_one+0x88/0xb8()
<4>[ 0.218192] sysfs: cannot create duplicate filename '/class/sensors'


The device class sensors is registered twice, once by drivers/input/sensor_mgr.c, and then by (mainline kernel) drivers/sensors/sensors_class.c, which fails.

sensor_mgr.c seems to run first (is this deterministic?) so it's probably safe to remove sensors_class.c from the build. By the way, sensor_mgr.c also registers a device attribute called deviceInfor (yuck, camel case). Trying to read it on sysfs causes a kernel crash!

This bug is also present in stock software.

Edit: easy fix for the double /sys/class/sensors registration.

Edit 2: pretty awful kernel crash when doing a cat /sys/class/sensors/light/deviceInfor (or anything under /sys/class/sensors):

<1>[ 2909.524014] Unable to handle kernel NULL pointer dereference at virtual address 00000010
<1>[ 2909.524347] pgd = d4760000
<1>[ 2909.524610] [00000010] *pgd=00000000
<0>[ 2909.525297] Internal error: Oops: 805 [#1] PREEMPT SMP ARM
...


Edit 3: fixed

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!