From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCHv2 1/1] Hwmon: Add core_pkg Threshold
Date: Mon, 13 Jun 2011 17:14:04 +0000 [thread overview]
Message-ID: <20110613171404.GC2629@ericsson.com> (raw)
In-Reply-To: <1307791723-28272-1-git-send-email-durgadoss.r@intel.com>
Hi Durga,
On Sat, Jun 11, 2011 at 07:28:43AM -0400, Durgadoss R wrote:
> This patch adds the core and pkg support to coretemp.
> These thresholds can be configured via the sysfs interfaces tempX_max
> and tempX_max_hyst. An interrupt is generated when CPU temperature reaches
> or crosses above tempX_max OR drops below tempX_max_hyst.
>
> This patch is based on the documentation in IA Manual vol 3A, that can be
> downloaded from here:
> http://download.intel.com/design/processor/manuals/253668.pdf
>
> Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
[ ... ]
> + size_t count) = { NULL, NULL, NULL, NULL, NULL,
> + store_ttarget, store_tmin };
> + static const char *names[TOTAL_ATTRS] = {
> "temp%d_label", "temp%d_crit_alarm",
> - "temp%d_max", "temp%d_input",
> - "temp%d_crit" };
> + "temp%d_imput", "temp%d_crit",
s/imput/input/
Seems like we need another round of detailed testing ...
> + "temp%d_max_alarm", "temp%d_max",
> + "temp%d_max_hyst" };
>
> - for (i = 0; i < MAX_ATTRS; i++) {
> + for (i = 0; i < tdata->attr_size; i++) {
> snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, names[i],
> attr_no);
> sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
> tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
> tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO;
> + if (rw_ptr[i])
> + tdata->sd_attrs[i].dev_attr.attr.mode |= S_IWUSR;
> tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
> - tdata->sd_attrs[i].dev_attr.store = NULL;
> + tdata->sd_attrs[i].dev_attr.store = rw_ptr[i];
Since you check for rw_ptr above anyway, you might as well move this assignment
into the if branch above. The NULL assignment is not necessary anyway, since the
entire structure is pre-initialized from kzalloc().
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2011-06-13 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 6:03 [lm-sensors] [PATCHv2 1/1] Hwmon: Add core_pkg Threshold Support to Durgadoss R
2011-06-13 17:14 ` Guenter Roeck [this message]
2011-07-05 9:38 ` [lm-sensors] [PATCHv2 1/1] Hwmon: Add core_pkg Threshold Jean Delvare
2011-07-05 10:15 ` R, Durgadoss
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=20110613171404.GC2629@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.