Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: "Winiarska, Iwona" <iwona.winiarska@intel.com>
To: "linux@roeck-us.net" <linux@roeck-us.net>,
	"changhuang.liang@starfivetech.com"
	<changhuang.liang@starfivetech.com>
Cc: "linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH v3 6/6] hwmon: (peci/dimmtemp) Add support for Granite Rapids (GNR)
Date: Fri, 16 Oct 2026 20:10:44 +0000	[thread overview]
Message-ID: <fd837f02c718bea1540cca2ad352880d9f89c67d.camel@intel.com> (raw)
In-Reply-To: <20261008100623.7085-7-changhuang.liang@starfivetech.com>

On Thu, 2026-10-08 at 03:06 -0700, Changhuang Liang wrote:
> Add support for Granite Rapids (GNR) platform in PECI DIMM temperature
> monitoring driver.
> 
> The GNR platform has different DIMM topology from previous generations,
> with 12 channel ranks (CHAN_RANK_MAX_ON_GNR) and 2 DIMM indexes per
> channel. Define these new constants and update CHAN_RANK_MAX to use
> the GNR value since it represents the maximum across all supported
> platforms.
> 
> Since the current peci core does not support domains, accessing GNR's
> DIMM_TEMP_MAX and DIMM_TEMP_CRIT via PECI commands will be rejected
> and return completion code 0x90 (invalid request). To handle this, the
> read_thresholds callback is not defined for GNR, and the visibility
> logic is updated to skip exposing the max and crit temperature
> attributes.
> 
> The minimum PECI revision required for GNR is 0x42.
> 
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>

Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>

Thanks
-Iwona

> ---
>  drivers/hwmon/peci/dimmtemp.c | 33 +++++++++++++++++++++++++++++----
>  1 file changed, 29 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/peci/dimmtemp.c b/drivers/hwmon/peci/dimmtemp.c
> index bd3e8715dfec..791a8e866081 100644
> --- a/drivers/hwmon/peci/dimmtemp.c
> +++ b/drivers/hwmon/peci/dimmtemp.c
> @@ -34,8 +34,10 @@
>  #define DIMM_IDX_MAX_ON_SPR	2
>  #define CHAN_RANK_MAX_ON_EMR	8
>  #define DIMM_IDX_MAX_ON_EMR	2
> +#define CHAN_RANK_MAX_ON_GNR	12
> +#define DIMM_IDX_MAX_ON_GNR	2
>  
> -#define CHAN_RANK_MAX		CHAN_RANK_MAX_ON_HSX
> +#define CHAN_RANK_MAX		CHAN_RANK_MAX_ON_GNR
>  #define DIMM_IDX_MAX		DIMM_IDX_MAX_ON_HSX
>  #define DIMM_NUMS_MAX		(CHAN_RANK_MAX * DIMM_IDX_MAX)
>  
> @@ -198,10 +200,18 @@ static umode_t dimmtemp_is_visible(const void *data,
> enum hwmon_sensor_types typ
>  {
>  	const struct peci_dimmtemp *priv = data;
>  
> -	if (test_bit(channel, priv->dimm_mask))
> -		return 0444;
> +	if (!test_bit(channel, priv->dimm_mask))
> +		return 0;
>  
> -	return 0;
> +	/*
> +	 * Some platforms do not provide the DIMM temperature thresholds over
> +	 * PECI - do not expose the corresponding attributes there.
> +	 */
> +	if ((attr == hwmon_temp_max || attr == hwmon_temp_crit) &&
> +	    !priv->gen_info->read_thresholds)
> +		return 0;
> +
> +	return 0444;
>  }
>  
>  static const struct hwmon_ops peci_dimmtemp_ops = {
> @@ -626,6 +636,17 @@ static const struct dimm_info dimm_emr = {
>  	.read_thresholds = &read_thresholds_emr,
>  };
>  
> +static const struct dimm_info dimm_gnr = {
> +	.chan_rank_max	= CHAN_RANK_MAX_ON_GNR,
> +	.dimm_idx_max	= DIMM_IDX_MAX_ON_GNR,
> +	.min_peci_revision = 0x42,
> +	/*
> +	 * Reading DIMM_TEMP_MAX/DIMM_TEMP_CRIT over PECI is answered with
> +	 * completion code 0x90 (invalid request) on Granite Rapids, so the
> +	 * threshold attributes are not exposed on this platform.
> +	 */
> +};
> +
>  static const struct auxiliary_device_id peci_dimmtemp_ids[] = {
>  	{
>  		.name = "peci_cpu.dimmtemp.hsx",
> @@ -659,6 +680,10 @@ static const struct auxiliary_device_id
> peci_dimmtemp_ids[] = {
>  		.name = "peci_cpu.dimmtemp.emr",
>  		.driver_data = (kernel_ulong_t)&dimm_emr,
>  	},
> +	{
> +		.name = "peci_cpu.dimmtemp.gnr",
> +		.driver_data = (kernel_ulong_t)&dimm_gnr,
> +	},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(auxiliary, peci_dimmtemp_ids);

      parent reply	other threads:[~2026-10-16 20:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 10:06 [PATCH v3 0/6] Add StarFive JHB100 PECI support Changhuang Liang
2026-10-08 10:06 ` [PATCH v3 1/6] dt-bindings: peci: Add StarFive JHB100 PECI controller Changhuang Liang
2026-10-08 11:45   ` sashiko-bot
2026-10-16 20:08   ` Winiarska, Iwona
2026-10-08 10:06 ` [PATCH v3 2/6] peci: controller: Add StarFive JHB100 PECI driver Changhuang Liang
2026-10-08 11:52   ` sashiko-bot
2026-10-16 20:09   ` Winiarska, Iwona
2026-10-08 10:06 ` [PATCH v3 3/6] peci: Add support for PECI CC 0x83 retry condition Changhuang Liang
2026-10-08 11:51   ` sashiko-bot
2026-10-16 20:09   ` Winiarska, Iwona
2026-10-08 10:06 ` [PATCH v3 4/6] peci: cpu: Add Intel Granite Rapids support Changhuang Liang
2026-10-08 11:49   ` sashiko-bot
2026-10-16 20:09   ` Winiarska, Iwona
2026-10-08 10:06 ` [PATCH v3 5/6] hwmon: (peci/cputemp) Add support for Granite Rapids (GNR) Changhuang Liang
2026-10-08 11:48   ` sashiko-bot
2026-10-16 20:10   ` Winiarska, Iwona
2026-10-08 10:06 ` [PATCH v3 6/6] hwmon: (peci/dimmtemp) " Changhuang Liang
2026-10-08 11:48   ` sashiko-bot
2026-10-16 20:10   ` Winiarska, Iwona [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=fd837f02c718bea1540cca2ad352880d9f89c67d.camel@intel.com \
    --to=iwona.winiarska@intel.com \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=openbmc@lists.ozlabs.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@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