From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (pmbus) Fix low limit temperature
Date: Sun, 11 Sep 2011 14:36:40 +0000 [thread overview]
Message-ID: <20110911143640.GA8723@ericsson.com> (raw)
In-Reply-To: <1315686474-29139-1-git-send-email-guenter.roeck@ericsson.com>
Hi Jean,
On Sun, Sep 11, 2011 at 03:34:19AM -0400, Jean Delvare wrote:
> Hi Guenter,
>
> On Sat, 10 Sep 2011 13:27:54 -0700, Guenter Roeck wrote:
> > Temperature alarms are detected by checking the alarm bit and comparing
> > temperature limits against the current temperature. For low limits, this
> > comparison needs to be reversed (temp < limit instead of temp > limit).
> > This was not taken into account, resulting in wrong alarms if a temperature
> > fell below a low limit.
> >
> > Fix by adding a low limit flag in the limit data structure. When creating the
> > sensor entry, the order of registers to compare is now reversed for low limits.
> >
> > Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> > ---
> > Candidate for -stable.
> >
> > drivers/hwmon/pmbus/pmbus_core.c | 10 +++++++++-
> > 1 files changed, 9 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> > index 1798f52..410aa12 100644
> > --- a/drivers/hwmon/pmbus/pmbus_core.c
> > +++ b/drivers/hwmon/pmbus/pmbus_core.c
> > @@ -978,6 +978,8 @@ static void pmbus_find_max_attr(struct i2c_client *client,
> > struct pmbus_limit_attr {
> > u16 reg; /* Limit register */
> > bool update; /* True if register needs updates */
> > + bool low; /* True if low limit; for limits with compare
> > + functions only */
> > const char *attr; /* Attribute name */
> > const char *alarm; /* Alarm attribute name */
> > u32 sbit; /* Alarm attribute status bit */
> > @@ -1029,7 +1031,8 @@ static bool pmbus_add_limit_attrs(struct i2c_client *client,
> > if (attr->compare) {
> > pmbus_add_boolean_cmp(data, name,
> > l->alarm, index,
> > - cbase, cindex,
> > + l->low ? cindex : cbase,
> > + l->low ? cbase : cindex,
> > attr->sbase + page, l->sbit);
> > } else {
> > pmbus_add_boolean_reg(data, name,
> > @@ -1366,16 +1369,19 @@ static const struct pmbus_sensor_attr power_attributes[] = {
> > static const struct pmbus_limit_attr temp_limit_attrs[] = {
> > {
> > .reg = PMBUS_UT_WARN_LIMIT,
> > + .low = true,
> > .attr = "min",
> > .alarm = "min_alarm",
> > .sbit = PB_TEMP_UT_WARNING,
> > }, {
> > .reg = PMBUS_UT_FAULT_LIMIT,
> > + .low = true,
> > .attr = "lcrit",
> > .alarm = "lcrit_alarm",
> > .sbit = PB_TEMP_UT_FAULT,
> > }, {
> > .reg = PMBUS_OT_WARN_LIMIT,
> > + .low = true,
> > .attr = "max",
> > .alarm = "max_alarm",
> > .sbit = PB_TEMP_OT_WARNING,
>
> This one doesn't look like a "low lmit", does it?
>
Not really. I'll resend.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-09-11 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-10 20:27 [lm-sensors] [PATCH] hwmon: (pmbus) Fix low limit temperature alarms Guenter Roeck
2011-09-11 7:34 ` [lm-sensors] [PATCH] hwmon: (pmbus) Fix low limit temperature Jean Delvare
2011-09-11 14:36 ` Guenter Roeck [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=20110911143640.GA8723@ericsson.com \
--to=guenter.roeck@ericsson.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.