All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Patch v5 Merge Pkgtemp with coretemp
Date: Wed, 27 Apr 2011 14:31:12 +0000	[thread overview]
Message-ID: <20110427143112.GA23165@ericsson.com> (raw)
In-Reply-To: <D6D887BA8C9DFF48B5233887EF046541095182D2CC@bgsmsx502.gar.corp.intel.com>

Hi Durga,

On Wed, Apr 27, 2011 at 02:24:19AM -0400, R, Durgadoss wrote:
> Hi Guenter,
> 
> Thanks for the comments.
> Shall fix them and resubmit the patch.
> But, I need clarifications on few things here.
> 
> > 
> > Functionality-wise, there is still a problem: If one core of a HT CPU
> > is taken offline, the driver used to replace it with its sibling if
> > it was online. This way the core's temperature was still displayed as
> > long as at least one of the HT cores was online. This is no longer the case.
> 
> I knew it..but I was thinking to do it as a separate patch,
> Once this gets acked. If we have to add this support, the following is
> my way of doing it:
> When a cpu with a core_id is offlined,
> check whether there is any other cpu with same core_id(by looping
> through for_each_online_cpu()). If so, get that online.
> Please let me know if there are any alternatives.
> 
The original code (which you deleted) handled that case pretty well.

	for_each_cpu(i, cpu_sibling_mask(cpu))
		if (i != cpu && !coretemp_device_add(i))
			break;

> > You should update Documentation/hwmon/coretemp to reflect your changes.
> 
> Should that be a separate patch or part of this patch ?
> 
Part of this patch.

> > > +       /*
> > > +        * Initialize ttarget value. Eventually this will be
> > > +        * initialized with the value from MSR_IA32_THERM_INTERRUPT
> > > +        * register. If IA32_TEMPERATURE_TARGET is supported, this
> > > +        * value will be over written below.
> > > +        * To Do: Patch to initialize ttarget from MSR_IA32_THERM_INTERRUPT
> > > +        */
> > Do you plan to submit a separate patch to address this ?
> 
> Yes. I already submitted a patch for this. Since we wanted any new patch
> On coretemp should be done only after merging pkgtemp, I withheld that patch.
> 
Maybe it wouild make sense to mention that in your intro (not part of the commit log).

> > >         for_each_online_cpu(i)
> > > -               coretemp_device_add(i);
> > > +               get_core_online(i);
> > >
> > This code should now be in the probe function, and be called before
> > the hwmon device is registered.
> 
> Our probe function itself is called by coretemp_device_add()
> which in turn is called by get_core_online(). So, If I move this code
> to probe, not sure how the probe itself will be called. Hence, I feel
> this code should be here only. Let me know your thoughts.
> 
Problem is that get_core_online() handles both adding a new processor and adding
a new core, which results in a lot of if statements and isn't really clean.

Maybe you can separate adding processors (or platform devices), which needs to be 
handled from the _init function, and adding cores, which should be handled from within 
the platform device, ie from the _probe function. This way, the _init function would
only create the platform devices (one per processor), and the _probe function would
initialize the per-processor information, create the package sensor attributes, create
the core attributes, and finally register with hwmon.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      parent reply	other threads:[~2011-04-27 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 13:08 [lm-sensors] Patch v5 Merge Pkgtemp with coretemp R, Durgadoss
2011-04-26 20:46 ` Guenter Roeck
2011-04-27  6:36 ` R, Durgadoss
2011-04-27 14:31 ` 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=20110427143112.GA23165@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.