From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 3/3] hwmon: (k8temp) fix temperature
Date: Fri, 09 Jan 2009 14:41:02 +0000 [thread overview]
Message-ID: <20090109144102.GZ10725@alberich.amd.com> (raw)
In-Reply-To: <20081215231213.GC7013@alberich.amd.com>
On Fri, Jan 09, 2009 at 02:34:39PM +0100, Jean Delvare wrote:
> > @@ -176,6 +179,16 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
> > "wrong - check erratum #141\n");
> > }
> >
> > + if (((model >= 0x68) && (model != 0xc1)) &&
> > + !(model = 0x68) && !(model = 0x6c) &&
> > + !(model = 0x7c))
>
> This test is pretty confusing, with these extra parentheses and the mix
> of (a != b) and !(a = b). What about the following instead? As far as
> I can see, it leads to the same results, but is much more readable:
>
> if (model >= 0x69 &&
> !(model = 0xc1 || model = 0x6c || model = 0x7c))
>
Well, right you are.
When I wrote the check I had following in mind:
Check for RevG:
((model >= 0x68) && (model != 0xc1)) // excluding ATHLON64 FX, "JH-F3"
and after that exclude all mobile parts:
!(model = 0x68) && !(model = 0x6c) && !(model = 0x7c))
Of course this can be simplified.
> > + /*
> > + * RevG desktop CPUs (i.e. no socket S1G1 parts)
> > + * need additional offset, otherwise reported
> > + * temperature is below ambient temperature
> > + */
> > + data->temp_offset = 21000;
>
> If you apply the same offset to all sensors, you'll still obtain
> something odd:
>
> k8temp-pci-00c3
> Adapter: PCI adapter
> Core0 Temp:
> +38°C
> Core0 Temp:
> +24°C
> Core1 Temp:
> +42°C
> Core1 Temp:
> +26°C
>
> That's not terribly realistic, is it? Unless both sensors for a given
> core are very far apart -
> but I suspect each core is pretty small,
> isn't it?
"Far" is relative, isn't it ;-)
Guess this is from an idle system.
Please bring load on both cores and look at the temperature
differences again.
Regards,
Andreas
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2009-01-09 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 23:12 [lm-sensors] [PATCH 3/3] hwmon: (k8temp) fix temperature reporting Andreas Herrmann
2009-01-09 13:34 ` [lm-sensors] [PATCH 3/3] hwmon: (k8temp) fix temperature Jean Delvare
2009-01-09 14:41 ` Andreas Herrmann [this message]
2009-01-09 14:54 ` Jean Delvare
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=20090109144102.GZ10725@alberich.amd.com \
--to=andreas.herrmann3@amd.com \
--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.