mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Yazen Ghannam <Yazen.Ghannam@amd.com>
Cc: linux-edac@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/mce/AMD: Define function to get SMCA bank type
Date: Sat, 2 Dec 2017 15:21:48 +0100	[thread overview]
Message-ID: <20171202142148.mnn7x3ax2ix3gpwp@pd.tnic> (raw)
In-Reply-To: <20171201155034.39206-1-Yazen.Ghannam@amd.com>

On Fri, Dec 01, 2017 at 09:50:33AM -0600, Yazen Ghannam wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
> 
> Scalable MCA systems have various types of banks. The bank's type can
> determine how we handle errors from it. For example, if a bank represents
> a UMC then we will need to convert its address from a normalized address
> to a system physical address before handling the error.
> 
> Define an exported function to return a bank's SMCA type.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> ---
>  arch/x86/include/asm/mce.h           |  1 +
>  arch/x86/kernel/cpu/mcheck/mce_amd.c | 11 +++++++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
> index b1e8d8db921f..9ab8bf32e61c 100644
> --- a/arch/x86/include/asm/mce.h
> +++ b/arch/x86/include/asm/mce.h
> @@ -376,6 +376,7 @@ struct smca_bank {
>  extern struct smca_bank smca_banks[MAX_NR_BANKS];
>  
>  extern const char *smca_get_long_name(enum smca_bank_types t);
> +extern unsigned int smca_get_bank_type(struct mce *m);
>  
>  extern int mce_threshold_create_device(unsigned int cpu);
>  extern int mce_threshold_remove_device(unsigned int cpu);
> diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> index a38ab1fa53a2..bc0510a4f6c0 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> @@ -110,6 +110,17 @@ const char *smca_get_long_name(enum smca_bank_types t)
>  }
>  EXPORT_SYMBOL_GPL(smca_get_long_name);
>  
> +unsigned int smca_get_bank_type(struct mce *m)
> +{
> +	struct smca_bank bank = smca_banks[m->bank];
> +
> +	if (!bank.hwid)
> +		return N_SMCA_BANK_TYPES;
> +
> +	return bank.hwid->bank_type;
> +}
> +EXPORT_SYMBOL_GPL(smca_get_bank_type);

Why are you exporting it if it is used in mce_amd.c only anyway?

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

  parent reply	other threads:[~2017-12-02 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 15:50 Yazen Ghannam
2017-12-01 15:50 ` [PATCH 2/2] x86/mce: Report only DRAM ECC as memory errors on AMD systems Yazen Ghannam
2017-12-02 14:21 ` Borislav Petkov [this message]
2017-12-03  0:58   ` [PATCH 1/2] x86/mce/AMD: Define function to get SMCA bank type Ghannam, Yazen

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=20171202142148.mnn7x3ax2ix3gpwp@pd.tnic \
    --to=bp@suse.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@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

all inboxes | Powered by JetHome®