From nobody Tue Apr 7 16:32:15 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0A73BAD9D; Thu, 12 Mar 2026 10:42:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773312127; cv=none; b=u0lBBruBB6HMZSqR9m27FVOPwnsxc21T76Arstd0WYwNsnfqvM1lPqIDSh8teKUVGRdEaSRU2uZ0Y0SuPjK/QKEBXILesNF8Ys2upyQmbi7oMqlkF2ozWA1cOuO0WncU8Rv1yI1FXcJ2bRM7SOhSiV+G69GzPiYNqE2CbwE7YXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773312127; c=relaxed/simple; bh=fQO5ROP/KXQ4OAOdPPsBtNrcLC2+XLuf8ymmB79Iqqc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=txGonR50OImnH/9NE8u+PKOmgvqGQ2IK6g+XE8c4IlT4waEI9BsiMW6rQGJ0E3AeTU4irRJrBe20+xgakoFqXcO2SJYQnWs9AR1H1uBqFSlYJfsEF/UUp9bi+ID4K71gg7z77glXFoabrTXxD5tLoTLys0mjdmraGANIDLBYT/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HWbTYLCl; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=E6RofpTW; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HWbTYLCl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="E6RofpTW" Date: Thu, 12 Mar 2026 10:42:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773312123; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXwk3G3LZcB7WRzHpFMsrH8ZfZXmd1aThThzQ8NbRBM=; b=HWbTYLClyTCnrKBXSDouPS5YoWCLu4tYF1uYu74MHPdDcqFHvODzdyFrdS7N8I9CF/Np/T eLMriBEmktEGgsk+kVfBnVEhB0mXvNgObVrSMw0CDhf2rtJNik3bYha/h5lGyi7dhMCKXh 8foTNM+/LRBgG04DXLc3ccMxZ8GIZTTTSWIp0IK2U0SIHUIVo1I3VJLhqrefQYIfi77ayp twJqXAT+iY+cjjla9joix7b/9dYlSQ2YzqP19Jjss9UGC2ptWlQ7dUKoUIcavLkhweVHeP 5RuOu4qWiAcVrECvj6t2gYMwa+zJrDXOHjZLJGXex02s/9gxG1IiDUxSilaekw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773312123; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXwk3G3LZcB7WRzHpFMsrH8ZfZXmd1aThThzQ8NbRBM=; b=E6RofpTWnXMpIyCQAiT9rP6zJiSaOJaXiXAPRTyFv0sn2Y9FqEoH/Ut+VwgeomCcCgzjl6 AUq4B42Ytj0edMDg== From: "tip-bot2 for Yazen Ghannam" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: ras/core] x86/mce, EDAC/mce_amd: Reorder SMCA bank type enums Cc: Yazen Ghannam , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260307163316.345923-2-yazen.ghannam@amd.com> References: <20260307163316.345923-2-yazen.ghannam@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177331212239.1647592.4369558573009716405.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the ras/core branch of tip: Commit-ID: bee9f4178b4a3fec70414c82ddc4bceff182f2ba Gitweb: https://git.kernel.org/tip/bee9f4178b4a3fec70414c82ddc4bceff= 182f2ba Author: Yazen Ghannam AuthorDate: Sat, 07 Mar 2026 11:33:14 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 11 Mar 2026 13:51:40 +01:00 x86/mce, EDAC/mce_amd: Reorder SMCA bank type enums Originally, the SMCA bank type enums were ordered based on processor documentation. However, the ordering became inconsistent after new bank types were added over time. Sort the bank type enums alphanumerically in most places. Sort the "enum to HWID/McaType" mapping by HWID/McaType. Drop redundant code comments. No functional changes. [ bp: Sort them alphanumerically. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260307163316.345923-2-yazen.ghannam@amd.com --- arch/x86/include/asm/mce.h | 51 ++++++++------- arch/x86/kernel/cpu/mce/amd.c | 115 +++++++++++++-------------------- drivers/edac/mce_amd.c | 38 +++++------ 3 files changed, 95 insertions(+), 109 deletions(-) diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 2d98886..6e15205 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h @@ -343,44 +343,49 @@ extern void apei_mce_report_mem_error(int corrected, */ #ifdef CONFIG_X86_MCE_AMD =20 -/* These may be used by multiple smca_hwid_mcatypes */ +/* + * These may be used by multiple smca_hwid_mcatypes. + * + * Keep in alphanumeric order, numerals before letters. + * Exception: Keep "V2, etc." with their originals. + */ enum smca_bank_types { - SMCA_LS =3D 0, /* Load Store */ - SMCA_LS_V2, - SMCA_IF, /* Instruction Fetch */ - SMCA_L2_CACHE, /* L2 Cache */ + SMCA_CS, /* Coherent Slave */ + SMCA_CS_V2, SMCA_DE, /* Decoder Unit */ - SMCA_RESERVED, /* Reserved */ SMCA_EX, /* Execution Unit */ SMCA_FP, /* Floating Point */ + SMCA_GMI_PCS, /* GMI PCS Unit */ + SMCA_GMI_PHY, /* GMI PHY Unit */ + SMCA_IF, /* Instruction Fetch */ + SMCA_L2_CACHE, /* L2 Cache */ SMCA_L3_CACHE, /* L3 Cache */ - SMCA_CS, /* Coherent Slave */ - SMCA_CS_V2, - SMCA_PIE, /* Power, Interrupts, etc. */ - SMCA_UMC, /* Unified Memory Controller */ - SMCA_UMC_V2, + SMCA_LS, /* Load Store */ + SMCA_LS_V2, SMCA_MA_LLC, /* Memory Attached Last Level Cache */ - SMCA_PB, /* Parameter Block */ - SMCA_PSP, /* Platform Security Processor */ - SMCA_PSP_V2, - SMCA_SMU, /* System Management Unit */ - SMCA_SMU_V2, SMCA_MP5, /* Microprocessor 5 Unit */ SMCA_MPDMA, /* MPDMA Unit */ + SMCA_NBIF, /* NBIF Unit */ SMCA_NBIO, /* Northbridge IO Unit */ + SMCA_PB, /* Parameter Block */ SMCA_PCIE, /* PCI Express Unit */ SMCA_PCIE_V2, - SMCA_XGMI_PCS, /* xGMI PCS Unit */ - SMCA_NBIF, /* NBIF Unit */ - SMCA_SHUB, /* System HUB Unit */ + SMCA_PIE, /* Power, Interrupts, etc. */ + SMCA_PSP, /* Platform Security Processor */ + SMCA_PSP_V2, + SMCA_RESERVED, /* Reserved */ SMCA_SATA, /* SATA Unit */ + SMCA_SHUB, /* System HUB Unit */ + SMCA_SMU, /* System Management Unit */ + SMCA_SMU_V2, + SMCA_UMC, /* Unified Memory Controller */ + SMCA_UMC_V2, SMCA_USB, /* USB Unit */ - SMCA_USR_DP, /* Ultra Short Reach Data Plane Controller */ SMCA_USR_CP, /* Ultra Short Reach Control Plane Controller */ - SMCA_GMI_PCS, /* GMI PCS Unit */ - SMCA_XGMI_PHY, /* xGMI PHY Unit */ + SMCA_USR_DP, /* Ultra Short Reach Data Plane Controller */ SMCA_WAFL_PHY, /* WAFL PHY Unit */ - SMCA_GMI_PHY, /* GMI PHY Unit */ + SMCA_XGMI_PCS, /* xGMI PCS Unit */ + SMCA_XGMI_PHY, /* xGMI PHY Unit */ N_SMCA_BANK_TYPES }; =20 diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c index da13c1e..71bfe37 100644 --- a/arch/x86/kernel/cpu/mce/amd.c +++ b/arch/x86/kernel/cpu/mce/amd.c @@ -95,39 +95,39 @@ static DEFINE_PER_CPU_READ_MOSTLY(struct smca_bank[MAX_= NR_BANKS], smca_banks); static DEFINE_PER_CPU_READ_MOSTLY(u8[N_SMCA_BANK_TYPES], smca_bank_counts); =20 static const char * const smca_names[] =3D { - [SMCA_LS ... SMCA_LS_V2] =3D "load_store", - [SMCA_IF] =3D "insn_fetch", - [SMCA_L2_CACHE] =3D "l2_cache", + [SMCA_CS ... SMCA_CS_V2] =3D "coherent_slave", [SMCA_DE] =3D "decode_unit", - [SMCA_RESERVED] =3D "reserved", [SMCA_EX] =3D "execution_unit", [SMCA_FP] =3D "floating_point", + [SMCA_GMI_PCS] =3D "gmi_pcs", + [SMCA_GMI_PHY] =3D "gmi_phy", + [SMCA_IF] =3D "insn_fetch", + [SMCA_L2_CACHE] =3D "l2_cache", [SMCA_L3_CACHE] =3D "l3_cache", - [SMCA_CS ... SMCA_CS_V2] =3D "coherent_slave", - [SMCA_PIE] =3D "pie", - - /* UMC v2 is separate because both of them can exist in a single system. = */ - [SMCA_UMC] =3D "umc", - [SMCA_UMC_V2] =3D "umc_v2", + [SMCA_LS ... SMCA_LS_V2] =3D "load_store", [SMCA_MA_LLC] =3D "ma_llc", - [SMCA_PB] =3D "param_block", - [SMCA_PSP ... SMCA_PSP_V2] =3D "psp", - [SMCA_SMU ... SMCA_SMU_V2] =3D "smu", [SMCA_MP5] =3D "mp5", [SMCA_MPDMA] =3D "mpdma", + [SMCA_NBIF] =3D "nbif", [SMCA_NBIO] =3D "nbio", + [SMCA_PB] =3D "param_block", [SMCA_PCIE ... SMCA_PCIE_V2] =3D "pcie", - [SMCA_XGMI_PCS] =3D "xgmi_pcs", - [SMCA_NBIF] =3D "nbif", - [SMCA_SHUB] =3D "shub", + [SMCA_PIE] =3D "pie", + [SMCA_PSP ... SMCA_PSP_V2] =3D "psp", + [SMCA_RESERVED] =3D "reserved", [SMCA_SATA] =3D "sata", + [SMCA_SHUB] =3D "shub", + [SMCA_SMU ... SMCA_SMU_V2] =3D "smu", + + /* UMC v2 is separate because both of them can exist in a single system. = */ + [SMCA_UMC] =3D "umc", + [SMCA_UMC_V2] =3D "umc_v2", [SMCA_USB] =3D "usb", - [SMCA_USR_DP] =3D "usr_dp", [SMCA_USR_CP] =3D "usr_cp", - [SMCA_GMI_PCS] =3D "gmi_pcs", - [SMCA_XGMI_PHY] =3D "xgmi_phy", + [SMCA_USR_DP] =3D "usr_dp", [SMCA_WAFL_PHY] =3D "wafl_phy", - [SMCA_GMI_PHY] =3D "gmi_phy", + [SMCA_XGMI_PCS] =3D "xgmi_pcs", + [SMCA_XGMI_PHY] =3D "xgmi_phy", }; =20 static const char *smca_get_name(enum smca_bank_types t) @@ -153,68 +153,49 @@ enum smca_bank_types smca_get_bank_type(unsigned int = cpu, unsigned int bank) } EXPORT_SYMBOL_GPL(smca_get_bank_type); =20 +/* + * Format: + * { bank_type, hwid_mcatype } + * + * alphanumerically sorted by bank type. + */ static const struct smca_hwid smca_hwid_mcatypes[] =3D { - /* { bank_type, hwid_mcatype } */ - - /* Reserved type */ - { SMCA_RESERVED, HWID_MCATYPE(0x00, 0x0) }, - - /* ZN Core (HWID=3D0xB0) MCA types */ - { SMCA_LS, HWID_MCATYPE(0xB0, 0x0) }, - { SMCA_LS_V2, HWID_MCATYPE(0xB0, 0x10) }, - { SMCA_IF, HWID_MCATYPE(0xB0, 0x1) }, - { SMCA_L2_CACHE, HWID_MCATYPE(0xB0, 0x2) }, + { SMCA_CS, HWID_MCATYPE(0x2E, 0x0) }, + { SMCA_CS_V2, HWID_MCATYPE(0x2E, 0x2) }, { SMCA_DE, HWID_MCATYPE(0xB0, 0x3) }, - /* HWID 0xB0 MCATYPE 0x4 is Reserved */ { SMCA_EX, HWID_MCATYPE(0xB0, 0x5) }, { SMCA_FP, HWID_MCATYPE(0xB0, 0x6) }, + { SMCA_GMI_PCS, HWID_MCATYPE(0x241, 0x0) }, + { SMCA_GMI_PHY, HWID_MCATYPE(0x269, 0x0) }, + { SMCA_IF, HWID_MCATYPE(0xB0, 0x1) }, + { SMCA_L2_CACHE, HWID_MCATYPE(0xB0, 0x2) }, { SMCA_L3_CACHE, HWID_MCATYPE(0xB0, 0x7) }, - - /* Data Fabric MCA types */ - { SMCA_CS, HWID_MCATYPE(0x2E, 0x0) }, - { SMCA_PIE, HWID_MCATYPE(0x2E, 0x1) }, - { SMCA_CS_V2, HWID_MCATYPE(0x2E, 0x2) }, + { SMCA_LS, HWID_MCATYPE(0xB0, 0x0) }, + { SMCA_LS_V2, HWID_MCATYPE(0xB0, 0x10) }, { SMCA_MA_LLC, HWID_MCATYPE(0x2E, 0x4) }, - - /* Unified Memory Controller MCA type */ - { SMCA_UMC, HWID_MCATYPE(0x96, 0x0) }, - { SMCA_UMC_V2, HWID_MCATYPE(0x96, 0x1) }, - - /* Parameter Block MCA type */ - { SMCA_PB, HWID_MCATYPE(0x05, 0x0) }, - - /* Platform Security Processor MCA type */ - { SMCA_PSP, HWID_MCATYPE(0xFF, 0x0) }, - { SMCA_PSP_V2, HWID_MCATYPE(0xFF, 0x1) }, - - /* System Management Unit MCA type */ - { SMCA_SMU, HWID_MCATYPE(0x01, 0x0) }, - { SMCA_SMU_V2, HWID_MCATYPE(0x01, 0x1) }, - - /* Microprocessor 5 Unit MCA type */ { SMCA_MP5, HWID_MCATYPE(0x01, 0x2) }, - - /* MPDMA MCA type */ { SMCA_MPDMA, HWID_MCATYPE(0x01, 0x3) }, - - /* Northbridge IO Unit MCA type */ + { SMCA_NBIF, HWID_MCATYPE(0x6C, 0x0) }, { SMCA_NBIO, HWID_MCATYPE(0x18, 0x0) }, - - /* PCI Express Unit MCA type */ + { SMCA_PB, HWID_MCATYPE(0x05, 0x0) }, { SMCA_PCIE, HWID_MCATYPE(0x46, 0x0) }, { SMCA_PCIE_V2, HWID_MCATYPE(0x46, 0x1) }, - - { SMCA_XGMI_PCS, HWID_MCATYPE(0x50, 0x0) }, - { SMCA_NBIF, HWID_MCATYPE(0x6C, 0x0) }, - { SMCA_SHUB, HWID_MCATYPE(0x80, 0x0) }, + { SMCA_PIE, HWID_MCATYPE(0x2E, 0x1) }, + { SMCA_PSP, HWID_MCATYPE(0xFF, 0x0) }, + { SMCA_PSP_V2, HWID_MCATYPE(0xFF, 0x1) }, + { SMCA_RESERVED, HWID_MCATYPE(0x00, 0x0) }, { SMCA_SATA, HWID_MCATYPE(0xA8, 0x0) }, + { SMCA_SHUB, HWID_MCATYPE(0x80, 0x0) }, + { SMCA_SMU, HWID_MCATYPE(0x01, 0x0) }, + { SMCA_SMU_V2, HWID_MCATYPE(0x01, 0x1) }, + { SMCA_UMC, HWID_MCATYPE(0x96, 0x0) }, + { SMCA_UMC_V2, HWID_MCATYPE(0x96, 0x1) }, { SMCA_USB, HWID_MCATYPE(0xAA, 0x0) }, - { SMCA_USR_DP, HWID_MCATYPE(0x170, 0x0) }, { SMCA_USR_CP, HWID_MCATYPE(0x180, 0x0) }, - { SMCA_GMI_PCS, HWID_MCATYPE(0x241, 0x0) }, - { SMCA_XGMI_PHY, HWID_MCATYPE(0x259, 0x0) }, + { SMCA_USR_DP, HWID_MCATYPE(0x170, 0x0) }, { SMCA_WAFL_PHY, HWID_MCATYPE(0x267, 0x0) }, - { SMCA_GMI_PHY, HWID_MCATYPE(0x269, 0x0) }, + { SMCA_XGMI_PCS, HWID_MCATYPE(0x50, 0x0) }, + { SMCA_XGMI_PHY, HWID_MCATYPE(0x259, 0x0) }, }; =20 /* diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index af3c122..7fba230 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -689,36 +689,36 @@ static void decode_mc6_mce(struct mce *m) } =20 static const char * const smca_long_names[] =3D { - [SMCA_LS ... SMCA_LS_V2] =3D "Load Store Unit", - [SMCA_IF] =3D "Instruction Fetch Unit", - [SMCA_L2_CACHE] =3D "L2 Cache", + [SMCA_CS ... SMCA_CS_V2] =3D "Coherent Slave", [SMCA_DE] =3D "Decode Unit", - [SMCA_RESERVED] =3D "Reserved", [SMCA_EX] =3D "Execution Unit", [SMCA_FP] =3D "Floating Point Unit", + [SMCA_GMI_PCS] =3D "Global Memory Interconnect PCS Unit", + [SMCA_GMI_PHY] =3D "Global Memory Interconnect PHY Unit", + [SMCA_IF] =3D "Instruction Fetch Unit", + [SMCA_L2_CACHE] =3D "L2 Cache", [SMCA_L3_CACHE] =3D "L3 Cache", - [SMCA_CS ... SMCA_CS_V2] =3D "Coherent Slave", - [SMCA_PIE] =3D "Power, Interrupts, etc.", - - /* UMC v2 is separate because both of them can exist in a single system. = */ - [SMCA_UMC] =3D "Unified Memory Controller", - [SMCA_UMC_V2] =3D "Unified Memory Controller v2", - [SMCA_PB] =3D "Parameter Block", - [SMCA_PSP ... SMCA_PSP_V2] =3D "Platform Security Processor", - [SMCA_SMU ... SMCA_SMU_V2] =3D "System Management Unit", + [SMCA_LS ... SMCA_LS_V2] =3D "Load Store Unit", [SMCA_MP5] =3D "Microprocessor 5 Unit", [SMCA_MPDMA] =3D "MPDMA Unit", + [SMCA_NBIF] =3D "NBIF Unit", [SMCA_NBIO] =3D "Northbridge IO Unit", + [SMCA_PB] =3D "Parameter Block", [SMCA_PCIE ... SMCA_PCIE_V2] =3D "PCI Express Unit", - [SMCA_XGMI_PCS] =3D "Ext Global Memory Interconnect PCS Unit", - [SMCA_NBIF] =3D "NBIF Unit", - [SMCA_SHUB] =3D "System Hub Unit", + [SMCA_PIE] =3D "Power, Interrupts, etc.", + [SMCA_PSP ... SMCA_PSP_V2] =3D "Platform Security Processor", + [SMCA_RESERVED] =3D "Reserved", [SMCA_SATA] =3D "SATA Unit", + [SMCA_SHUB] =3D "System Hub Unit", + [SMCA_SMU ... SMCA_SMU_V2] =3D "System Management Unit", + + /* UMC v2 is separate because both of them can exist in a single system. = */ + [SMCA_UMC] =3D "Unified Memory Controller", + [SMCA_UMC_V2] =3D "Unified Memory Controller v2", [SMCA_USB] =3D "USB Unit", - [SMCA_GMI_PCS] =3D "Global Memory Interconnect PCS Unit", - [SMCA_XGMI_PHY] =3D "Ext Global Memory Interconnect PHY Unit", [SMCA_WAFL_PHY] =3D "WAFL PHY Unit", - [SMCA_GMI_PHY] =3D "Global Memory Interconnect PHY Unit", + [SMCA_XGMI_PCS] =3D "Ext Global Memory Interconnect PCS Unit", + [SMCA_XGMI_PHY] =3D "Ext Global Memory Interconnect PHY Unit", }; =20 static const char *smca_get_long_name(enum smca_bank_types t)