Linux EDAC development
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Tony Luck <tony.luck@intel.com>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
	Aristeu Rozanski <aris@redhat.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/2] EDAC, {skx,i10nm}: Make some configurations CPU model specific
Date: Mon, 27 Apr 2020 10:32:46 +0200	[thread overview]
Message-ID: <20200427083246.GB11036@zn.tnic> (raw)
In-Reply-To: <20200424185738.7985-2-tony.luck@intel.com>

On Fri, Apr 24, 2020 at 11:57:37AM -0700, Tony Luck wrote:
> From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> 
> The device ID for configuration agent PCI device and the offset for
> bus number configuration register can be CPU model specific. So add
> a new structure res_config to make them configurable and pass res_config
> to {skx,i10nm}_init() and skx_get_all_bus_mappings() for use.
> 
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  drivers/edac/i10nm_base.c | 16 ++++++++++++----
>  drivers/edac/skx_base.c   | 12 ++++++++++--
>  drivers/edac/skx_common.c | 11 +++++------
>  drivers/edac/skx_common.h | 11 +++++++++--
>  4 files changed, 36 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/edac/i10nm_base.c b/drivers/edac/i10nm_base.c
> index df08de963d10..ba4578c6ef2b 100644
> --- a/drivers/edac/i10nm_base.c
> +++ b/drivers/edac/i10nm_base.c
> @@ -122,10 +122,16 @@ static int i10nm_get_all_munits(void)
>  	return 0;
>  }
>  
> +static struct res_config i10nm_cfg = {
> +	.type			= I10NM,
> +	.decs_did		= 0x3452,
> +	.busno_cfg_offset	= 0xcc,
> +};
> +
>  static const struct x86_cpu_id i10nm_cpuids[] = {
> -	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D,	NULL),
> -	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X,		NULL),
> -	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D,		NULL),
> +	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D,	&i10nm_cfg),
> +	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X,		&i10nm_cfg),
> +	X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D,		&i10nm_cfg),
>  	{}
>  };
>  MODULE_DEVICE_TABLE(x86cpu, i10nm_cpuids);
> @@ -234,6 +240,7 @@ static int __init i10nm_init(void)
>  {
>  	u8 mc = 0, src_id = 0, node_id = 0;
>  	const struct x86_cpu_id *id;
> +	struct res_config *cfg;
>  	const char *owner;
>  	struct skx_dev *d;
>  	int rc, i, off[3] = {0xd0, 0xc8, 0xcc};
> @@ -248,12 +255,13 @@ static int __init i10nm_init(void)
>  	id = x86_match_cpu(i10nm_cpuids);
>  	if (!id)
>  		return -ENODEV;

<---- newline here.

> +	cfg = (struct res_config *)id->driver_data;
>  
>  	rc = skx_get_hi_lo(0x09a2, off, &tolm, &tohm);
>  	if (rc)
>  		return rc;
>  
> -	rc = skx_get_all_bus_mappings(0x3452, 0xcc, I10NM, &i10nm_edac_list);
> +	rc = skx_get_all_bus_mappings(cfg, &i10nm_edac_list);
>  	if (rc < 0)
>  		goto fail;
>  	if (rc == 0) {
> diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c
> index 46a3a3440f5e..ae2c2b516adc 100644
> --- a/drivers/edac/skx_base.c
> +++ b/drivers/edac/skx_base.c
> @@ -157,8 +157,14 @@ static int get_all_munits(const struct munit *m)
>  	return -ENODEV;
>  }
>  
> +static struct res_config skx_cfg = {
> +	.type			= SKX,
> +	.decs_did		= 0x2016,
> +	.busno_cfg_offset	= 0xcc,
> +};
> +
>  static const struct x86_cpu_id skx_cpuids[] = {
> -	X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X,	NULL),
> +	X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X,	&skx_cfg),
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(x86cpu, skx_cpuids);
> @@ -641,6 +647,7 @@ static inline void teardown_skx_debug(void) {}
>  static int __init skx_init(void)
>  {
>  	const struct x86_cpu_id *id;
> +	struct res_config *cfg;
>  	const struct munit *m;
>  	const char *owner;
>  	int rc = 0, i, off[3] = {0xd0, 0xd4, 0xd8};
> @@ -656,12 +663,13 @@ static int __init skx_init(void)
>  	id = x86_match_cpu(skx_cpuids);
>  	if (!id)
>  		return -ENODEV;

<---- newline here.

other than that:

Reviewed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2020-04-27  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 18:57 [PATCH 0/2] Fix i10nm_edac driver load failure Tony Luck
2020-04-24 18:57 ` [PATCH 1/2] EDAC, {skx,i10nm}: Make some configurations CPU model specific Tony Luck
2020-04-27  8:32   ` Borislav Petkov [this message]
2020-04-24 18:57 ` [PATCH 2/2] EDAC, i10nm: Fix i10nm_edac loading failure on some servers Tony Luck
2020-04-27  8:40   ` Borislav Petkov

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=20200427083246.GB11036@zn.tnic \
    --to=bp@alien8.de \
    --cc=aris@redhat.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=qiuxu.zhuo@intel.com \
    --cc=tony.luck@intel.com \
    /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