public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Zhang Rui <rui.zhang@intel.com>
Cc: Thomas Renninger <trenn@suse.de>, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 2/2] Give ACPI hwmon thermal devices a name if BIOS provides one
Date: Mon, 25 Aug 2008 09:44:16 +0200	[thread overview]
Message-ID: <20080825094416.1dc9dc79@hyperion.delvare> (raw)
In-Reply-To: <1219629496.24775.22.camel@rzhang-dt>

Hi Thomas,

On Mon, 25 Aug 2008 09:58:16 +0800, Zhang Rui wrote:
> On Mon, 2008-08-25 at 06:11 +0800, Thomas Renninger wrote:
> > diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> > index fe07462..51a7077 100644
> > --- a/drivers/thermal/thermal_sys.c
> > +++ b/drivers/thermal/thermal_sys.c
> > @@ -371,8 +371,15 @@ thermal_add_hwmon_sysfs(struct
> > thermal_zone_device *tz)
> >         tz->hwmon = hwmon;
> >         hwmon->count++;
> > 
> > -       snprintf(tz->temp_input.name, THERMAL_NAME_LENGTH,
> > -                "temp%d_input", hwmon->count);
> > +       /*
> > +        * What happens if we get duplicate zone names from the BIOS?
> > +        * Is that allowed? If not, should we still just add the
> > +        * hwmon count at the end?
> > +        * tz->temp_input.name is char[16], this is ugly to do...
> > +        */
> > +       if (!tz->temp_input.name)
> > +               snprintf(tz->temp_input.name, THERMAL_NAME_LENGTH,
> > +                        "temp%d_input", hwmon->count);
>
> we should create a new attribute here rather than replacing the old one.
> the new hwmon sysfs I/F should be like:
> temp1_input:	current temperature
> temp1_crit:	critical threshold
> temp1_label:	string like "Processor Thermal Zone"

Rui is correct here, you don't want to use the string as a file name
(what your patch is currently doing) but provide it to libsensors
(amongst others) as the contents of a separate file (tempN_label.)
libsensors needs these standard file names, otherwise it can't guess
which is what.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2008-08-25  7:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 20:34 Thermal zone names Jean Delvare
2008-08-21  1:36 ` Zhang Rui
2008-08-21 15:48   ` Jean Delvare
2008-08-24 22:06     ` Thomas Renninger
2008-08-24 22:11     ` [RFC PATCH] Read name/location of thermal zone from ACPI function and pass it to hwmon Thomas Renninger
2008-08-24 22:11     ` [PATCH 1/2] patch acpi_introduce_evaluate_string.patch Thomas Renninger
2008-08-25  1:31       ` Zhao Yakui
2008-08-24 22:11     ` [PATCH 2/2] Give ACPI hwmon thermal devices a name if BIOS provides one Thomas Renninger
2008-08-24 22:20       ` Thomas Renninger
2008-08-25  2:15         ` Zhang Rui
2008-08-25 10:48           ` Thomas Renninger
2008-08-25  1:58       ` Zhang Rui
2008-08-25  7:44         ` Jean Delvare [this message]

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=20080825094416.1dc9dc79@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=trenn@suse.de \
    /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