Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thinkpad edge 13 - battery threshold issue #1

Open
CJPB opened this issue Jul 13, 2011 · 15 comments
Open

Thinkpad edge 13 - battery threshold issue #1

CJPB opened this issue Jul 13, 2011 · 15 comments

Comments

@CJPB
Copy link

CJPB commented Jul 13, 2011

Hi,
first of all let me apologize in advance if this is not the proper "channel" for a bug report/help request.
I had been reading the sourceforge page for tp_smapi but it looks "dead" in terms of development and i failed every time at installing the smapi driver. Luckily i found your project and got it installed and running now on my thinkpad edge (13", intel model) on opensuse 11.4 with the 3.0 rc1 kernel.

Loading the module goes well, as seen with dmesg:
[13534.023286] tp_smapi unloaded.
[13572.872541] tp_smapi 0.40 loading...
[13572.873353] tp_smapi successfully loaded (smapi_port=0xb2)

But trying to set the battery threshold limits is not working properly. So, what happens is that if i set the start threshold limit to 40, the stop limit gets automatically set to 39. In a similar way if i set the stop threshold to 40, the start limit will be set to 41 automatically. I can use any value and the other will always be set automatically with a +/- 1 difference - it makes no sense:

echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
40
39
but with dmesg i see:
[13923.606105] smapi smapi: set_real_thresh: set stop to 44 for bat=0
[13923.712956] smapi smapi: set_real_thresh: set start to 39 for bat=0

likewise, if i do:
echo 40 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
41
40
and with dmesg i see:
[14108.540534] smapi smapi: set_real_thresh: set start to 35 for bat=0
[14108.647415] smapi smapi: set_real_thresh: set stop to 40 for bat=0

any hint as to how i can start to try and solve this?

regards,
Carlos

@evgeni
Copy link
Member

evgeni commented Jul 13, 2011

Could you please test whether the limits you set (and not see) are used? I have reports that it's just the display that get's borked and the actual thresholds works okay.

@CJPB
Copy link
Author

CJPB commented Jul 13, 2011

The battery was at 93% when i tested the following

I set the start limit to 95:
echo 95 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
and it starts charging:
cat /sys/devices/platform/smapi/BAT0/state
charging
dmesg returns:
[18372.551238] smapi smapi: set_real_thresh: set start to 94 for bat=0
but:
cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
95
94

Afterwards i set the stop limit to 97
echo 97 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
dmesg returns:
[18510.731938] smapi smapi: set_real_thresh: set stop to 97 for bat=0
but:
cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
98
97

And... when it got to 97% it stopped charging as expected :)
So it seems to be working, although the returned values from start/stop_charge_thresh are incorrect.

I will try again later with lower start charging limits:
echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
dmesg reports:
[19661.249497] smapi smapi: set_real_thresh: set start to 39 for bat=0
[19703.754354] smapi smapi: set_real_thresh: set stop to 80 for bat=0
although
cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
81
80

thanks for your help,
Carlos

@CJPB
Copy link
Author

CJPB commented Jul 15, 2011

Hi again,
did some additional testing involving booting either to windows or linux and setting other values and everything seems to be working properly.

I do wonder why the reported values are different from the input... it is the same "function" no?
Can you give me any pointer on how i can look into this?

regards,
Carlos

@evgeni
Copy link
Member

evgeni commented Jul 16, 2011

Well, I did not write the code, just maintaining it, so my knowledge is limited.

The setting of the values you do via echo happens in
static int set_real_thresh(int bat, enum thresh_type which, int thresh)
which just prints what you wanted to set (after some minimal correction)

The reading via cat happens in
static ssize_t show_battery_start_charge_thresh(struct device *dev, struct device_attribute *attr, char *buf)
which really reads the values, and obviously misreads them.

Maybe you find something in there?

@evgeni evgeni closed this as completed in 280da64 Jul 28, 2011
@evgeni evgeni reopened this Jul 28, 2011
@evgeni
Copy link
Member

evgeni commented Jul 28, 2011

ups, wrong close

@ajs124
Copy link

ajs124 commented Nov 29, 2011

hi,
i own a thinkpad e325 and cant load thinkpad_ec or tp_smapi, too.
but i compiled tp_charge and loaded the module and now i am able to set bat0-stop level, but thats the only thing a can read or write. i'm useing archlinux with linux 3.1.3.

i don't know if this is a help for anyone and i'm sorry for my bad english writing skills, but i would appreciate to be able to use more features of tp_smapi.

@evgeni
Copy link
Member

evgeni commented Nov 29, 2011

On Tue, Nov 29, 2011 at 12:30:33PM -0800, ajs124 wrote:

i own a thinkpad e325 and cant load thinkpad_ec or tp_smapi, too. but
i compiled tp_charge and loaded the module and now i am able to set
bat0-stop level, but thats the only thing a can read or write. i'm
useing archlinux with linux 3.1.3.

Funny, if tp-charge works, tp-smapi 0.41 should work too.
Could you provide a dmesg output when tp-smapi could not load?

