From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon,
Date: Tue, 17 Aug 2010 16:52:18 +0000 [thread overview]
Message-ID: <20100817185218.14b918de@hyperion.delvare> (raw)
In-Reply-To: <20100622084557.GA4524@loge.amd.com>
On Mon, 16 Aug 2010 11:21:38 +0200, Andreas Herrmann wrote:
> From: Andreas Herrmann <andreas.herrmann3@amd.com>
>
> The family check in k8temp is not required because the driver is
> already bound to a northbridge device only used with K8 CPUs.
This check was added by... you:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h»9a35f293a3c8b5d57253cdfe2f29fa2627e1b9
But yes, I agree it's not needed. And actually, the driver wasn't even
failing to bind if a different CPU model was found.
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> ---
> drivers/hwmon/k8temp.c | 49 +++++++++++++++++++++--------------------------
> 1 files changed, 22 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
> index bcb1a35..2210b21 100644
> --- a/drivers/hwmon/k8temp.c
> +++ b/drivers/hwmon/k8temp.c
> @@ -182,36 +182,31 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
> model = boot_cpu_data.x86_model;
> stepping = boot_cpu_data.x86_mask;
>
> - switch (boot_cpu_data.x86) {
> - case 0xf:
> - /* feature available since SH-C0, exclude older revisions */
> - if (((model = 4) && (stepping = 0)) ||
> - ((model = 5) && (stepping <= 1))) {
> - err = -ENODEV;
> - goto exit_free;
> - }
> + /* feature available since SH-C0, exclude older revisions */
> + if (((model = 4) && (stepping = 0)) ||
> + ((model = 5) && (stepping <= 1))) {
> + err = -ENODEV;
> + goto exit_free;
> + }
> +
> + /*
> + * AMD NPT family 0fh, i.e. RevF and RevG:
> + * meaning of SEL_CORE bit is inverted
> + */
> + if (model >= 0x40) {
> + data->swap_core_select = 1;
> + dev_warn(&pdev->dev, "Temperature readouts might be "
> + "wrong - check erratum #141\n");
> + }
>
> + if (is_rev_g_desktop(model))
> /*
> - * AMD NPT family 0fh, i.e. RevF and RevG:
> - * meaning of SEL_CORE bit is inverted
> + * RevG desktop CPUs (i.e. no socket S1G1 or
> + * ASB1 parts) need additional offset,
> + * otherwise reported temperature is below
> + * ambient temperature
> */
> - if (model >= 0x40) {
> - data->swap_core_select = 1;
> - dev_warn(&pdev->dev, "Temperature readouts might be "
> - "wrong - check erratum #141\n");
> - }
> -
> - if (is_rev_g_desktop(model))
> - /*
> - * RevG desktop CPUs (i.e. no socket S1G1 or
> - * ASB1 parts) need additional offset,
> - * otherwise reported temperature is below
> - * ambient temperature
> - */
> - data->temp_offset = 21000;
> -
> - break;
> - }
> + data->temp_offset = 21000;
>
> pci_read_config_byte(pdev, REG_TEMP, &scfg);
> scfg &= ~(SEL_PLACE | SEL_CORE); /* Select sensor 0, core0 */
Applied, thanks (modulo the missing curly braces, which I've added back
myself.)
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2010-08-17 16:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 8:45 [lm-sensors] [PATCH] hwmon, Andreas Herrmann
2010-06-22 11:24 ` Andreas Herrmann
2010-06-22 11:35 ` Jean Delvare
2010-06-22 14:51 ` Jean Delvare
2010-08-16 9:17 ` Andreas Herrmann
2010-08-16 9:21 ` Andreas Herrmann
2010-08-17 16:21 ` Jean Delvare
2010-08-17 16:52 ` Jean Delvare [this message]
2010-08-18 8:55 ` Andreas Herrmann
2010-08-18 9:10 ` Andreas Herrmann
2010-08-18 12:13 ` Andreas Herrmann
2010-08-18 12:25 ` Jean Delvare
2010-08-19 8:34 ` Jean Delvare
2010-08-19 10:00 ` Andreas Herrmann
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=20100817185218.14b918de@hyperion.delvare \
--to=khali@linux-fr.org \
--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.