public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Gabriele Mazzotta <gabriele.mzt@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Steven Honeyman <stevenhoneyman@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i8k: Add support for temperature sensor labels
Date: Sun, 30 Nov 2014 10:53:39 +0100	[thread overview]
Message-ID: <201411301053.40222@pali> (raw)
In-Reply-To: <547A5FB3.6030502@roeck-us.net>

[-- Attachment #1: Type: Text/Plain, Size: 5554 bytes --]

On Sunday 30 November 2014 01:07:15 Guenter Roeck wrote:
> On 11/29/2014 11:07 AM, Pali Rohár wrote:
> > On Saturday 29 November 2014 19:58:28 Guenter Roeck wrote:
> >> On 11/29/2014 10:27 AM, Gabriele Mazzotta wrote:
> >>> On Saturday 29 November 2014 18:18:18 Pali Rohár wrote:
> >>>> On Saturday 29 November 2014 18:07:19 Gabriele Mazzotta
> > 
> > wrote:
> >>>>> On Saturday 29 November 2014 17:09:35 Pali Rohár wrote:
> >>>>>> On Saturday 29 November 2014 17:04:07 Pali Rohár wrote:
> >>>>>>> This patch adds labels for temperature sensors if SMM
> >>>>>>> function with EAX register 0x11a3 reports it. These
> >>>>>>> informations was taken from DOS binary NBSVC.MDM.
> >>>>>>> 
> >>>>>>> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> >>>>>>> ---
> >>>>>>> 
> >>>>>>>    drivers/char/i8k.c |  110
> >>>>>>> 
> >>>>>>> +++++++++++++++++++++++++++++++++++++++++----------- 1
> >>>>>>> file changed, 88 insertions(+), 22 deletions(-)
> >>>>>> 
> >>>>>> I tested patch on Latitude E6440 and i8k CPU & GPU
> >>>>>> temps match intel coretemp & amd radeion temps.
> >>>>>> 
> >>>>>> But I would like if somebody with other Dell laptop can
> >>>>>> test if temperature labels are correct...
> >>>>> 
> >>>>> I tested it on my XPS13 9333, here what sensors outputs:
> >>>>> 
> >>>>> acpitz-virtual-0
> >>>>> Adapter: Virtual device
> >>>>> temp1:        +27.8°C  (crit = +105.0°C)
> >>>>> temp2:        +29.8°C  (crit = +105.0°C)
> >>>>> 
> >>>>> coretemp-isa-0000
> >>>>> Adapter: ISA adapter
> >>>>> Physical id 0:  +62.0°C  (high = +100.0°C, crit =
> >>>>> +100.0°C) Core 0:         +62.0°C  (high = +100.0°C,
> >>>>> crit = +100.0°C) Core 1:         +61.0°C  (high =
> >>>>> +100.0°C, crit = +100.0°C)
> >>>>> 
> >>>>> i8k-virtual-0
> >>>>> Adapter: Virtual device
> >>>>> fan2:           0 RPM
> >>>>> CPU:          +62.0°C
> >>>>> Ambient:      +49.0°C
> >>>>> SODIMM:       +46.0°C
> >>>>> temp4:            N/A
> >>>>> 
> >>>>> CPU seems to be correct, but I can't say anything on
> >>>>> Ambient and SODIMM. temp4 is constantly equal to SODIMM
> >>>>> without this patch, so I'd say N/A is correct.
> >>>>> 
> >>>>> 
> >>>>> Gabriele
> >>>> 
> >>>> It is unknown for me how to directly read Ambient and
> >>>> SODIMM temperatures (without Dell SMM functions). So we
> >>>> can only trust Dell SMM that it reporting correct values
> >>>> and type is really Ambient and SODIMM.
> >>>> 
> >>>> And about temp4:
> >>>> 
> >>>> Label is not set when SMM function fails. Original DOS
> >>>> NBSVC.MDM just ignore all sensors for which SMM type
> >>>> function fails.
> >>>> 
> >>>> This patch should not disable any sensor, so if you
> >>>> previously had some value (<= 128°C) and now not, then
> >>>> there is some bug.
> >>>> 
> >>>> Can you test this patch?
> >>>> https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-> >>>> mi sc.git/comm
> >>>> it/?h=char-misc-testing&id=723493ca59c8d81fed3e7f261165fe
> >>>> e 493a29ffa
> >>>> 
> >>>> It is possible that same value is caused by incorrect use
> >>>> of prev[] array which should be fixed by above patch.
> >>>> 
> >>>> Can you test i8k with and without above patch?
> >>> 
> >>> I did some more tests. What I think is happening is that
> >>> temp4_label returns -22, so I sensors prints N/A without
> >>> actually reading temp4_input.
> >>> 
> >>> I'm doing some tests to understand what's going on with
> >>> temp4_input. It reports the value of the last temp*_input
> >>> I read. If I read it right after I loaded i8k, I get an
> >>> error (-22).
> >>> 
> >>> The same doesn't happen for temp3_label, which constantly
> >>> returns -22.
> >>> 
> >>> I already had
> >>> https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-m
> >>> i
> >>> sc.git/commit/?h=char-misc-testing&id=723493ca59c8d81fed3
> >>> e7f 261165fee493a29ffa applied. Without it, things seem
> >>> not to change much. I either get an error (-22) or some
> >>> incorrect values (for now always 1000) when I read
> >>> temp4_input right after i8k was loaded. Once I read some
> >>> other temp*_input, I always get the last value read.
> >> 
> >> I am seeing exactly the same behavior on an XPS13.
> >> 
> >> Guenter
> > 
> > Original Dell DOS executable ignores all temperature sensors
> > if type SMM function fails (if I decoded and understand
> > that DOS assembler code correctly). So maybe we should do
> > same...
> > 
> > But because our i8k.c code ignores sensor only if it returns
> > invalid temperature, there could be possible regression that
> > on same machines type SMM function is not implemented or
> > not working...
> > 
> > What do you think?
> 
> Tested with XPS13, Studio 1555 (with GPU), and XPS M140.
> Reading the type works with all of them. The Studio 1555
> reports the GPU temperature in temp4. The M140 is quite old
> (about 10 years), so I guess we can be reasonably sure that
> all laptops currently in use support reporting the type.
> 

Good. Then I will split this patch into two parts. One which adds 
labels and one which change init code to register only those 
sensors which have valid type.

> Do you know what is returned for the type if the GPU is turned
> off on a system with GPU ? I think that is the only open
> question.
> 

Yes, on my E6440 in both cases when GPU is turned off and on is 
returned same type (GPU). So this does not help us.

> Thanks,
> Guenter

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-11-30  9:53 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-29 16:04 [PATCH] i8k: Add support for temperature sensor labels Pali Rohár
2014-11-29 16:09 ` Pali Rohár
2014-11-29 16:24   ` Guenter Roeck
2014-11-29 16:32     ` Pali Rohár
2014-11-29 16:37   ` Steven Honeyman
2014-11-29 17:07   ` Gabriele Mazzotta
2014-11-29 17:18     ` Pali Rohár
2014-11-29 18:27       ` Gabriele Mazzotta
2014-11-29 18:58         ` Guenter Roeck
2014-11-29 19:07           ` Pali Rohár
2014-11-29 21:34             ` Guenter Roeck
2014-11-30  0:07             ` Guenter Roeck
2014-11-30  9:53               ` Pali Rohár [this message]
2014-11-30 16:00                 ` Guenter Roeck
2014-11-30 17:44                   ` Pali Rohár
2014-11-30 17:54                     ` Guenter Roeck
2014-11-30 18:00                       ` Pali Rohár
2014-11-30 18:22                         ` Guenter Roeck
2014-11-30  1:25             ` Guenter Roeck
2014-11-30 10:11               ` Pali Rohár
2014-11-30 16:04                 ` Guenter Roeck
2014-11-29 16:24 ` Guenter Roeck
2014-11-29 16:30   ` Pali Rohár
2014-11-29 18:15     ` Guenter Roeck
2014-11-29 17:43 ` Greg Kroah-Hartman
2014-11-29 17:49   ` Pali Rohár
2014-11-29 17:51     ` Greg Kroah-Hartman
2014-11-29 18:04       ` Pali Rohár
2014-12-02 13:23         ` Jean Delvare
2014-12-02 14:26           ` Guenter Roeck
2014-12-03  9:09             ` Jean Delvare
2014-12-03  9:25               ` Pali Rohár
2014-12-03 10:11                 ` Jean Delvare
2014-12-03 19:14               ` Guenter Roeck
2014-12-04 10:16                 ` Jean Delvare
2014-11-29 18:05       ` Guenter Roeck
2014-11-29 18:00   ` Guenter Roeck

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=201411301053.40222@pali \
    --to=pali.rohar@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gabriele.mzt@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=stevenhoneyman@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox