From patchwork Tue Feb 14 06:45:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 56697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2802944wrn; Mon, 13 Feb 2023 22:50:08 -0800 (PST) X-Google-Smtp-Source: AK7set/zGkPfG6k1Ic7jxZsr1aqNq3UUc0wV26l5rdCAi80fepHm4yyLr9JWN2xJB7UZ1UxsGZ6O X-Received: by 2002:a17:906:1dd7:b0:88d:ba89:1853 with SMTP id v23-20020a1709061dd700b0088dba891853mr22315978ejh.36.1676357408424; Mon, 13 Feb 2023 22:50:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676357408; cv=pass; d=google.com; s=arc-20160816; b=PdjPXyXHuHdwEGVaSIJXqkobdfgXoLItArbUojniMHM7N+aPyxkYWHL4zTNIjeOeiA vqcQ/P52FP8hD1a20uzCjbhZpmMYZptTqxI4Qzozqo3ElkvnGzLcAgMsDNk0jxmsUox4 kZT+GMKFxVTjqbyYgFc2RZlSsf/W0TXJidXln+NQJdVsDEUQvtpTnxV8SBkVSY+hxoZb V2Bj47W1COW3JpxZPDi7RHatltRiHJ6ozV2TPzwuP9FvEo0EYPMl8PGjUWjIMSNw3Vsw /MtEKrpyCvEXZRJTiIstSaTMEPdHe5TVrNw0OdA1bSSLBWNDP5BrO0sIiWBGmFXPPr/O XsSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W6L6CtaOM6lsMUx2LLXya/oWRSGMEm8r5r/tiVclN+0=; b=eHscarTmvIW+OpPjxRKM6QY9P5YS0e+7QBAkIiSCZqN7wc54n6YIOVnNV80ru+xRyR q8LpPbGZq3Gs8YoJ3ywGIbXVII+UFtAHE6H8NHPBu4ZuCk67dvnVIbKnLyJdd/nYVZZL vgCuzDSFvhn9WloMPY/5qvvDwhXRq/zrqwFs4bxUbJ3THLH922AY39oHyxJWb6RQKf8D ytHNqkg2C/27hQBmW4rf41oRKiLPOwiMMAJILh2mZHGGCm3Lxr2mpfP7KMrwKo88BlfV vsVF0MdGLjsQRRu/oGdegMmBnif97tPw54iH/8ypySTr5hibfy/kqnuYk1MfUvB2/YlA 046A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=krkB+ZSv; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170906108b00b00889f329db7fsi11037358eju.999.2023.02.13.22.49.45; Mon, 13 Feb 2023 22:50:08 -0800 (PST) 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=@os.amperecomputing.com header.s=selector2 header.b=krkB+ZSv; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjBNGpn (ORCPT + 99 others); Tue, 14 Feb 2023 01:45:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjBNGpj (ORCPT ); Tue, 14 Feb 2023 01:45:39 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2098.outbound.protection.outlook.com [40.107.223.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656DBEF87 for ; Mon, 13 Feb 2023 22:45:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QNVmHuiccnC+unjkSce/1jvZxyX5HeSVn2NQr23Tq5MDPeTTDn0zbN2FTPnaN3UqQjbDChC0Z+JZGQCw7O5B5BHNE17pxHm5/fxSzE3XWZbZhgUBEsPKISkQtCMfoW8XZC9k03pXkezdXgnFxGbQBOl9bLSYQGmMN1s8cV4pT0iuwk0XUpFzLYC6Ywfvi39Q6KLvi62MeI3EZWa9xNJOTcQ+5KQHKD64sL7T6vZ0sg05Q5+LG0FMGoECm2qe50zhMwIj8I6g5RyJNY0QJwWays7jlI9UODY1PohiIMEQvbvDnDmPjc1RSbMcIzTz6lPCks2AGOu+D31xciZZllY1yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W6L6CtaOM6lsMUx2LLXya/oWRSGMEm8r5r/tiVclN+0=; b=PeSOQE4U9H7L9M6b5T4SVYGxsTkL1lBz7ov317XtGDQ0eA9AJCwFkLr1RvUg5/PtkGB6hpHzz4LYlaQH/rHUF5Dc73XQgsxHgApWVd+9lC3KT6u3txlp16tytw+8yacWj4nGpS1/bjQo7ZVdLeUFlAZrDBUXVURRGz5ODE1TpB2NTIzFHuiqZlWnyrn4tkBvPsFBbLbEK/wCbdYqMcCobftmLGx4TcQbmM+k+53gxRL/uszpPoWWOffdyZL/c4+bjUJj4WcXtDWnHu49yebqiUQKwOVxV6Gi9tmdsXfIcMjBWic+2WyYkNq2TTZVPr/rBOngMls7Cx7PWSW9K1uUkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W6L6CtaOM6lsMUx2LLXya/oWRSGMEm8r5r/tiVclN+0=; b=krkB+ZSvE/523qTW/KCUF53IH1nNMDedFDQpgmAY1g5HEO0kYDg3jQnm3/0VNGJDMPZCX+651it1Fkn5/Kk6I/vJRUUyX2p6rQ/B7Mt76UM7RMTJAioP9P/anUi/xe5cLWS+j9NJLIDY1jFTf9ojTzCDyk3UFEftBhCgr2vxKR4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) by DM6PR01MB3962.prod.exchangelabs.com (2603:10b6:5:84::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Tue, 14 Feb 2023 06:45:34 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::bf6:8038:9fe8:1588]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::bf6:8038:9fe8:1588%4]) with mapi id 15.20.6086.023; Tue, 14 Feb 2023 06:45:34 +0000 From: Quan Nguyen To: Arnd Bergmann , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission Cc: Phong Vo , Thang Nguyen , Quan Nguyen Subject: [PATCH 1/2] misc: smpro-errmon: Add DIMM 2x Refresh rate event Date: Tue, 14 Feb 2023 13:45:08 +0700 Message-Id: <20230214064509.3622044-2-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230214064509.3622044-1-quan@os.amperecomputing.com> References: <20230214064509.3622044-1-quan@os.amperecomputing.com> X-ClientProxiedBy: SI2PR01CA0023.apcprd01.prod.exchangelabs.com (2603:1096:4:192::17) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|DM6PR01MB3962:EE_ X-MS-Office365-Filtering-Correlation-Id: a53bc5a0-acca-48a6-ab27-08db0e5712df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: spi8ogUJzctBKfsSVgPv/m3gOu+XBqsJVfvmnErFDsDCCeZgLjr6dVQk9RAQYuPkxfj7FJVXTnG5AqqLe7Fr2IxmXXXIvlDokjabnXA/FoAOWrm6T1WbpYcO9eooBxkrh3BXTAmURc7Vh2CxvOERX8ZGqzfMw/i/Tejpsb+UaZkTXe3JOrnFvKj2oNFf6yEfOrX/TvGux7iMz0n7eZh4dQnYPgbR3wNgAmn7a974xnHOX8G1RqfKXSF22WhealPesouM7NQ2ilUGohOKwiUpt5s9BLJw5Wy6ZBEBkIxJUMZ9M5b95eaVLUEHQr8bVb8WYcu2TdB7ly6we5xrkowJxn6/YG5OaIvrQ1JOBfVECGkPA62mGcd6DwdqlaTtKS5FSWsf05vLmcPSeIJRhVXDX3+DUkKusUasNYvGGcI1fbXeqpawt2elxbOOjbxH3saYnra9J3aKBOXldBX2I7NfMpf63OnCE7CP+m++iMEYaKT+pa4FnpZD+VGoGoua7vjeNTNI1caJ9TriNF6ggaSnWM+69evKbwAYZWUX3UX6+bF3XxDVjCnhkbYd/uQivor4Fu51r2romcr4aarT6T44IeVMJ/AI/ZSz6zZiVvwpi/hvgGS/x92j3VwrXwBbLqJg+k1zzwYClzHMj2EFCB3dQkv9ulY8XgHnYhQu7RCWU8VxMfTli6wWvASLKHj2os9TPpn1ptukeqgXg6MjkQHCmg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR01MB7455.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(346002)(376002)(136003)(396003)(39850400004)(451199018)(8936002)(5660300002)(316002)(2906002)(110136005)(41300700001)(2616005)(66476007)(66556008)(4326008)(54906003)(66946007)(8676002)(38100700002)(38350700002)(1076003)(6506007)(6512007)(86362001)(6666004)(52116002)(107886003)(186003)(478600001)(6486002)(26005)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yrzQ+ihIbteokA8wV7/DYHa0Jz2PfwUWDqrj04RKv1q9gBn6+ARTc5aw4dNwqe3nTLPbaGYs6WwyHHLve44ZHf34XyCJ8frfOZbGhILuTq6ydtC06oL0R5KGQOesa3HNUFRCIS2Sb2sBw28ANW4qiLQfDKRNG3fSbsBUpmJ/cgLIsmMqpyd1d3fU3dNfyjifAZcPAvsKuEhcYW1hSP2YHM5Fx8LTfQwxtfBscPlkbGu5lHCDZ04LFU1vZI5+9qlqqUwP9plumqLUgjZpcycnfNe9yd6FicpSROXbYPXnv/WmTt/EqLwHAYmtoDneUoEP16RRgY70YO6HogAczv84egZ8HWwmU4YH7AUBqohc9UT0mBY2JYTj9ZRNWoTOPYzpFgjCIUs1EL9+MIDSQ7JvMysyb3QOyvK4EDYrouHiwWWG3G8ijG+9+YO7fBSbN2uh8zX2/b+frTGQ0i6ixxv6Mnz1gO3zpcwRrnlMHeeydAiGFhdShgzxi1x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ZiIDtin2lnaVhpWDQ0rJNLKgESgCX7jJNA7dv7AeSjfzhRQ1h63wP0j8ZCBJpxw= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a53bc5a0-acca-48a6-ab27-08db0e5712df X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 06:45:34.7461 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5D1GRCRK1mnGB9J0Gf95QjyPMjcUtYCKDNwtWe/ihv7aNp7i9mgAlSFwKUddQB8UcSIeCJNGB9dvfcAyJQYhH7b/+Hdu0wikqlJTCK8TrTw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB3962 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757788145863378961?= X-GMAIL-MSGID: =?utf-8?q?1757788145863378961?= In high temperature condition, JEDEC spec requires memory controller to double the refresh rate. This commit adds event_dimm_2x_refresh sysfs to report that events for all memory channels. Signed-off-by: Quan Nguyen --- .../ABI/testing/sysfs-bus-platform-devices-ampere-smpro | 5 ++++- drivers/misc/smpro-errmon.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro index ca93c215ef99..d4e3f308c451 100644 --- a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro +++ b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro @@ -258,8 +258,11 @@ Description: +---------------+---------------------------------------------------------------+---------------------+ | DIMM HOT | /sys/bus/platform/devices/smpro-errmon.*/event_dimm_hot | DIMM Hot | +---------------+---------------------------------------------------------------+---------------------+ + | DIMM 2X | /sys/bus/platform/devices/smpro-errmon.*/event_dimm_2x_refresh| DIMM 2x refresh rate| + | REFRESH RATE | | event in high temp | + +---------------+---------------------------------------------------------------+---------------------+ - For more details, see section `5.7 GPI Status Registers, + For more details, see section `5.7 GPI Status Registers and 5.9 Memory Error Register Definitions, Altra Family Soc BMC Interface Specification`. What: /sys/bus/platform/devices/smpro-misc.*/boot_progress diff --git a/drivers/misc/smpro-errmon.c b/drivers/misc/smpro-errmon.c index d1431d419aa4..1635e881aefb 100644 --- a/drivers/misc/smpro-errmon.c +++ b/drivers/misc/smpro-errmon.c @@ -67,6 +67,7 @@ #define VRD_WARN_FAULT_EVENT_DATA 0x78 #define VRD_HOT_EVENT_DATA 0x79 #define DIMM_HOT_EVENT_DATA 0x7A +#define DIMM_2X_REFRESH_EVENT_DATA 0x96 #define MAX_READ_BLOCK_LENGTH 48 @@ -190,6 +191,7 @@ enum EVENT_TYPES { VRD_WARN_FAULT_EVENT, VRD_HOT_EVENT, DIMM_HOT_EVENT, + DIMM_2X_REFRESH_EVENT, NUM_EVENTS_TYPE, }; @@ -198,6 +200,7 @@ static u8 smpro_event_table[NUM_EVENTS_TYPE] = { VRD_WARN_FAULT_EVENT_DATA, VRD_HOT_EVENT_DATA, DIMM_HOT_EVENT_DATA, + DIMM_2X_REFRESH_EVENT_DATA, }; static ssize_t smpro_event_data_read(struct device *dev, @@ -463,6 +466,7 @@ static DEVICE_ATTR_RO(warn_pmpro); EVENT_RO(vrd_warn_fault, VRD_WARN_FAULT_EVENT); EVENT_RO(vrd_hot, VRD_HOT_EVENT); EVENT_RO(dimm_hot, DIMM_HOT_EVENT); +EVENT_RO(dimm_2x_refresh, DIMM_2X_REFRESH_EVENT); static struct attribute *smpro_errmon_attrs[] = { &dev_attr_overflow_core_ce.attr, @@ -488,6 +492,7 @@ static struct attribute *smpro_errmon_attrs[] = { &dev_attr_event_vrd_warn_fault.attr, &dev_attr_event_vrd_hot.attr, &dev_attr_event_dimm_hot.attr, + &dev_attr_event_dimm_2x_refresh.attr, NULL }; From patchwork Tue Feb 14 06:45:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 56698 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2803057wrn; Mon, 13 Feb 2023 22:50:26 -0800 (PST) X-Google-Smtp-Source: AK7set/2P8W8gTxsfAouUcJ8kfH634TKiNKtQ2cAEW17JwPx5632dFMHuSN8W6bHxEyW7VSjnw3f X-Received: by 2002:a17:907:a4e:b0:885:5682:7e52 with SMTP id be14-20020a1709070a4e00b0088556827e52mr2275619ejc.13.1676357425965; Mon, 13 Feb 2023 22:50:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676357425; cv=pass; d=google.com; s=arc-20160816; b=Lw1uNd80+PBPg6SeWyTFNraS5F3GL9NH1rSW69Q3i3ymD3kmXLT5e6Vapr6uQZ1EFI toNbjolyujbRolV1nDOZqEZlUZRT1/XJMTcNaovqtuG6WQooz9dSpsBiowBVvo6ZVBgj F4qcp7Mw3Vy4qPs54vdzXalfhlDwfetJNuW9PFI8kWQJd+i6RvBz0MLq/npR4CkvVJGQ ke41EtuabL1axOqCK0dLD7ATAU4dKESJku8TOGxS+29Zo1aFd1Ylimjsa8XzrRam4cdA qLsBhyYkzsY2UfO4TjXx9mtC0QwaqAUQT6/3eiTtP91jrCM5ilfk9enooXpkdwjeX+80 tUUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AWAUChPo/u4uLIMKqytJT9gJ5W5sswUJY4XizDq0Y3Q=; b=jNhaPuODFg4oRMhey1r6F8hhhgMZRqGb5uZnuTimkhwd9u4r47E3fSQggiGg6e3ACr b9RMk/tSgHTQY77yT7n8A7JQRjlqrUOk3A5ilGmf6f7WhKxIJnZlo7qtgUjnlZcuXRG5 JgfeI215NP+vpPxhEFnkJZPUNutervAjmC3ylPDxgae9SBWIBcvxq2rw4vlc/rBO3iVO lKFX+nynWiA5w9ByreZCyb48pEKbes8zWRB5fAjKdXsp3QthLtdguUP3HwvQweky7e5x XHbDbFEh7joxehQr0FTpZHfBscLaRlbtmtdXyYlVI1rP6046mMvcC53uUcwtsp+pgsc5 F1gA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b="JxD/d924"; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mt31-20020a170907619f00b008b11939568dsi4526597ejc.365.2023.02.13.22.50.03; Mon, 13 Feb 2023 22:50:25 -0800 (PST) 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=@os.amperecomputing.com header.s=selector2 header.b="JxD/d924"; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231683AbjBNGps (ORCPT + 99 others); Tue, 14 Feb 2023 01:45:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbjBNGpp (ORCPT ); Tue, 14 Feb 2023 01:45:45 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2100.outbound.protection.outlook.com [40.107.237.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B23F1CAE0 for ; Mon, 13 Feb 2023 22:45:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TicLpZ1Y5XMSmnuLLDHh1oVnQsL8Wol9nJvGtEx/WoIBrk+mItC3xGkDfmUM0xvQ5DGs1vC5CJgadfpDrgwwSJ0quJsdCtN58+vzzkADPq3sF7IBaMBkb7U78VZ+MrlyBFTeRLjjWJl9ryNHLpcM3Ru658eRzb0tQoFmvP6cqr3BRNmFWuYUqnVOv8m3EYtnEylz6HEJ7jaGz4V38mM+Ph6gcO9VDamSpk5BtQGOh91Ab3i8TnnX5Qaj5P3BinEt77ueIDJgenDqFOsq8pdGxfb7MJJlqgKmKAtYak6jY+voxhj40/aVMJVTID/R0Ww0jnhpzyP80ktWt86OfQl94A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AWAUChPo/u4uLIMKqytJT9gJ5W5sswUJY4XizDq0Y3Q=; b=Kmthv1hxloVFY2OowDrYc+sEbCbDqJhmB8sRPf17ucc8LA/Itj6SVl4GgY+pkGhTzpoQwEPY5MWCOnKYy/v9kflkDWNXi9VvxgdBUsR/G+xkr8IjE/Tt6kbOglCYciWLF1fyoXgVbjeD3EcXGEHjeFhOkihWwPrOnvVvBbBl+3FhmO/5NdZ75akxkEIgBzmduMR3xAuVKBZfsrcKBV8DGOcNWKgZvB49/pe3GAcYz2uvU4pQ1uPPMqPwjWa5egtQ88HVIxTRcvpRpEZCQCAbddWUPoSrfVK02Qz3BDliqYEDy08RDnKBJWbGtXKWaACU0aLkll6hRIUm68uaPSFilQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AWAUChPo/u4uLIMKqytJT9gJ5W5sswUJY4XizDq0Y3Q=; b=JxD/d924eLnbj1EjpOIAmvObOCEE1GiKlcUjVXuYlqA+i9XBExIhQgk3RTBo8xA36oadt4J+/o4WwHaDDbRmlok1BMbQeoRZ5S644bLnhCktGDL+d70D0isU+pl9Ks+tLajwKrn7+Wwsc4XA5cDpwTjYH84HOPa9ecWtSGsMbyA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) by DM4PR01MB7738.prod.exchangelabs.com (2603:10b6:8:66::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Tue, 14 Feb 2023 06:45:38 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::bf6:8038:9fe8:1588]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::bf6:8038:9fe8:1588%4]) with mapi id 15.20.6086.023; Tue, 14 Feb 2023 06:45:38 +0000 From: Quan Nguyen To: Arnd Bergmann , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission Cc: Phong Vo , Thang Nguyen , Quan Nguyen Subject: [PATCH 2/2] misc: smpro-errmon: Add dimm training failure syndrome Date: Tue, 14 Feb 2023 13:45:09 +0700 Message-Id: <20230214064509.3622044-3-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230214064509.3622044-1-quan@os.amperecomputing.com> References: <20230214064509.3622044-1-quan@os.amperecomputing.com> X-ClientProxiedBy: SI2PR01CA0023.apcprd01.prod.exchangelabs.com (2603:1096:4:192::17) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|DM4PR01MB7738:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c2b7dc1-3261-40b9-ebfb-08db0e571508 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G0meULAQiqfM9LcqRl1E3ZCDNGdyomJ5M26be3I1qKyStnebbgPlCrcCRtIBNDv9xNqedaWh7BqH9Jof1f0867l/KPmzB+Au2eZHy1+CTyT65WQC/MATW/0SxaWDRNNFHZzxXx2gL/zU2y8yrbZ8ReP4ISrE/tPmW50Ax7nBKSl8wog+9TcgX4JDuLU58XfLh7n40P0zsbe9LKLYKvQLP0s4h9cxe+2Lfl6Q55a/GIrusPtqM7+Iy8yX8EqhQxme4BHT+IstLVqTMdI5ZFAqUSl91/WebEAiO6xMgQIbKaLQB3cBH3axZJEg5/a/xvfbuqjcotMkd00Rj+3v5qNcGn0x9+H/Gj9VZIc/19AzAZ/J03BzZaS0mS/hMQZIxph2HYLNJN+aNVrQ1RlbjhdLT3eEw9cetOQb7XRG4ghv0V2XBuJsPdSSZQy9ERzqbSzE2AniiL/6aL3MNUuF4MTPCnvmrT9VvQzE+QiEcllNiHXb+lZmnrTOe8OjVF3Y9W0Nzcdgp3cZIP60diXAL2bmqexmNfSUzMe0tkFC5nQdrneDL0l2xAj+NPe8BLdZiiJSPvlCvj9LBLWec7Ow5zDYV9etmRgz0qjMm1yP9gCuq/s4WxTcZnqwNxtYCmEgt7LDFBMUUNs3vxeaCP8/ntQoRMvNNAjGz25r8bg8K8svViTWyB53C5hnXUYpvHZx8fKhExLOLt6qXuNmZCbcVxvUgg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR01MB7455.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(136003)(346002)(396003)(376002)(39850400004)(451199018)(2906002)(8936002)(83380400001)(5660300002)(41300700001)(478600001)(6666004)(107886003)(6486002)(1076003)(26005)(186003)(66946007)(52116002)(6512007)(2616005)(6506007)(38100700002)(38350700002)(86362001)(4326008)(8676002)(66476007)(66556008)(54906003)(110136005)(316002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HpXTjnsuOKLkt93t3uK/hNBD4MPAZvrQDL6PirhdfVZ7Lx0pXsr52eSc5hBw4VvxBXsXh2D69/G05dS3zyI6h26a+SSwYpZSqhImTDXetEhzhuFNYaZEiDp/vSGrMNQj1sIxXbBqOKUCjDzld0GFLnIzb68XN1p9xza/J8W0F8U/z3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eqwJPgtIdKjal+OHAq31rSWOze1UcAI7HIeJodg5JMEmG2nGgRBnaTEKqOsCwKtGOcJCDPoXPGXck7JV9hZoVnFsa6AZH7fw5iX35zHBa1uhua+u0qF0FiQrd07ACdBrtt20+gMKAQjO6oPAZ6W6jiOBxB6/nSxzTri9/xvFtMQwedUpSM3+yxkecWPeSoLJWZgqOehbEBuIjl+DO2tR3iAqI0xxIhIb65FMpl92EFVZL2eU3POHvF4TqfaxbvHCVmqwvKaqIp6tSl+ufIaV2F78imS+R+RQmWds1ufrMhGcK4E+1q9FowiWNxEPhlsO5jHS69gDIcOh3bKyj7VyJU+GPdZ12yHuziR7es8fI+kVqj7s2sEAOKc+JbNJu6g= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c2b7dc1-3261-40b9-ebfb-08db0e571508 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 06:45:38.2762 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Eo0RfXqXuxXyr34Heigbm8FfdqfX+pcsKnMrKnk+yQlXakxvsDBUX/eUql0omiM8BmQ7438lca3cvOrCKLu1NEEiuljogpCCWPgn1tEo/38= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR01MB7738 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757788164438286563?= X-GMAIL-MSGID: =?utf-8?q?1757788164438286563?= Adds event_dimm[0-15]_syndrome sysfs to report the failure syndrome to BMC when DIMM training failed. Signed-off-by: Quan Nguyen --- .../sysfs-bus-platform-devices-ampere-smpro | 10 +++ drivers/misc/smpro-errmon.c | 77 +++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro index d4e3f308c451..c35f1d45e656 100644 --- a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro +++ b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro @@ -265,6 +265,16 @@ Description: For more details, see section `5.7 GPI Status Registers and 5.9 Memory Error Register Definitions, Altra Family Soc BMC Interface Specification`. +What: /sys/bus/platform/devices/smpro-errmon.*/event_dimm[0-15]_syndrome +KernelVersion: 6.1 +Contact: Quan Nguyen +Description: + (RO) The sysfs returns the 2-byte DIMM failure syndrome data for slot + 0-15 if it failed to initialized. + + For more details, see section `5.11 Boot Stage Register Definitions, + Altra Family Soc BMC Interface Specification`. + What: /sys/bus/platform/devices/smpro-misc.*/boot_progress KernelVersion: 6.1 Contact: Quan Nguyen diff --git a/drivers/misc/smpro-errmon.c b/drivers/misc/smpro-errmon.c index 1635e881aefb..3e8570cbb740 100644 --- a/drivers/misc/smpro-errmon.c +++ b/drivers/misc/smpro-errmon.c @@ -47,6 +47,12 @@ #define WARN_PMPRO_INFO_LO 0xAC #define WARN_PMPRO_INFO_HI 0xAD +/* Boot Stage Register */ +#define BOOTSTAGE 0xB0 +#define DIMM_SYNDROME_SEL 0xB4 +#define DIMM_SYNDROME_ERR 0xB5 +#define DIMM_SYNDROME_STAGE 4 + /* PCIE Error Registers */ #define PCIE_CE_ERR_CNT 0xC0 #define PCIE_CE_ERR_LEN 0xC1 @@ -468,6 +474,61 @@ EVENT_RO(vrd_hot, VRD_HOT_EVENT); EVENT_RO(dimm_hot, DIMM_HOT_EVENT); EVENT_RO(dimm_2x_refresh, DIMM_2X_REFRESH_EVENT); +static ssize_t smpro_dimm_syndrome_read(struct device *dev, struct device_attribute *da, + char *buf, int slot) +{ + struct smpro_errmon *errmon = dev_get_drvdata(dev); + s32 data; + int ret; + + ret = regmap_read(errmon->regmap, BOOTSTAGE, &data); + if (ret) + return ret; + + /* check for valid stage */ + data = (data >> 8) & 0xff; + if (data != DIMM_SYNDROME_STAGE) + return ret; + + /* Write the slot ID to retrieve Error Syndrome */ + ret = regmap_write(errmon->regmap, DIMM_SYNDROME_SEL, slot); + if (ret) + return ret; + + /* Read the Syndrome error */ + ret = regmap_read(errmon->regmap, DIMM_SYNDROME_ERR, &data); + if (ret || !data) + return ret; + + return sysfs_emit(buf, "%04x\n", data); +} + +#define EVENT_DIMM_SYNDROME(_slot) \ + static ssize_t event_dimm##_slot##_syndrome_show(struct device *dev, \ + struct device_attribute *da, \ + char *buf) \ + { \ + return smpro_dimm_syndrome_read(dev, da, buf, _slot); \ + } \ + static DEVICE_ATTR_RO(event_dimm##_slot##_syndrome) + +EVENT_DIMM_SYNDROME(0); +EVENT_DIMM_SYNDROME(1); +EVENT_DIMM_SYNDROME(2); +EVENT_DIMM_SYNDROME(3); +EVENT_DIMM_SYNDROME(4); +EVENT_DIMM_SYNDROME(5); +EVENT_DIMM_SYNDROME(6); +EVENT_DIMM_SYNDROME(7); +EVENT_DIMM_SYNDROME(8); +EVENT_DIMM_SYNDROME(9); +EVENT_DIMM_SYNDROME(10); +EVENT_DIMM_SYNDROME(11); +EVENT_DIMM_SYNDROME(12); +EVENT_DIMM_SYNDROME(13); +EVENT_DIMM_SYNDROME(14); +EVENT_DIMM_SYNDROME(15); + static struct attribute *smpro_errmon_attrs[] = { &dev_attr_overflow_core_ce.attr, &dev_attr_overflow_core_ue.attr, @@ -493,6 +554,22 @@ static struct attribute *smpro_errmon_attrs[] = { &dev_attr_event_vrd_hot.attr, &dev_attr_event_dimm_hot.attr, &dev_attr_event_dimm_2x_refresh.attr, + &dev_attr_event_dimm0_syndrome.attr, + &dev_attr_event_dimm1_syndrome.attr, + &dev_attr_event_dimm2_syndrome.attr, + &dev_attr_event_dimm3_syndrome.attr, + &dev_attr_event_dimm4_syndrome.attr, + &dev_attr_event_dimm5_syndrome.attr, + &dev_attr_event_dimm6_syndrome.attr, + &dev_attr_event_dimm7_syndrome.attr, + &dev_attr_event_dimm8_syndrome.attr, + &dev_attr_event_dimm9_syndrome.attr, + &dev_attr_event_dimm10_syndrome.attr, + &dev_attr_event_dimm11_syndrome.attr, + &dev_attr_event_dimm12_syndrome.attr, + &dev_attr_event_dimm13_syndrome.attr, + &dev_attr_event_dimm14_syndrome.attr, + &dev_attr_event_dimm15_syndrome.attr, NULL };