Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37027388rwd; Tue, 11 Jul 2023 08:32:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKpWJDYCzCX+weS0flS7Y0kGXn9tdNwPQg1T6xkfEdBbonwHVNRjVeEM++suyRwyIO6Mec X-Received: by 2002:a05:6a20:a128:b0:132:8daa:23eb with SMTP id q40-20020a056a20a12800b001328daa23ebmr1181129pzk.4.1689089569004; Tue, 11 Jul 2023 08:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689089568; cv=none; d=google.com; s=arc-20160816; b=t29Iiw22vxCVhLtXtPgLlp5AhM7tWNslu2v2DBkzS0mtyDfzfbY3x6EJoE6tNTkLgW G7Xr7/Hsp3cKltfWXoSCS8JERpBIEonsHBZtiCH9nFB6spHtJBagd5JlGAg1MHhFAM8w 2UOu6R+Ip1GoFtaTCSxkpQuD5w4RMcQCTNu0DVPTiJcCoGxIbStwU2v+KQXU6IAJIihb 90NM9s+95Rj3SiZ4vtMzenlJD3wq+AOdBGXxSyuxHsRwhiJ4YwyJqxhLGA7wcyOTFmYx erSWNnj4K51kj2aJtq78ZHzwR4E1g4JyArSY7wyleW2WJXAuTfIkvhTZkZ9NFYzpsgv5 G73w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JvD88681HbiR2SoA2cEn2GGKO41btg39V7tlXMdvHns=; fh=O3dF6KWKfBUvZB7lyU0s3dSM2lbhe9y7PsMyDlK8iZU=; b=B7Mz1gLChWEpqqz/twoooqZvFc0z4MGsoDH6NVZGAmRASHuqwAnF1hE748I/nLTko5 KWzHCk/0V+Lj8h/nbzkmKJdIuKoB/ONrLxIYU/PrzowL3/aBJKXiqOB7viQbwbVfrCiU hSBSAJOWdlhc3tuOSSMJ2dJVJg1THrCP2rUeOeywfi5ep4W9M/Y9bOPMxYpzGxZp/PUl 2eqZXwFzKT9+3HKmyQB0DRY2Z4wSMvTpzN0wol41WOZ7UmT9ufeMwB1YKytFS2Xy/T6C O0/fqyowxi6vgBJCWO3wmMKkndMCk74vV8IC8H86jWXuDSCtmY63WinPAc5l5J+zFQw3 X4eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=SVxtXNSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v69-20020a638948000000b0053084a794f0si1512566pgd.290.2023.07.11.08.32.35; Tue, 11 Jul 2023 08:32:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=SVxtXNSX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjGKPGq (ORCPT + 99 others); Tue, 11 Jul 2023 11:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjGKPGo (ORCPT ); Tue, 11 Jul 2023 11:06:44 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC01310CF for ; Tue, 11 Jul 2023 08:06:42 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2640a8ceefdso4225264a91.3 for ; Tue, 11 Jul 2023 08:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1689088002; x=1691680002; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JvD88681HbiR2SoA2cEn2GGKO41btg39V7tlXMdvHns=; b=SVxtXNSX/kk+vJJKUkRSVBRWD1pizRMYKn3HL0clFDyxAD/8hCluES1y3RMCdY63hR /+KoCLJD7jD6dXnlqLbcuIuASY+2JsGoGy1fRXXMTUAcQKU35+etOofgjGazN7fNyEw3 vakYdfPQfA3ZW8jCjhyhbLwp8uOWsF+aectobcPRJO50KIVh9qSPKIXhhmwe1QVU7rqQ RrP60Ps0s4wf1/XbulQeaE+rsPNHzoVxj7i+Gav14CO2UDAQRrLUnP7lQT4kJknDTR6X p3D5Ymrq18qQ1DTz0p5KnygCq+e7Z/zF96du2xWPHRoeroGq5p/lpkrYckrxVcsF9eRl P1Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689088002; x=1691680002; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JvD88681HbiR2SoA2cEn2GGKO41btg39V7tlXMdvHns=; b=cvanlNDSTqhMSjGYTkR4yGPsuClk6vZ35ijvwcYDH94LagYNf5YNSg7MPPTPxBgtdE 3j8SWgdquFn0n+T1KAloJ0hkZ+Cvm6BRG/JtDuPuCuVIhCAlPWIiL13KfkfH2Z3ySm7W 9WvNATL898avIIaqypXozpcv0cLTKhq5G9aBnaTmhsMX3Vovjgva3l/C6ME23WkAGX3c GoO5QNUZBsOJ1tN6FMe/FOczSVoBulohY4iiC05eJLQGKdKVC8J+YhvjlaP0oqrwwhpj 9yFj6INR3jsx2Em38QghQuucglMlt9U9Otp4p5HlJI0QkRCm8JTHFjB59/+zui7fxxVh 2tFQ== X-Gm-Message-State: ABy/qLZ36hXmkIsz1mbEWOFH6KhhGa8JMldtNMzoMU45/RTrDbedtZ8E fggNK0RWHJFdJZKm4ne/lYdGuI/lXCfCrOLZdBqaNw== X-Received: by 2002:a17:90a:ac0d:b0:262:ec13:d3a with SMTP id o13-20020a17090aac0d00b00262ec130d3amr17436983pjq.28.1689088001969; Tue, 11 Jul 2023 08:06:41 -0700 (PDT) MIME-Version: 1.0 References: <20230710164705.3985996-1-Naresh.Solanki@9elements.com> <20230710164705.3985996-2-Naresh.Solanki@9elements.com> In-Reply-To: From: Naresh Solanki Date: Tue, 11 Jul 2023 17:06:30 +0200 Message-ID: Subject: Re: [PATCH 2/2] hwmon: (dimmtemp) Add Sapphire Rappids support To: Guenter Roeck Cc: devicetree@vger.kernel.org, Jean Delvare , Iwona Winiarska , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, On Mon, 10 Jul 2023 at 20:48, Guenter Roeck wrote: > > On Mon, Jul 10, 2023 at 06:47:04PM +0200, Naresh Solanki wrote: > > From: Patrick Rudolph > > > > This patch extends the functionality of the hwmon (dimmtemp) to include > > support for Sapphire Rappids platform. > > > > Sapphire Rappids can accommodate up to 8 CPUs, each with 16 DIMMs. To > > accommodate this configuration, the maximum supported DIMM count is > > increased, and the corresponding Sapphire Rappids ID and threshold code > > are added. > > > > The patch has been tested on a 4S system with 64 DIMMs installed. > > Default thresholds are utilized for Sapphire Rappids, as accessing the > > threshold requires accessing the UBOX device on Uncore bus 0, which can > > only be achieved using MSR access. The non-PCI-compliant MMIO BARs are > > not available for this purpose. > > > > Signed-off-by: Patrick Rudolph > > Does this patch depend on the other patch, the one introducing > Sapphire Rappids to peci/cputemp ? Yes they are dependent. Will bundle them together & resend. ~Naresh > > Guenter > > > --- > > drivers/hwmon/peci/dimmtemp.c | 24 +++++++++++++++++++++++- > > 1 file changed, 23 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/hwmon/peci/dimmtemp.c b/drivers/hwmon/peci/dimmtemp.c > > index ce89da3937a0..ea4ac5a023cf 100644 > > --- a/drivers/hwmon/peci/dimmtemp.c > > +++ b/drivers/hwmon/peci/dimmtemp.c > > @@ -30,8 +30,10 @@ > > #define DIMM_IDX_MAX_ON_ICX 2 > > #define CHAN_RANK_MAX_ON_ICXD 4 > > #define DIMM_IDX_MAX_ON_ICXD 2 > > +#define CHAN_RANK_MAX_ON_SPR 128 > > +#define DIMM_IDX_MAX_ON_SPR 2 > > > > -#define CHAN_RANK_MAX CHAN_RANK_MAX_ON_HSX > > +#define CHAN_RANK_MAX CHAN_RANK_MAX_ON_SPR > > #define DIMM_IDX_MAX DIMM_IDX_MAX_ON_HSX > > #define DIMM_NUMS_MAX (CHAN_RANK_MAX * DIMM_IDX_MAX) > > > > @@ -534,6 +536,15 @@ read_thresholds_icx(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u > > return 0; > > } > > > > +static int > > +read_thresholds_spr(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u32 *data) > > +{ > > + /* Use defaults */ > > + *data = (95 << 16) | (90 << 8); > > + > > + return 0; > > +} > > + > > static const struct dimm_info dimm_hsx = { > > .chan_rank_max = CHAN_RANK_MAX_ON_HSX, > > .dimm_idx_max = DIMM_IDX_MAX_ON_HSX, > > @@ -576,6 +587,13 @@ static const struct dimm_info dimm_icxd = { > > .read_thresholds = &read_thresholds_icx, > > }; > > > > +static const struct dimm_info dimm_spr = { > > + .chan_rank_max = CHAN_RANK_MAX_ON_SPR, > > + .dimm_idx_max = DIMM_IDX_MAX_ON_SPR, > > + .min_peci_revision = 0x40, > > + .read_thresholds = &read_thresholds_spr, > > +}; > > + > > static const struct auxiliary_device_id peci_dimmtemp_ids[] = { > > { > > .name = "peci_cpu.dimmtemp.hsx", > > @@ -601,6 +619,10 @@ static const struct auxiliary_device_id peci_dimmtemp_ids[] = { > > .name = "peci_cpu.dimmtemp.icxd", > > .driver_data = (kernel_ulong_t)&dimm_icxd, > > }, > > + { > > + .name = "peci_cpu.dimmtemp.spr", > > + .driver_data = (kernel_ulong_t)&dimm_spr, > > + }, > > { } > > }; > > MODULE_DEVICE_TABLE(auxiliary, peci_dimmtemp_ids); > > -- > > 2.41.0 > >