[ltp] tpctl problems

Rob Walker linux-thinkpad@www.bm-soft.com
28 Jul 2002 17:31:18 -0700


My tpctl app isn't working.  I am getting the same error as everyone
else in the archives.

tp600x:~# tpctl --rs1=on
tpctl: System error message is: No such device
tpctl: Can't open device file /dev/thinkpad with flags O_RDWR.  Exiting.


I get the same errors with the "tpctl --rs2=on" and "tpctl --rsx"
commands.

Due to reading the archives, I will try to head off some of the
now-expected questions before they are asked.

1.  Are the modules loaded?
yes.
tp600x:~# lsmod | grep smapi
smapi                   2800   0  (unused)
thinkpad                2484   0  [smapi]


2.  What are the permissions on /dev/thinkpad (a symlink to /dev/smapi)?

They are as the "MAKEDEV thinkpad" script created them.
tp600x:/dev# ls -alrt /dev/thinkpad /dev/smapi
lrwxrwxrwx    1 root     root            5 Jul 28 17:26 /dev/thinkpad ->
smapi
crw-rw----    1 root     root      10, 170 Jul 28 17:26 /dev/smapi


I am not sure why that matters, since I am running tpctl as root.

3.  What does syslog say when I run the tpctl command with the modules
unloaded?

Jul 28 17:28:12 tp600x kernel: thinkpad: I have registered to handle
major: 10 minor: 170.

And when I rmmod it, I get 

Jul 28 17:28:05 tp600x kernel: thinkpad: I have cleaned up.


An strace of the tpctl command is as follows:



Script started on Sun Jul 28 17:29:18 2002
tp600x:/dev# strace tpctl --rs1=on
execve("/usr/bin/tpctl", ["tpctl", "--rs1=on"], [/* 12 vars */]) = 0
uname({sys="Linux", node="tp600x", ...}) = 0
brk(0)                                  = 0x80569d8
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=45375, ...}) = 0
old_mmap(NULL, 45375, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40015000
close(3)                                = 0
open("/lib/libncurses.so.5", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\337\0"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0644, st_size=248132, ...}) = 0
old_mmap(NULL, 253056, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40021000
mprotect(0x40056000, 35968, PROT_NONE)  = 0
old_mmap(0x40056000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x34000) = 0x40056000
close(3)                                = 0
open("/usr/lib/libsmapidev.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\7\0"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0644, st_size=6340, ...}) = 0
old_mmap(NULL, 9676, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4005f000
mprotect(0x40061000, 1484, PROT_NONE)   = 0
old_mmap(0x40061000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x40061000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\24\222"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1149584, ...}) = 0
old_mmap(NULL, 1162080, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40062000
mprotect(0x40174000, 39776, PROT_NONE)  = 0
old_mmap(0x40174000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x112000) = 0x40174000
old_mmap(0x4017a000, 15200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4017a000
close(3)                                = 0
munmap(0x40015000, 45375)               = 0
stat64("/dev/.devfsd", 0xbffffc0c)      = -1 ENOENT (No such file or directory)
stat64("/dev/thinkpad", {st_mode=S_IFCHR|0660, st_rdev=makedev(10, 170), ...}) = 0
open("/dev/thinkpad", O_RDWR)           = -1 ENOSYS (Function not implemented)
open("/dev/thinkpad", O_RDWR)           = -1 ENOSYS (Function not implemented)
open("/dev/thinkpad", O_RDWR)           = -1 ENODEV (No such device)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
brk(0)                                  = 0x80569d8
brk(0x8056b58)                          = 0x8056b58
brk(0x8057000)                          = 0x8057000
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 11), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
_llseek(3, 0, 0xbffffaf4, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "tpctl: System error message is: "..., 47tpctl: System error message is: No such device
) = 47
close(3)                                = 0
munmap(0x40015000, 4096)                = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 11), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
write(1, "tpctl: Can\'t open device file /d"..., 73tpctl: Can't open device file /dev/thinkpad with flags O_RDWR.  Exiting.
) = 73
munmap(0x40015000, 4096)                = 0
_exit(1)                                = ?
tp600x:/dev# 
Script done on Sun Jul 28 17:29:24 2002



I have no idea where to go from here.  Oh, yes, I just built the modules
today myself with the make-kpkg script from debian.

rob







----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html