linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Len Brown <len.brown@intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Aubrey Li <aubrey.li@linux.intel.com>,
	Amit Kucheria <amitk@kernel.org>, Andi Kleen <ak@linux.intel.com>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	"Ravi V. Shankar" <ravi.v.shankar@intel.com>,
	Ricardo Neri <ricardo.neri@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 3/7] thermal: intel: hfi: Minimally initialize the Hardware Feedback Interface
Date: Sun, 2 Jan 2022 13:46:47 -0800	[thread overview]
Message-ID: <20220102214647.GC14930@ranerica-svr.sc.intel.com> (raw)
In-Reply-To: <CAJZ5v0hQUMBw-0t0QzvCfOvzp0WEhE64xiU1JX2jkzdG5BJrMg@mail.gmail.com>

On Thu, Dec 30, 2021 at 07:43:22PM +0100, Rafael J. Wysocki wrote:
> On Mon, Dec 20, 2021 at 4:23 PM Ricardo Neri
> <ricardo.neri-calderon@linux.intel.com> wrote:
> >
> > The Intel Hardware Feedback Interface provides guidance to the operating
> > system about the performance and energy efficiency capabilities of each
> > CPU in the system. Capabilities are numbers between 0 and 255 where a
> > higher number represents a higher capability. For each CPU, energy
> > efficiency and performance are reported as separate capabilities.
> >
> > Hardware computes these capabilities based on the operating conditions of
> > the system such as power and thermal limits. These capabilities are shared
> > with the operating system in a table resident in memory. Each package in
> > the system has its own HFI instance. Every logical CPU in the package is
> > represented in the table. More than one logical CPUs may be represented in
> > a single table entry. When the hardware updates the table, it generates a
> > package-level thermal interrupt.
> >
> > The size and format of the HFI table depend on the supported features and
> > can only be determined at runtime. To minimally initialize the HFI, parse
> > its features and allocate one instance per package of a data structure with
> > the necessary parameters to read and navigate a local copy (i.e., owned by
> > the driver) of individual HFI tables.
> >
> > A subsequent changeset will provide per-CPU initialization and interrupt
> > handling.
> >
> > Cc: Andi Kleen <ak@linux.intel.com>
> > Cc: Aubrey Li <aubrey.li@linux.intel.com>
> > Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> > Cc: Tim Chen <tim.c.chen@linux.intel.com>
> > Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
> > Reviewed-by: Len Brown <len.brown@intel.com>
> > Co-developed by: Aubrey Li <aubrey.li@linux.intel.com>
> > Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> > Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
> > ---
> > Changes since v1:
> >   * Renamed X86_FEATURE_INTEL_HFI as X86_FEATURE_HFI. (Boris)
> >   * Reworked parsing of HFI features using bitfields instead of bitmasks.
> >     (PeterZ).
> >   * Removed hfi_instance::parsed as hfi_parse_features() is called only
> >     once via intel_hfi_init() via thermal_throttle_init_device().
> >     (Rafael)
> >   * Converted pr_err() to pr_debug(). (Srinivas, Rafael)
> >   * Removed unnecessary dependency on CONFIG_SCHED_MC.
> >   * Renamed hfi_instance::ts_counter as hfi_instance::timestamp.
> >   * Renamed hfi_instance::table_base as hfi_instance::local_table and
> >     relocated its definition to this patch.
> >   * Wrapped hfi_instance::timestamp and hfi_instance:local_table in an
> >     anonymous union, since both point at the same location.
> > ---
> >  drivers/thermal/intel/Kconfig       |  12 ++
> >  drivers/thermal/intel/Makefile      |   1 +
> >  drivers/thermal/intel/intel_hfi.c   | 175 ++++++++++++++++++++++++++++
> >  drivers/thermal/intel/intel_hfi.h   |  11 ++
> >  drivers/thermal/intel/therm_throt.c |   3 +
> >  5 files changed, 202 insertions(+)
> >  create mode 100644 drivers/thermal/intel/intel_hfi.c
> >  create mode 100644 drivers/thermal/intel/intel_hfi.h
> >
> > diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig
> > index c83ea5d04a1d..1a21ff60fdc7 100644
> > --- a/drivers/thermal/intel/Kconfig
> > +++ b/drivers/thermal/intel/Kconfig
> > @@ -99,3 +99,15 @@ config INTEL_MENLOW
> >           Intel Menlow platform.
> >
> >           If unsure, say N.
> > +
> > +config INTEL_HFI
> 
> This looks like it may be too general, because HFI is not a thermal-only thing.

> 
> Maybe cal it INTEL_HFI_THERMAL?

True. The *Enhanced* HFI introduces the concept of thread classes [1]. I was
planning to wrap this patchset, which parses the HFI table and deals
with updates, as INTEL_HFI. The code that deals with classes would be
wrapped as INTEL_EHFI.

After this comment, so you still think that INTEL_HFI_THERMAL makes more
sense?

Thanks and BR,
Ricardo


[1]. https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html , Chapter 13


  reply	other threads:[~2022-01-02 21:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 15:14 [PATCH v2 0/7] Thermal: Introduce the Hardware Feedback Interface for thermal and performance management Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 1/7] x86/Documentation: Describe the Intel Hardware Feedback Interface Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 2/7] x86: Add definitions for " Ricardo Neri
2021-12-30 18:03   ` Rafael J. Wysocki
2021-12-30 18:13     ` Borislav Petkov
2022-01-02 21:35       ` Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 3/7] thermal: intel: hfi: Minimally initialize the " Ricardo Neri
2021-12-30 18:43   ` Rafael J. Wysocki
2022-01-02 21:46     ` Ricardo Neri [this message]
2022-01-03  2:22       ` srinivas pandruvada
2022-01-03 18:24         ` Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 4/7] thermal: intel: hfi: Handle CPU hotplug events Ricardo Neri
2021-12-30 19:15   ` Rafael J. Wysocki
2022-01-02 21:34     ` Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 5/7] thermal: intel: hfi: Enable notification interrupt Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 6/7] thermal: netlink: Add a new event to notify CPU capabilities change Ricardo Neri
2021-12-20 15:14 ` [PATCH v2 7/7] thermal: intel: hfi: Notify user space for HFI events Ricardo Neri

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=20220102214647.GC14930@ranerica-svr.sc.intel.com \
    --to=ricardo.neri-calderon@linux.intel.com \
    --cc=ak@linux.intel.com \
    --cc=amitk@kernel.org \
    --cc=aubrey.li@linux.intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=ricardo.neri@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).