Regards
Evgeni

Bruce Schneier can read and understand Perl programs.

@ajs124
Copy link

ajs124 commented Nov 30, 2011

"modprobe -v tp_smapi"
insmod /lib/modules/3.1.3-1-ARCH/extramodules/thinkpad_ec.ko.gz
WARNING: Error inserting thinkpad_ec (/lib/modules/3.1.3-1-ARCH/extramodules/thinkpad_ec.ko.gz): No such device or address FATAL: Error inserting tp_smapi (/lib/modules/3.1.3-1-ARCH/extramodules/tp_smapi.ko.gz): No such device or address
"dmesg"
[ 398.202292] thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffff0
[ 398.202302] thinkpad_ec: initial ec test failed

insmod /lib/modules/3.1.3-1-ARCH/extramodules/tp_charge.ko.gz
[ 443.094964] tp_charge: Found SMAPI at address 0x00B0

Name : tp_smapi
Version : 0.41-2

@alexisrobert
Copy link

I have this module loading problem too (archlinux / tp_smapi built from the git / Edge E320 Intel)

@butze
Copy link

butze commented Mar 11, 2012

having the same problem as described by ajs,

is there any progress?

@evgeni
Copy link
Member

evgeni commented Mar 12, 2012

no, none yet, sorry.

@butze
Copy link

butze commented Apr 7, 2012

is there a way to help? I'm like alexisrobert on archlinux too

@jat255
Copy link

jat255 commented May 4, 2012

Hello,

I am also able to load tp_charge:

dmesg reports:
[32585.419395] tp_charge: Found SMAPI at address 0x00B2

But when I try to load tp_smapi (using the Ubuntu dkms version) I get:
FATAL: Error inserting tp_smapi (/lib/modules/3.0.0-16-generic/updates/dkms/tp_smapi.ko): No such device or address

And dmesg shows:
[32499.931681] thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffff0
[32499.931685] thinkpad_ec: initial ec test failed

Any ideas as to why this might happen?

@CJPB
Copy link
Author

CJPB commented May 4, 2012

I can load tp_smapi fine on my intel Edge 13" (latest bios).
Just downloaded the evgeni-tp_smapi-477c48d file from github and did "make"
followed by "make load":
dmesg:
[20860.437935] thinkpad_ec: thinkpad_ec 0.41 loaded.
[20860.441063] tp_smapi 0.41 loading...
[20860.441289] tp_smapi successfully loaded (smapi_port=0xb2).

Using openSUSE 12.1 with 3.3.4 kernel.
Carlos

On Fri, May 4, 2012 at 3:55 PM, jat255 <
reply@reply.github.com

wrote:

Hello,

I am also able to load tp_charge:

dmesg reports:
[32585.419395] tp_charge: Found SMAPI at address 0x00B2

But when I try to load tp_smapi (using the Ubuntu dkms version) I get:
FATAL: Error inserting tp_smapi
(/lib/modules/3.0.0-16-generic/updates/dkms/tp_smapi.ko): No such device or
address

And dmesg shows:
[32499.931681] thinkpad_ec: thinkpad_ec_read_row: failed requesting row:
(0x01:0x00)->0xfffffff0
[32499.931685] thinkpad_ec: initial ec test failed

Any ideas as to why this might happen?


Reply to this email directly or view it on GitHub:
#1 (comment)

@jat255
Copy link

jat255 commented May 4, 2012

Thanks for the reply. I tried purging the dkms module through apt-get and building from source like you suggested.

The make seemed to go fine, but when I attempted to load with make load, I got the following result

josh@josh-ThinkPad:~/development/tp_smapi$ sudo make load
if lsmod | grep -q '^hdaps '; then rmmod hdaps; fi
if lsmod | grep -q '^tp_smapi '; then rmmod tp_smapi; fi
if lsmod | grep -q '^thinkpad_ec '; then rmmod thinkpad_ec; fi
 if lsmod | grep -q '^tp_base '; then rmmod tp_base; fi  # old thinkpad_ec
make -C /lib/modules/3.0.0-16-generic/build M=/home/josh/development/tp_smapi O=/lib/modules/3.0.0-16-generic/build modules
make[1]: Entering directory `/usr/src/linux-headers-3.0.0-16-generic'
  Building modules, stage 2.
  MODPOST 2 modules
make[1]: Leaving directory `/usr/src/linux-headers-3.0.0-16-generic'
{ insmod ./thinkpad_ec.ko  && insmod ./tp_smapi.ko debug=0 && :; }; :
insmod: error inserting './thinkpad_ec.ko': -1 No such device or address

Relevent dmesg errors include the same result as before:

[40747.170089] thinkpad_ec: thinkpad_ec_read_row: failed requesting row: (0x01:0x00)->0xfffffff0
[40747.170093] thinkpad_ec: initial ec test failed

This is on my ThinkPad Edge E420s with Ubuntu 11.10. Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants