FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-05-2010, 09:58 AM
Andy Whitcroft
 
Default hwmon: (it87) Add support for the ITE IT8720F Bug: #357766

On Tue, Mar 02, 2010 at 01:37:48PM -0600, David Partington wrote:

> I want to test it, but do not have the necessary .h files. I do not
> believe the whole kernel needs to be recomplied as the it87 module is a
> .ko (kernel object) file that is loaded via modprobe or via the modules
> file in /etc. If you can point me to were to get the necessary .h files
> that would be great. I did download the .git tool and have reviewed the
> Kernel Team Git Guide. Not being a member of the Kernel team, I did not
> think I could use this approach.

Did you manage to test Stefan's patch? It is unclear whether you needed
a test kernel made with this applied. Please let us know how you got on.

-apw

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 03-06-2010, 05:45 PM
David Partington
 
Default hwmon: (it87) Add support for the ITE IT8720F Bug: #357766

Andy and team,



Thanks for your inquiry as to testing.



The short answer is yes but the testing was not as simple as one would
expect.* I am sure I am not saying anything new.

At the end of this message is the final patch for review and
submission.



In the testing process I discover several additional issues than just
the simple juxtaposition the definition.

Firstly,* I had to learn how to build the kernel.* This was not too bad
and was a good learning experience.



Secondly, once I changed just the use of the definition the vid value
became worse rather than better.* I finally discovered this was due the
original logic to get the vid value from the superio chip.* I discover
this while adding code to dump the raw value to the kern.log.* I found
a document called "Kernel driver it87" authored by Christophe Gauthron
<chrisg@0-in.com> and* Jean Delvare <khali@linux-fr.org>
that explained the following:

"The IT8718F also features VID inputs (up to 8 pins)
but the value is stored in the Super-I/O configuration space. Due to
technical limitations, this value can currently only be read once at
initialization time, so the driver won't notice and report changes in
the VID value."


So, as you will notice in the patch, the acquisition of the VID value
was changed, utilizing the code that was added to support it8718 and
it8720 devices.* The pretty much explains the changes in the it87.c
nodules.



The sad thing is after this the VID value return was now back to the
original error.* As you might understand I was not happy after all of
my work to get a correct value but by using debug statements printed in
the kern.log and an isadump I could verify that the module functioned
properly see below:



$ sudo isadump -k 0x87,0x01,0x55,0x55 0x2e 0x2f 7

WARNING! Running this program can cause system crashes, data loss and
worse!

I will probe address register 0x2e and data register 0x2f.

Probing bank 7 using bank register 0x07.

Continue? [Y/n] y

**** 0* 1* 2* 3* 4* 5* 6* 7* 8* 9* a* b* c* d* e* f

00: 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00

10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

20: 87 16 03 11 00 40 3f 20 00 08 00 00 1f 00 00 00

30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

60: 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00

70: 00 00 00 38 00 04 00 00 00 00 00 00 00 00 00 00

80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

b0: 00 00 00 00 08 00 00 00 00 00 00 00 08 00 00 00

c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

f0: 10 00 00 00 1d 00 00 00 00 01 00 00 20 00 00 00


kernel: [** 35.541442] CPU1 attaching sched-domain:

kernel: [** 35.541446]* domain 0: span 0-1 level MC

kernel: [** 35.541450]** groups: 1 0

kernel: [** 42.250041] eth0: no IPv6 routers present

kernel: [* 112.139569] it87: Raw VID 32 VRM 26

kernel: [* 124.078242] it87: Raw VID 32 VRM 26

kernel: [11598.898494] it87: Raw VID 32 VRM 26

kernel: [11615.138678] it87: Raw VID 32 VRM 26

kernel: [11657.268677] it87: Raw VID 32 VRM 26




Through some additional research, I discovered a module called
hwmon-vid.c.* This module has a set of algorithms to convert the VID
bit value to a voltage value.* My processor is an AMD 10h Processor -
Athlon II X2 240.* The hwmon-vid.c module defaults this processor
family to the older Fh product line.* Thus the formula used generated
and incorrect answer.



Since I live in Austin, Texas close to the AMD Engineering center, I
ask an old colleague to point me to a good document that AMD recommend
for the conversion.* So with this document in hand, I modified
hwmon-vid.c to include a case (26) for 10h processor.** With this
modified version I completed my testing to my satisfaction.* See below:



Sensors output before version:

acpitz-virtual-0

Adapter: Virtual device

temp1:****** +40.0C* (crit = +95.0C)*****************



it8716-isa-0290

Adapter: ISA adapter

VCore:****** +1.15 V* (min =* +1.36 V, max =* +1.50 V)** ALARM

VDDR:******* +1.22 V* (min =* +1.14 V, max =* +1.26 V)**

+3.3V:****** +3.33 V* (min =* +3.14 V, max =* +3.47 V)**

+5V:******** +4.87 V* (min =* +4.76 V, max =* +5.24 V)**

+12V:****** +12.16 V* (min = +11.39 V, max = +12.61 V)**

-5V:******** -5.06 V* (min =* -5.26 V, max =* -4.75 V)**

5VSB:******* +4.70 V* (min =* +4.65 V, max =* +5.35 V)**

VBat:******* +3.20 V

CPU Fan:*** 1167 RPM* (min = 1000 RPM)

Case Fan:** 2556 RPM* (min = 1997 RPM)

CPU Temp:*** +28.0C* (low* = +20.0C, high = +60.0C)* sensor =
thermal diode

M/B Temp:*** +15.0C* (low* = +10.0C, high = +50.0C)* sensor =
thermal diode

cpu0_vid:** +0.763 V




Sensors output after version:

acpitz-virtual-0

Adapter: Virtual device

temp1:****** +40.0C* (crit = +95.0C)*****************



it8716-isa-0290

Adapter: ISA adapter

VCore:****** +1.15 V* (min =* +1.12 V, max =* +1.25 V)**

VDDR:******* +1.22 V* (min =* +1.14 V, max =* +1.26 V)**

+3.3V:****** +3.33 V* (min =* +3.14 V, max =* +3.47 V)**

+5V:******** +4.87 V* (min =* +4.76 V, max =* +5.24 V)**

+12V:****** +12.16 V* (min = +11.39 V, max = +12.61 V)**

-5V:******** -5.06 V* (min =* -5.26 V, max =* -4.75 V)**

5VSB:******* +4.70 V* (min =* +4.65 V, max =* +5.35 V)**

VBat:******* +3.20 V

CPU Fan:*** 1053 RPM* (min = 1000 RPM)

Case Fan:** 2556 RPM* (min = 1997 RPM)

CPU Temp:*** +28.0C* (low* = +20.0C, high = +60.0C)* sensor =
thermal diode

M/B Temp:*** +15.0C* (low* = +10.0C, high = +50.0C)* sensor =
thermal diode

cpu0_vid:** +1.182 V


If the team is interested in the modified hwmon-vid.c module I can post
a new patch indicating the changes that I made. I promise not to create
an additional diatribe on this change as I have done in this message.



After completing this testing, I certainly have a deeper respect for
the kernel team.



Regards, David



Final patch:

--- it87-org.c*** 2010-01-27 19:26:31.000000000 -0600

+++ it87.c*** 2010-03-06 10:15:57.327240000 -0600

@@ -855,7 +855,7 @@ static ssize_t

*show_vid_reg(struct device *dev, struct device_attribute *attr, char
*buf)

*{

**** struct it87_data *data = "">
-*** return sprintf(buf, "%ld
", (long) vid_from_reg(data->vid,
data->vrm));

+*** return sprintf(buf, "%d
", vid_from_reg(data->vid,
data->vrm));

*}

*static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);

@@ -1033,8 +1032,12 @@ static int __init it87_find(unsigned sho

*

**** *** superio_select(GPIO);

**** *** if (sio_data->type == it8718 || sio_data->type == it8720)

+*** *** *** sio_data->vid_value = superio_inb(IT87_REG_VID);

+*** *** else

+ *** *** *** sio_data->vid_value = superio_inb(IT87_SIO_VID_REG);

+

+*** *** sio_data->vid_value &= 0x3f;

+

**** *** reg = superio_inb(IT87_SIO_PINX2_REG);

**** *** if (reg & (1 << 0))

**** *** *** pr_info("it87: in3 is VCC (+5V)
");

@@ -1523,15 +1526,7 @@ static struct it87_data *it87_update_dev

**** *** data->fan_ctl = it87_read_value(data, IT87_REG_FAN_CTL);

*

**** *** data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE);

-*** *** /* The 8705 does not have VID capability.

-*** *** ** The 8718 and the 8720 don't use IT87_REG_VID for the

-*** *** ** same purpose. */

-*** *** if (data->type == it8712 || data->type == it8716) {

-*** *** *** data->vid = it87_read_value(data, IT87_REG_VID);

-*** *** *** /* The older IT8712F revisions had only 5 VID pins,

-*** *** *** ** but we assume it is always safe to read 6 bits. */

-*** *** *** data->vid &= 0x3f;

-*** *** }

+

**** *** data->last_updated = jiffies;

**** *** data->valid = 1;

**** }




On 03/05/2010 04:58 AM, Andy Whitcroft wrote:

On Tue, Mar 02, 2010 at 01:37:48PM -0600, David Partington wrote:



I want to test it, but do not have the necessary .h files. I do not
believe the whole kernel needs to be recomplied as the it87 module is a
.ko (kernel object) file that is loaded via modprobe or via the modules
file in /etc. If you can point me to were to get the necessary .h files
that would be great. I did download the .git tool and have reviewed the
Kernel Team Git Guide. Not being a member of the Kernel team, I did not
think I could use this approach.



Did you manage to test Stefan's patch? It is unclear whether you needed
a test kernel made with this applied. Please let us know how you got on.

-apw






--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 11:36 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org