From: Jeff Rickman <jrickman@myamigos.us>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Will there ever be EMC6w201 support?
Date: Wed, 11 May 2011 17:59:35 +0000 [thread overview]
Message-ID: <4DCACE87.5070400@myamigos.us> (raw)
In-Reply-To: <20110414034609.476411A9866@localhost.localdomain>
On 5/11/2011 10:08 AM, Jean Delvare wrote:
> On Wed, 11 May 2011 16:28:04 +0200, Luca Tettamanti wrote:
>> On Wed, May 11, 2011 at 04:15:45PM +0200, Jean Delvare wrote:
>>> On Wed, 11 May 2011 15:48:59 +0200, Luca Tettamanti wrote:
>>>> The driver uses lahf to copy the lowest byte of EFLAGS to eax, then
>>>> shifts it to right and test the lowest bit (CF).
>>>> Using pushf instead we get the whole EFLAGS and test the lowest bit.
>>>> Does it make sense? Someone should double check the patch, I don't trust
>>>> my assembly skills ;)
>>>>
>>>> diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
>>>> index d72433f..3554d10 100644
>>>> --- a/drivers/char/i8k.c
>>>> +++ b/drivers/char/i8k.c
>>>> @@ -139,8 +139,8 @@ static int i8k_smm(struct smm_regs *regs)
>>>> "movl %%edi,20(%%rax)\n\t"
>>>> "popq %%rdx\n\t"
>>>> "movl %%edx,0(%%rax)\n\t"
>>>> - "lahf\n\t"
>>>> - "shrl $8,%%eax\n\t"
>>>> + "pusfh\n\t"
>>>
>>> I think you meant pushf, not pusfh, right?
>>
>> Yeah, right... hand me that brown paper bag ;)
>>
>>>
>>>> + "popl %%eax\n\t"
>>>> "andl $1,%%eax\n"
>>>> :"=a"(rc)
>>>> : "a"(regs)
>>>
>>> I am no asm expert, but I don't get why you removed the shrl
>>> instruction. As I understand it, your pushf+popl replaces only lahf,
>>> the bit shifting is still needed (I assume the code wants to test bit 8
>>> in the flag register.)
>>
>> AFAIK lahf loads the lowest byte of EFLAGS into AH which is the upper
>> half of AX, hence the shift.
>
> Yes, you're right, of course. So much for my asm skills. Please return
> the brown paper bag to me when you're done ;)
>
>> The popl is wrong though, pushf only pushes 2 bytes... so let's try
>> again:
>>
>> diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
>> index d72433f..f71f266 100644
>> --- a/drivers/char/i8k.c
>> +++ b/drivers/char/i8k.c
>> @@ -139,8 +139,8 @@ static int i8k_smm(struct smm_regs *regs)
>> "movl %%edi,20(%%rax)\n\t"
>> "popq %%rdx\n\t"
>> "movl %%edx,0(%%rax)\n\t"
>> - "lahf\n\t"
>> - "shrl $8,%%eax\n\t"
>> + "pushf\n\t"
>> + "pop %%ax\n\t"
>> "andl $1,%%eax\n"
>> :"=a"(rc)
>> : "a"(regs)
>
> Looks reasonable. I can't test it as I don't have the hardware, but I
> have updated the driver at:
> http://khali.linux-fr.org/devel/misc/i8k/
> with the above fix. Jeff, Harry, can you test?
>
> Thanks,
[test results]
compile new i8k module
no compile errors noticed
do not load new i8k module
do not copy new module to /lib/modules tree
load "stock" driver (to verify baseline behavior)
non-fatal crash results
reboot
remove "stock" i8k module
copy new i8k module to /lib/modules/`uname -r`/kernel/drivers/char
run depmod -a
modinfo /lib/modules/`uname -r`/kernel/drivers/char/i8k.ko
filename:
/lib/modules/2.6.35.12-90.fc14.x86_64/kernel/drivers/char/i8k.ko
license: GPL
description: Driver for accessing SMM BIOS on Dell laptops
author: Massimo Dal Zotto (dz@debian.org)
srcversion: 0FCA3FE04945CA449B9A849
depends:
vermagic: 2.6.35.12-90.fc14.x86_64 SMP mod_unload
parm: force:Force loading without checking for supported
models (bool)
parm: ignore_dmi:Continue probing hardware even if DMI data
does not match (bool)
parm: restricted:Allow fan control if SYS_ADMIN capability set
(bool)
parm: power_status:Report power status in /proc/i8k (bool)
parm: fan_mult:Factor to multiply fan speed with (int)
load new i8k module
modprobe -v i8k
insmod /lib/modules/2.6.35.12-90.fc14.x86_64/kernel/drivers/char/i8k.ko
FATAL: Error inserting i8k
(/lib/modules/2.6.35.12-90.fc14.x86_64/kernel/drivers/char/i8k.ko): No
such device
from /var/log/messages
May 11 12:39:11 XX kernel: [ 263.320306] i8k: unable to get SMM Dell
signature
modprobe -v i8k force
insmod /lib/modules/2.6.35.12-90.fc14.x86_64/kernel/drivers/char/i8k.ko
force
from /var/log/messages
May 11 12:39:11 XX kernel: [ 263.320306] i8k: unable to get SMM Dell
signature
May 11 12:40:52 XX kernel: [ 365.019189] i8k: unable to get SMM Dell
signature
May 11 12:40:52 XX kernel: [ 365.020148] i8k: unable to get SMM BIOS
version
May 11 12:40:52 XX kernel: [ 365.027736] Dell laptop SMM driver v1.14
21/02/2005 Massimo Dal Zotto (dz@debian.org)
I will guess that this detection issue is not due to the changes made by
Jean and Luca. This module may be at a dead end for my hardware.
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2011-05-11 17:59 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-14 3:46 [lm-sensors] Will there ever be EMC6w201 support? Harry G McGavran Jr
2011-04-14 7:57 ` Jean Delvare
2011-04-14 15:19 ` Harry G McGavran Jr
2011-04-14 15:24 ` Harry G McGavran Jr
2011-04-15 15:25 ` Harry G McGavran Jr
2011-05-05 10:10 ` Jean Delvare
2011-05-05 15:16 ` Harry G McGavran Jr
2011-05-05 16:30 ` Jean Delvare
2011-05-05 16:40 ` Harry G McGavran Jr
2011-05-06 15:24 ` Jeff Rickman
2011-05-07 7:46 ` Jean Delvare
2011-05-07 7:49 ` Jean Delvare
2011-05-07 11:47 ` Jean Delvare
2011-05-07 16:23 ` Harry G McGavran Jr
2011-05-07 16:26 ` Harry G McGavran Jr
2011-05-08 0:05 ` Harry G McGavran Jr
2011-05-08 4:09 ` Jeff Rickman
2011-05-08 6:27 ` Jean Delvare
2011-05-08 8:39 ` Hans de Goede
2011-05-08 9:18 ` Jean Delvare
2011-05-08 9:25 ` Jean Delvare
2011-05-08 11:19 ` Jeff Rickman
2011-05-08 12:29 ` Jean Delvare
2011-05-08 12:40 ` Jeff Rickman
2011-05-08 15:27 ` Harry G McGavran Jr
2011-05-09 3:32 ` Jeff Rickman
2011-05-09 19:42 ` Jean Delvare
2011-05-09 19:50 ` Harry G McGavran Jr
2011-05-09 20:07 ` Jean Delvare
2011-05-09 20:21 ` Harry G McGavran Jr
2011-05-09 20:24 ` Guenter Roeck
2011-05-09 21:06 ` Harry G McGavran Jr
2011-05-10 13:54 ` Jeff Rickman
2011-05-10 14:06 ` Jeff Rickman
2011-05-10 14:08 ` Jeff Rickman
2011-05-10 14:24 ` Jean Delvare
2011-05-10 15:05 ` Jeff Rickman
2011-05-11 12:43 ` Luca Tettamanti
2011-05-11 13:48 ` Luca Tettamanti
2011-05-11 14:15 ` Jean Delvare
2011-05-11 14:28 ` Luca Tettamanti
2011-05-11 15:08 ` Jean Delvare
2011-05-11 17:15 ` Harry G McGavran Jr
2011-05-11 17:23 ` Jeff Rickman
2011-05-11 17:59 ` Jeff Rickman [this message]
2011-05-11 19:03 ` Jean Delvare
2011-05-12 13:02 ` Luca Tettamanti
2011-05-12 13:38 ` Jean Delvare
2011-05-12 13:47 ` Jean Delvare
2011-05-12 13:49 ` Luca Tettamanti
2011-05-12 15:18 ` Harry G McGavran Jr
2011-05-12 16:00 ` Jean Delvare
2011-05-12 16:11 ` Harry G McGavran Jr
2011-05-12 20:37 ` Jeff Rickman
2011-05-12 23:49 ` Harry G McGavran Jr
2011-05-13 12:48 ` Luca Tettamanti
2011-05-13 15:01 ` Jean Delvare
2011-05-13 15:42 ` Harry G McGavran Jr
2011-05-13 16:44 ` Jean Delvare
2011-05-13 17:28 ` Harry G McGavran Jr
2011-05-13 17:47 ` Jeff Rickman
2011-05-13 19:36 ` Jean Delvare
2011-05-13 19:47 ` Harry G McGavran Jr
2011-05-13 21:10 ` Jean Delvare
2011-05-13 22:55 ` Harry G McGavran Jr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DCACE87.5070400@myamigos.us \
--to=jrickman@myamigos.us \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.