[Letux-kernel] accelerometer bridge madness

H. Nikolaus Schaller hns at goldelico.com
Fri Jul 27 21:35:20 CEST 2018


> Am 27.07.2018 um 20:01 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> On Fri, 27 Jul 2018 19:54:39 +0200
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> 
> [...]
>> could you copy the full strace incl. command?
>> Then I can try on my device and we can compare.
>> 
> I: Bus=0000 Vendor=0000 Product=0000 Version=0000
> N: Name="accelerometer-iio-input-bridge"
> P: Phys=accel/input0
> S: Sysfs=/devices/virtual/input/input6
> U: Uniq=
> H: Handlers=js0 event5
> B: PROP=0
> B: EV=9
> B: ABS=7
> 
> I: Bus=0018 Vendor=0000 Product=0000 Version=0000
> N: Name="TSC2007 Touchscreen"
> P: Phys=1-0048/input0
> S: Sysfs=/devices/platform/68000000.ocp/48072000.i2c/i2c-1/1-0048/input/input5
> U: Uniq=
> H: Handlers=mouse0 event6
> B: PROP=0
> B: EV=b
> B: KEY=400 0 0 0 0 0 0 0 0 0 0
> B: ABS=1000003
> 
> root at gta04:~# xxd /dev/^C
> root at gta04:~# strace xxd /dev/input/event5
> execve("/usr/bin/xxd", ["xxd", "/dev/input/event5"], [/* 16 vars */]) = 0
> brk(0)                                  = 0x4ed000
> uname({sys="Linux", node="gta04", ...}) = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f41000
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
> fstat64(3, {st_mode=S_IFREG|0644, st_size=78838, ...}) = 0
> mmap2(NULL, 78838, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f08000
> close(3)                                = 0
> access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
> open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
> read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0Mw\1\0004\0\0\0"..., 512) = 512
> lseek(3, 908188, SEEK_SET)              = 908188
> read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
> lseek(3, 904740, SEEK_SET)              = 904740
> read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 53
> fstat64(3, {st_mode=S_IFREG|0755, st_size=911068, ...}) = 0
> mmap2(NULL, 980392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6e18000
> mprotect(0xb6ef3000, 61440, PROT_NONE)  = 0
> mmap2(0xb6f02000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xda000) = 0xb6f02000
> mmap2(0xb6f05000, 9640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f05000
> close(3)                                = 0
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f40000
> set_tls(0xb6f40850, 0xb6f44058, 0xb6f40f38, 0xb6f40850, 0xb6f44058) = 0
> mprotect(0xb6f02000, 8192, PROT_READ)   = 0
> mprotect(0x4ea000, 4096, PROT_READ)     = 0
> mprotect(0xb6f43000, 4096, PROT_READ)   = 0
> munmap(0xb6f08000, 78838)               = 0
> brk(0)                                  = 0x4ed000
> brk(0x50e000)                           = 0x50e000
> open("/dev/input/event5", O_RDONLY)     = 3
> fstat64(3, {st_mode=S_IFCHR|0660, st_rdev=makedev(13, 69), ...}) = 0
> ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0xbea65a7c) = -1 EINVAL (Invalid argument)
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f3f000
> read(3,
> 
> ctrl+c gives high cpu usage (pasted from top):
> 2908 root      20   0       0      0      0 R 89.1  0.0   0:14.29 xxd
> 
> and the process does not terminate.

root at letux:~# xxd /dev/input/accel
0000000: dd72 5b5b c3a9 0d00 0300 0000 1f00 0000  .r[[............
0000010: dd72 5b5b c3a9 0d00 0300 0100 e8ff ffff  .r[[............
0000020: dd72 5b5b c3a9 0d00 0300 0200 08ff ffff  .r[[............
0000030: dd72 5b5b c3a9 0d00 0000 0000 0000 0000  .r[[............
0000040: de72 5b5b 1d0b 0000 0300 0000 1e00 0000  .r[[............
0000050: de72 5b5b 1d0b 0000 0300 0100 e9ff ffff  .r[[............
0000060: de72 5b5b 1d0b 0000 0300 0200 09ff ffff  .r[[............
0000070: de72 5b5b 1d0b 0000 0000 0000 0000 0000  .r[[............
0000080: de72 5b5b 63b6 0100 0300 0000 1f00 0000  .r[[c...........
0000090: de72 5b5b 63b6 0100 0000 0000 0000 0000  .r[[c...........
00000a0: de72 5b5b 6d67 0300 0300 0000 1e00 0000  .r[[mg..........
00000b0: de72 5b5b 6d67 0300 0300 0100 eaff ffff  .r[[mg..........
00000c0: de72 5b5b 6d67 0300 0300 0200 07ff ffff  .r[[mg..........
00000d0: de72 5b5b 6d67 0300 0000 0000 0000 0000  .r[[mg..........
00000e0: de72 5b5b f910 0500 0300 0000 1f00 0000  .r[[............
00000f0: de72 5b5b f910 0500 0300 0100 e9ff ffff  .r[[............
^C
root at letux:~# strace xxd /dev/input/accel
execve("/usr/bin/xxd", ["xxd", "/dev/input/accel"], [/* 14 vars */]) = 0
brk(0)                                  = 0x454000
uname({sys="Linux", node="letux", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f10000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=33615, ...}) = 0
mmap2(NULL, 33615, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f07000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0Mw\1\0004\0\0\0"..., 512) = 512
lseek(3, 908188, SEEK_SET)              = 908188
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
lseek(3, 904740, SEEK_SET)              = 904740
read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 53
fstat64(3, {st_mode=S_IFREG|0755, st_size=911068, ...}) = 0
mmap2(NULL, 980392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6dfb000
mprotect(0xb6ed6000, 61440, PROT_NONE)  = 0
mmap2(0xb6ee5000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xda000) = 0xb6ee5000
mmap2(0xb6ee8000, 9640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6ee8000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f06000
set_tls(0xb6f06850, 0xb6f13058, 0xb6f06f38, 0xb6f06850, 0xb6f13058) = 0
mprotect(0xb6ee5000, 8192, PROT_READ)   = 0
mprotect(0x451000, 4096, PROT_READ)     = 0
mprotect(0xb6f12000, 4096, PROT_READ)   = 0
munmap(0xb6f07000, 33615)               = 0
brk(0)                                  = 0x454000
brk(0x475000)                           = 0x475000
open("/dev/input/accel", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFCHR|0660, st_rdev=makedev(13, 69), ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0xbeddbaac) = -1 EINVAL (Invalid argument)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f0f000
read(3, "%s[[F\253\5\0\3\0\1\0\352\377\377\377%s[[F\253\5\0\0\0\0\0\0\0\0\0", 4096) = 32
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f0e000
write(1, "0000000: 2573 5b5b 46ab 0500 030"..., 670000000: 2573 5b5b 46ab 0500 0300 0100 eaff ffff  %s[[F...........
) = 67
write(1, "0000010: 2573 5b5b 46ab 0500 000"..., 670000010: 2573 5b5b 46ab 0500 0000 0000 0000 0000  %s[[F...........
) = 67
read(3, "%s[[\200Z\7\0\3\0\0\0\37\0\0\0%s[[\200Z\7\0\3\0\1\0\351\377\377\377"..., 4096) = 48
write(1, "0000020: 2573 5b5b 805a 0700 030"..., 670000020: 2573 5b5b 805a 0700 0300 0000 1f00 0000  %s[[.Z..........
) = 67
write(1, "0000030: 2573 5b5b 805a 0700 030"..., 670000030: 2573 5b5b 805a 0700 0300 0100 e9ff ffff  %s[[.Z..........
) = 67
write(1, "0000040: 2573 5b5b 805a 0700 000"..., 670000040: 2573 5b5b 805a 0700 0000 0000 0000 0000  %s[[.Z..........
) = 67
read(3, "%s[[\372d\f\0\3\0\2\0\t\377\377\377%s[[\372d\f\0\0\0\0\0\0\0\0\0", 4096) = 32
write(1, "0000050: 2573 5b5b fa64 0c00 030"..., 670000050: 2573 5b5b fa64 0c00 0300 0200 09ff ffff  %s[[.d..........
) = 67
write(1, "0000060: 2573 5b5b fa64 0c00 000"..., 670000060: 2573 5b5b fa64 0c00 0000 0000 0000 0000  %s[[.d..........
) = 67
read(3, "%s[[\1\17\16\0\3\0\2\0\10\377\377\377%s[[\1\17\16\0\0\0\0\0\0\0\0\0", 4096) = 32
write(1, "0000070: 2573 5b5b 010f 0e00 030"..., 670000070: 2573 5b5b 010f 0e00 0300 0200 08ff ffff  %s[[............
) = 67
write(1, "0000080: 2573 5b5b 010f 0e00 000"..., 670000080: 2573 5b5b 010f 0e00 0000 0000 0000 0000  %s[[............
) = 67
read(3, "&s[[\362|\0\0\3\0\1\0\352\377\377\377&s[[\362|\0\0\3\0\2\0\t\377\377\377"..., 4096) = 48
write(1, "0000090: 2673 5b5b f27c 0000 030"..., 670000090: 2673 5b5b f27c 0000 0300 0100 eaff ffff  &s[[.|..........
) = 67
write(1, "00000a0: 2673 5b5b f27c 0000 030"..., 6700000a0: 2673 5b5b f27c 0000 0300 0200 09ff ffff  &s[[.|..........
) = 67
write(1, "00000b0: 2673 5b5b f27c 0000 000"..., 6700000b0: 2673 5b5b f27c 0000 0000 0000 0000 0000  &s[[.|..........
) = 67
read(3, "&s[[\207(\2\0\3\0\1\0\351\377\377\377&s[[\207(\2\0\0\0\0\0\0\0\0\0", 4096) = 32
write(1, "00000c0: 2673 5b5b 8728 0200 030"..., 6700000c0: 2673 5b5b 8728 0200 0300 0100 e9ff ffff  &s[[.(..........
) = 67
write(1, "00000d0: 2673 5b5b 8728 0200 000"..., 6700000d0: 2673 5b5b 8728 0200 0000 0000 0000 0000  &s[[.(..........
) = 67
read(3, "&s[[X\210\5\0\3\0\1\0\352\377\377\377&s[[X\210\5\0\0\0\0\0\0\0\0\0", 4096) = 32
write(1, "00000e0: 2673 5b5b 5888 0500 030"..., 6700000e0: 2673 5b5b 5888 0500 0300 0100 eaff ffff  &s[[X...........
) = 67
write(1, "00000f0: 2673 5b5b 5888 0500 000"..., 6700000f0: 2673 5b5b 5888 0500 0000 0000 0000 0000  &s[[X...........
) = 67
read(3, "&s[[83\7\0\3\0\0\0\36\0\0\0&s[[83\7\0\3\0\2\0\6\377\377\377"..., 4096) = 48
write(1, "0000100: 2673 5b5b 3833 0700 030"..., 670000100: 2673 5b5b 3833 0700 0300 0000 1e00 0000  &s[[83..........
) = 67
write(1, "0000110: 2673 5b5b 3833 0700 030"..., 670000110: 2673 5b5b 3833 0700 0300 0200 06ff ffff  &s[[83..........
) = 67
write(1, "0000120: 2673 5b5b 3833 0700 000"..., 670000120: 2673 5b5b 3833 0700 0000 0000 0000 0000  &s[[83..........
) = 67
read(3, ^CProcess 3272 detached
 <detached ...>

Hm. No significant difference. Except that your read(4 hangs, while mine doesn't.

BR,
Nikolaus



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180727/da55443f/attachment-0001.asc>


More information about the Letux-kernel mailing list