From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors]
Date: Wed, 06 Apr 2011 07:18:37 +0000 [thread overview]
Message-ID: <20110406071837.GA23562@ericsson.com> (raw)
In-Reply-To: <87ekb9s3tn.wl%info@wore.ma.cx>
On Wed, Apr 06, 2011 at 02:52:03AM -0400, R, Durgadoss wrote:
> Hi Guenter,
>
> Thanks for a detailed review and intuitive comments.
>
> > > From: Durgadoss R <durgadoss.r@intel.com>
> > >
> > > Date: Thu, 3 Mar 2011 02:37:40 +0530
> > > Subject: [PATCH:hwmon:v4:Resend]Merging_pkgtemp_with_coretemp
> > >
> > > This patch merges the pkgtemp driver with the coretemp driver.
> > > This merged driver creates one hwmon device per physical CPU i.e
> > > per Physical Package. Also, the sysfs interfaces per core are created
> > > as each core comes online and removed when it goes offline.
> > >
> > > Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
> > >
> >
> > After browsing through the code, I concluded that dynamic addition and removal
> > of CPUs likely won't work. So I did a quick test.
> >
> > echo 0 >/sys/devices/system/cpu/cpu2/online
> > sensors
> >
> > Result was as suspected:
> >
> > [ 84.518158] IP: [<ffffffffa00332a1>] show_label+0x21/0x70 [coretemp]
> > [ 84.525604] PGD 42b9e0067 PUD 42cc0a067 PMD 0
> > [ 84.530958] Oops: 0000 [#1] SMP
> > [ 84.534870] last sysfs file: /sys/devices/platform/coretemp.0/temp4_label
> > [ 84.542743] CPU 4
> > ...
> >
> > Oh well. I am quite sure I mentioned it before - _please_ test your code.
> > I am not your test group (and maybe you start to understand why it takes
> > so long to review your code).
> >
>
> I did test it on Corei5 and SNB. Anyway, next time when I submit this patch,
> I shall attach the dmesg logs.
>
Yes, but obviously you did not try adding/removing CPU cores....
[ ... ]
> > > + u8 crit_alarm;
> >
> > crit_alarm is only written to, thus unnecessary.
> >
> > [ question, though, is why you keep reading it. Is it expected to change ? ]
>
> When the temp1_input goes above temp1_crit, this crit_alarm is set to 1.
> When the temp1_input falls below temp1_crit, this crit_alarm is reset to 0.
Sure, but it is still a write-only variable, so what is the point ?
> As you mentioned below, I don't need this variable. I can just read and display.
>
Exactly.
> >
> > > + u8 max_alarm;
> >
> > max_alarm is not used anywhere, thus unnecessary.
>
> We need this when we add the threshold(max and max_hyst) support also.
> Hence I added.
>
In this case, you can add the variable when you need it. No need to do it now.
[ ... ]
> > > + if (err) {
> > > + dev_warn(dev,
> > > + "Unable to read IA32_TEMPERATURE_TARGET MSR\n");
> > > +
> > Extra blank line
> >
> > > + } else {
> > > + tdata->ttarget = tdata->tjmax -
> > > + (((eax >> 8) & 0xff) * 1000);
> > > + }
> >
> > { } are unnecessary.
>
> In one of the previous patches, I had a single statement split into two lines,
> Without Braces. And I got comment asking me to add braces to increase readability.
> With that in mind, I added braces.
> Shall remove if it is Ok to do so ;-)
>
Just keep it. Maybe it is better since those are multi-line statements.
> >
> > If you can not read ttarget, you still create tempX_max and display 0.
> > If ttarget is not supported, the attribute should not be created in the first
> > place.
> > The old code did this; any special reason for removing it ?
>
> Earlier when I tried the "Adding Threshold Support to Coretemp.patch",
> We discussed that temp1_max will have the Threshold1 value if ttarget is not supported.
> When we have the Threshold patch all _max things will be fixed.
>
> But if you say that will not work or not the right way to do, I can change
> the code accordingly.
>
At least add a comment indicating that this will be fixed in a subsequent patch.
> > need 17 entries in core_data[], but there are only 16).
>
> I missed it..Thanks for pointing it out..
>
> >
> > Even better would be to come up with a dynamic scheme which does not depend on
> > the number
> > of cores.
>
> Thought through this..But the way would be to use a ** and do dynamic mem allocation.
> Again, My opinion is that it will make the code complex.
> But, if you are Ok with this approach, I can implement this way.
>
I am fine with the static allocation. Just make sure you don't exceed the limits.
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-04-06 7:18 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-11 10:20 [lm-sensors] wore
2005-10-26 22:17 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-26 22:40 ` [lm-sensors] Greg KH
2005-10-26 22:46 ` [lm-sensors] Jean Delvare
2005-10-27 14:03 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 16:53 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 23:07 ` [lm-sensors] Jean Delvare
2005-10-27 23:43 ` [lm-sensors] Jean Delvare
2006-05-05 19:34 ` [lm-sensors] Dieter Jurzitza
2006-05-05 20:53 ` [lm-sensors] Dieter Jurzitza
2006-05-30 8:53 ` [lm-sensors] Laurent Pinchart
2006-12-03 8:22 ` [lm-sensors] Udo van den Heuvel
2006-12-03 8:38 ` [lm-sensors] Thomas Dohl
2006-12-03 8:49 ` [lm-sensors] Udo van den Heuvel
2006-12-03 20:20 ` [lm-sensors] Thomas Dohl
2007-01-08 7:39 ` [lm-sensors] Christophe de Rivière
2007-04-15 7:48 ` [lm-sensors] jk
2007-05-10 17:36 ` [lm-sensors] Dieter Rogiest
2007-05-10 18:02 ` [lm-sensors] Hans-Jürgen Koch
2007-05-10 18:46 ` [lm-sensors] Stephen Cormier
2007-05-10 19:31 ` [lm-sensors] Rudolf Marek
2007-05-10 20:34 ` [lm-sensors] Dieter Rogiest
2007-05-10 22:28 ` [lm-sensors] Rudolf Marek
2007-05-10 22:40 ` [lm-sensors] Dieter Rogiest
2007-07-24 12:06 ` [lm-sensors] Jean Delvare
2007-07-24 12:57 ` [lm-sensors] Christian Hohnstaedt
2007-07-24 13:09 ` [lm-sensors] Jean Delvare
2007-07-24 13:43 ` [lm-sensors] Christian Hohnstaedt
2007-08-12 11:13 ` [lm-sensors] Jean Delvare
2007-08-13 8:39 ` [lm-sensors] Christian Hohnstaedt
2007-08-13 12:29 ` [lm-sensors] Jean Delvare
2007-08-15 15:32 ` [lm-sensors] Christian Hohnstaedt
2007-08-15 19:28 ` [lm-sensors] Jean Delvare
2007-08-16 8:08 ` [lm-sensors] Christian Hohnstaedt
2007-10-07 18:38 ` [lm-sensors] Hans de Goede
2007-10-07 19:33 ` [lm-sensors] Mark M. Hoffman
2007-10-31 15:29 ` [lm-sensors] Hans de Goede
2008-06-01 10:15 ` [lm-sensors] Dominik Geyer
2008-09-17 13:50 ` [lm-sensors] Frank Myhr
2010-03-09 22:50 ` [lm-sensors] Phillip Pi
2010-10-31 7:42 ` [lm-sensors] Zamzit
2011-01-20 20:04 ` [lm-sensors] Guenter Roeck
2011-01-24 21:20 ` [lm-sensors] Yu, Fenghua
2011-03-28 18:11 ` [lm-sensors] R, Durgadoss
2011-04-05 17:47 ` [lm-sensors] Guenter Roeck
2011-04-06 6:54 ` [lm-sensors] R, Durgadoss
2011-04-06 7:18 ` Guenter Roeck [this message]
2011-06-21 9:44 ` [lm-sensors] Jay Alexander Fleming
2011-06-23 21:30 ` [lm-sensors] Valentijn Scholten
2011-06-24 22:01 ` [lm-sensors] Valentijn Scholten
2011-06-25 18:44 ` [lm-sensors] Valentijn Scholten
2011-10-01 13:38 ` [lm-sensors] Maryvonne JUDIT
2011-10-23 14:53 ` [lm-sensors] Malika et Christophe CHARBONNIER
2011-12-22 9:33 ` [lm-sensors] serge chartrain
-- strict thread matches above, loose matches on Subject: below --
2007-04-10 13:02 [lm-sensors] Hardware monitoring subsystem maintainer position is Jean Delvare
2007-04-12 5:57 ` [lm-sensors] Hardware monitoring subsystem maintainer Krzysztof Helt
2007-04-12 7:27 ` [lm-sensors] Hardware monitoring subsystem Hans de Goede
2007-04-15 2:07 ` [lm-sensors] Dmitry Torokhov
2008-09-18 8:12 [lm-sensors] + Sebastian Siewior
2008-09-18 8:15 ` Sebastian Siewior
2008-09-18 8:25 ` Andrew Morton
2008-09-18 9:08 ` Sebastian Siewior
2008-09-18 20:02 ` Jean Delvare
2008-09-18 21:13 ` Andrew Morton
2008-09-19 13:13 ` Jean Delvare
2009-06-12 15:25 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 15:31 ` [lm-sensors] " Michael S. Zick
2009-06-12 16:04 ` Michael S. Zick
2009-06-12 17:38 ` [lm-sensors] Michael S. Zick
2009-06-12 18:16 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 18:20 ` [lm-sensors] Michael S. Zick
2009-11-14 9:09 [lm-sensors] + Jean Delvare
2010-12-20 6:06 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-20 6:18 ` [lm-sensors] R, Durgadoss
2010-12-28 10:25 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-28 10:37 ` [lm-sensors] R, Durgadoss
2010-12-28 10:38 [lm-sensors] Patch[2/2]:hwmon:Adding_Threshold_Support_to_Coretemp.c R, Durgadoss
2011-01-04 19:40 ` [lm-sensors] Guenter Roeck
2011-01-03 11:52 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 11:54 ` [lm-sensors] R, Durgadoss
2011-01-03 15:03 ` [lm-sensors] Guenter Roeck
2011-01-03 15:03 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-03 15:11 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 15:23 ` [lm-sensors] R, Durgadoss
2011-01-03 15:38 ` [lm-sensors] Guenter Roeck
2011-01-03 15:38 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-04 8:56 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-04 9:08 ` [lm-sensors] R, Durgadoss
2011-01-04 8:20 ` [tip:x86/hwmon] x86, hwmon: Add core threshold notification to therm_throt.c tip-bot for R, Durgadoss
2011-01-04 8:29 ` R, Durgadoss
2011-01-20 7:57 [lm-sensors] patch[1/1]:hwmon:Adding_Threshold_support_to_coretemp R, Durgadoss
2011-01-20 22:17 ` [lm-sensors] Fenghua Yu
2011-01-21 2:26 ` [lm-sensors] Guenter Roeck
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=20110406071837.GA23562@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.