From patchwork Fri Mar 10 08:34:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 67282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp760975wrd; Fri, 10 Mar 2023 01:02:05 -0800 (PST) X-Google-Smtp-Source: AK7set9XudIjuZUluakIdTK0eBwtt8YGyvUw7Fo4pgdY9eh52jExGMC55xkJdnEO/SPcWXPlqa2k X-Received: by 2002:a17:902:ec91:b0:19b:2332:18cb with SMTP id x17-20020a170902ec9100b0019b233218cbmr30876349plg.1.1678438925499; Fri, 10 Mar 2023 01:02:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678438925; cv=pass; d=google.com; s=arc-20160816; b=KgyzfhBUUL9qGXO8RBimxu5qSRD/G+isyRnJuigeC581HQsB6WjQJAy8dsqzKyLJ0l oZRLO4JLVBmt5TH5JdH0NgR1myJd8NdNrRXCsSMfY88p7TFzw0KtkeeuVcz8D8p+PhV3 Sd8qwnddGkERu8YPqWrxQABW3+mD4UnYsqdqM663M95JBT5ClI4HPxOIvqMQvMKK0JLb r5nwnWfjZpEldXbJgfuneFcLJksc1/WhKHShOI2Z5AtmDq2101RYU0i5JMCSOxEwnJx5 JuUeV8C5VxP9ai2IFGvYSkPr4G5kSyoZAhZHuGkbPuJQuVNLjUiJ5mJvdur4Oii69px+ 03QA== 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=FnhBdbDz3cV2lUW7lqPi1e6JU52JQC6kMKIpCJIbwPY=; b=JuKbgrd9u2qhWG0EJVXWeTc9oZN09hSElAWLYi/o86XBZH36j3wVdcnQ1G5zbBPO5O do+epq93fG0a/Xr+ZxVMpeUasLgV8U6ZS5JIetz9lfBXefFNujDRWGzji+dxqZXwJnVE vZEETv3fgkkPxhWnmdFg75w4pJXutCTbhBZBfK+1HVPLH9mWfBOp04sMxoa4fN+ch9Yt Y1Zz4UQ0DibkqvGTctOc5m65THfWJzzmOQERhN9CwhhkTKJ6+yWS7bUluoc+IwGhBfOx 70eTpujcSwBSoS0EuGAYr9Ghr2XVMBUWW97nYfdqgYqj58nCZsAMzS09BrWl7KGUtzZt 5oag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=H+Wyhxfv; 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 km12-20020a17090327cc00b0019ad97d72cfsi1541820plb.590.2023.03.10.01.01.53; Fri, 10 Mar 2023 01:02:05 -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=H+Wyhxfv; 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 S231210AbjCJIfX (ORCPT + 99 others); Fri, 10 Mar 2023 03:35:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231158AbjCJIfM (ORCPT ); Fri, 10 Mar 2023 03:35:12 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2092.outbound.protection.outlook.com [40.107.92.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45ECC5AB77 for ; Fri, 10 Mar 2023 00:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pg/9mmMMd73/u92uTkD5PQ8/JKaNLHguugGYB2RWvgpVr7zhCHWdFXFDYpuiP5fvoWdXHUwAwVaUCsbJ7M8sfrsy3Oec7+B6M0R1Ce16N5X9vSHhu1viq1oWuM/nuTvOXw2phBWiPoQaYCFKgMYm7w5Y93xu+4KKv4IspG95xi6W84xjglYWtzJCymmtoR8RvUrzquAbBXazHXdZaKsG/WQ0UMAB0AyDLedck5FpkDqyyfxeU1K3+Gnx/apgcYbYYE+lh1U8XCCvgrbgv8fYozSWCWBQ3tf8qKOKLSMPltlFEt73IAwNmI0F1zTaJ8YnNT/fWSXg5k2OsKOBzdpeZg== 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=FnhBdbDz3cV2lUW7lqPi1e6JU52JQC6kMKIpCJIbwPY=; b=dR2k4zyqMVuaTO0AdfbSPay0TzQW3gFq9MMBSoLyy1TTEvd6Put3maQhLLWtMjvwb4yok82nOluh7zF7vUJRMsiAcBgImj/uYqEh56PLe8TDEGHkUMNEGEx+CszkcizCh64RhTjTa/LbRDzRQSJ2RJYwUPQdEy2Js8TX95B/aw7VraUPCjcllzIELijIFOJB001gt64KLf1QiJjHy/kTXxQSleF5hLPCueLkV90omJG48lXyjyf7UhZjb8GjdtgXzYAmFYXNQxRyNDLuNOqNtoHoCecHJP3KD8QHEoT6M0VU+edP18fa+3nwnDCmkjChp8voDhs7ySWrFEumXnqh4Q== 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=FnhBdbDz3cV2lUW7lqPi1e6JU52JQC6kMKIpCJIbwPY=; b=H+WyhxfvZ30ue4+GdshL6C5QWoGnLlrrKeqi7LmBmtzIkH0nXp9GM0r9kibSrHyMdi5yTDMs6z9sghPmwJSycoKUQSKALbNU4SrJKUntJovYqpuigFyB15mWiRJQLI4vabGMBn3atRMvpTL8BSEW6K6aeumhUl/3RSStwhIAwHk= 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 MN2PR01MB5917.prod.exchangelabs.com (2603:10b6:208:194::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 08:35:06 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::ff57:42f9:7d6d:de10]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::ff57:42f9:7d6d:de10%3]) with mapi id 15.20.6134.028; Fri, 10 Mar 2023 08:35:06 +0000 From: Quan Nguyen To: Quan Nguyen , Arnd Bergmann , Greg Kroah-Hartman , Paul Menzel , Joel Stanley , Andrew Jeffery , linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission Cc: Phong Vo , Thang Nguyen Subject: [PATCH v3 1/2] misc: smpro-errmon: Add DIMM 2x Refresh rate event Date: Fri, 10 Mar 2023 15:34:15 +0700 Message-Id: <20230310083416.3670980-2-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230310083416.3670980-1-quan@os.amperecomputing.com> References: <20230310083416.3670980-1-quan@os.amperecomputing.com> X-ClientProxiedBy: SI1PR02CA0055.apcprd02.prod.outlook.com (2603:1096:4:1f5::16) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|MN2PR01MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: effe5eb7-26f1-49c5-eb8f-08db214259e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kB9NUc1KGNlvVdYmvVj9iIcxk0vv5KGKrxVULCuR+oKHOck4DC8kKv9JQysEKRAN2jGFUJy/4Ow6CJpmFrKM0vdTfJhcDGe0ZoAA50EdYOD1/sLuIcwqfv99m0Ylo3ytjDYLwA/1/JMta6ZJo9QqETZfuxWTuwVmZf4USaq6DVR1gukjtG5/pg4Ql4wxHhx2SYIyHvw8RsmERax/gAIE0nBRt+ndm4VXPXm5EIZWe+T82MipTSe4M8CIytDRgiEZAYvcgn/A6mnUCmNgJH04eTAqn6iSU7HsdE5Zc4MbpDB8KDuYOUrilAUFKbEdIcYWIL737kb3ZSHSDlqAwO0Nf2QzjwGP3BAIDNWVPYGdwRWWYuh4p3x84WsSryEZeE19U/2JDpgYWOq2hazLNqWaUvP0YH1YfeGoW8YNkt7Am6FbZmMbQXB6NMuI9FLB6k29bHObUDkQYbTBdgjl2hO+eBUj2Gz4uFlwnhg5tPYcNykRCYHPjvBkXml/xD+NhvNzZhbWiPlZCPglunT737ZEthe9ivByMx6EsbVXJu+xVWd+WvVEGVDAAXq9C3hX7RJtAD9ZTDjacQlKLBeMiXu9QYJDTWaJveMMBC7j7WBqnsxhKDzlmAfklg6D7eBW3oeeTisaOYc2/uuR2zcdnhtdkyRX3CtU2F3ae+ivxHtKfRALT6fMQwpZe9PvoAHp0fTMBG9S3d2Pyrd/Q0TUuMUHKw== 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)(376002)(346002)(136003)(366004)(396003)(39850400004)(451199018)(54906003)(110136005)(6506007)(38350700002)(38100700002)(86362001)(1076003)(2616005)(6512007)(26005)(107886003)(83380400001)(6666004)(186003)(316002)(52116002)(5660300002)(478600001)(6486002)(41300700001)(66556008)(8936002)(2906002)(4326008)(8676002)(66946007)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3qiuL/NZVeATkP3owOJwLHUfgSlCjh+YKTilJxM/V33i4E51pTR5TvrtnoYjg3PO+Ux3ynvX3w5OPge3s61mbKcuUFE+JBuMiq5UwlKo+cqUL2hLNr5FqCkstkOVouHuHkb6tCZILrXVIdDFMYGaUnM1EptSwwhbl7X83Ewh0SJACqFkBbxvifRZbD36mw2482ppIpC5TiqWGObMgl7vT7DRP3AUsj6IEzStGQb80Tr+yULLiyxS1Tlg4WZr8t6D9RPI2u9o+uUpgelaijvAD+UyT5i4nZhGjXBQt82LnBPqYqDitkgz+mqTRoYoF9e1qD9CF0mZJUmevq2HXpY54J3UomEtO1LUOqj8uTXYfI8YCbSckR9mAhGdaOJ9Fei5WfOWE/erL0KYHcoy+E62Jo2g+i83NkfTrtMGKzYYcA9iWf0DMvVU/3TS5C3x+GcxBcPdc90T1StltUQiiy3wnmaFmo6PNfdHyWd5Tu2oQUtGs9JVXfOYiYcqdK4SF02/Ddsp11qV+fF6leGU1LYM5UnPz5l2wiC1GKdskYiVIKW1Jvu95NrM/5AcMQ3lEmtp2Sxqu8NrnwPPz7AuybcHhUB7eUfzgdNIehg53Qm+mRhp4uUUlhp7YGVKnDKkzVszS2mfm/tn9JLzpADWuqgGwVr2ZN549CfSxdJVG6MkFR/fihe/dig5E00n0IVxjFO1uWsu5aC7K3KVDyMz2g8pghYSf1Zq3KE7AyKJMQ7xSgFmRoyPgYrAqmrSui3y0H9u9P+Em5m23VrunIGda7HhvmflVygivTaZRsR1pszaJ/oDn7QkMqTYHwHUwTpL23sLWcVI+fPzxKDcRsNY283uwyPsv2AsP9Qqr+hxVK6UbKP4CWwks2S6atTLrH15DIfPtmcnEQodKxUh3ZofagXm3PPVZNfTzVtH+fhzc0vN7fmPRqXYtMb+l3r9Qe65EIs0euKEo6YZ1U9N5oo8fRty2BuHZT2d8zAkkGcBC/epKi6naD0VzswuwyAI02nfIuRW6HAvzwXu9IR/4bfjr4wdv7bwudfjT5t49rvTnRZOU8fhB7qJusFs7KozNZxQnuHawmg/FzU3kc3kLgfkWpm49gd24I8MtTzAM6wxvqmTJ8edPL79JGnVOyA0pqNK+aNqe0fQSIaYplWqxG3BBM/FS5WXikx8+9Yzk7nwB+kBcbcmuzWKrT1BvW3M8ZFp6UZxJ3lz3jo5uG4n41kTNZzfqntmEIHuYNbYE0Abuagueb7x6L3KA53RCZW5u2oO1MasYl87LuxOjepJ1ZoaVjyW1+eL9A1XvV9EkFdxQWT2+KBGk5Nx1KSaF9sYagyumDz7OJa7989AuSFVXHqDE9f4WvN53fN6r7zwZKRjp9GqRfbT+v2IR6mIK8605aENJFm5vcFmfuj1GllFBZPSQZ3MRc2btUDvWCUvIgP0p2knMoZFmw5v7uUCbsxBySu6jeKB7ejscZJ2aFVCUWJB/kl+Tzd0qr4y6Tf2N33gn/AsdSS/NpY8+b5vFTqlH/mRlcnnsDxGqi6SXUVSQrEJ1B9ormjulIcKQw/+gzmDtuqsk8BCwjAx/JjtJjHXaH/bgP60em667qcYkSKGCZ4rk94PPgC/MKB+Bvoz7VkoF4gJ8C8= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: effe5eb7-26f1-49c5-eb8f-08db214259e7 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 08:35:06.5798 (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: QakyP60e/OVJVFBszOqYUiA7t45waouTUCU+npUewCuGOLi4JTI8U6N89KzFB4o7uPzmLpQpBBeIyNhqzCu1detTMp29meCd++Df7Ukh65g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR01MB5917 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,URIBL_BLOCKED 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?1759970774610872188?= X-GMAIL-MSGID: =?utf-8?q?1759970774610872188?= 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 --- v3: + Corrected kernel version to 6.4 [Greg] v2: + Corrected kernel version to 6.3 [Greg,Paul] --- .../ABI/testing/sysfs-bus-platform-devices-ampere-smpro | 9 ++++++--- drivers/misc/smpro-errmon.c | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro index ca93c215ef99..14b58c893df5 100644 --- a/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro +++ b/Documentation/ABI/testing/sysfs-bus-platform-devices-ampere-smpro @@ -234,8 +234,8 @@ Description: For details, see section `5.10 RAS Internal Error Register Definitions, Altra Family Soc BMC Interface Specification`. -What: /sys/bus/platform/devices/smpro-errmon.*/event_[vrd_warn_fault|vrd_hot|dimm_hot] -KernelVersion: 6.1 +What: /sys/bus/platform/devices/smpro-errmon.*/event_[vrd_warn_fault|vrd_hot|dimm_hot|dimm_2x_refresh] +KernelVersion: 6.1 (event_[vrd_warn_fault|vrd_hot|dimm_hot]), 6.4 (event_dimm_2x_refresh) Contact: Quan Nguyen Description: (RO) Contains the detail information in case of VRD/DIMM warning/hot events @@ -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 Fri Mar 10 08:34:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quan Nguyen X-Patchwork-Id: 67278 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp754839wrd; Fri, 10 Mar 2023 00:42:42 -0800 (PST) X-Google-Smtp-Source: AK7set/4g65yBEU3goo50zEHC758DLbgoGNBg5qaiNo/h1+i3/Re14frxRW8KsnerDviTBWBTj9J X-Received: by 2002:a17:903:1247:b0:19e:e39b:6d90 with SMTP id u7-20020a170903124700b0019ee39b6d90mr13018825plh.25.1678437762153; Fri, 10 Mar 2023 00:42:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678437762; cv=pass; d=google.com; s=arc-20160816; b=fkK64J3juB+gwx/Lf1PvO0aPqW2NF8yg9tqO4SanF5MRi5P5dxEtib/Sgvk1eD1qEM Ko6gBp15a47+XyKPwSRcwc4YJEls2deJwfpSGAckVxZ2Ig6Op6KtWwHeIwrL8xILi8Xi mg6/xXK2diwmqvAf96NH/3Ir85BOLfmsiylaEV5OhKnewZYBHiGA4z+FsBda6SkmTuM8 UpVdcjyzHNYwywEOpBDRwLwnQNQbd+L3vF2+F8tpkI8+536QVT/LCyyfgZ797DuhkhKe u19ag8oNsXPZ3lLaOmR3Pl3VGU5sGmd6vGzxf2YiXDq29HohE+/JGHUEK/nPiyD+vYIY N77g== 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=xRLPb2sXuW8r6ok6n6zo2W5AWbDjwMi+cmJb4GcOE5A=; b=TV4R5WPr2ng583EQ1A46WSFTBR9Ee59oByyQ9kjnPY46swAJFU+2F8SSYa0okQEgH2 XQKr1VASkvDNqVqktf+efvtQ3ucDHuQ/hrKrT7+m+LLXHj3FrDHhDgLl9N669vJt+3Eu PFnVvZAIKT7PMTLv0nPBARx+mfP3iC9DwVVJYIfxGkxiDXqpB1P369JVUCGbixa+2T45 vrB8K/eCtQmE42UhHwZBHuMPZBV1wpxwZAtKYoqW51zlyvRNADuynJLmMCQ7SdQl/O2u z2bBV6rfo6BRS5ol4KZ0C+xdd+fjecWHSqB1K9OS1BAsV5U8D4DbhWWRZrWToQ5EBcOe /DxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=c9UzbKyC; 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 ke4-20020a170903340400b0019a7375dfcasi1619863plb.247.2023.03.10.00.42.27; Fri, 10 Mar 2023 00:42:42 -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=c9UzbKyC; 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 S231284AbjCJIfw (ORCPT + 99 others); Fri, 10 Mar 2023 03:35:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbjCJIfQ (ORCPT ); Fri, 10 Mar 2023 03:35:16 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2095.outbound.protection.outlook.com [40.107.220.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 459E05CC3C for ; Fri, 10 Mar 2023 00:35:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MV1oK24DJS5tvu5037G3fMR61LQmUf1rHTIeMh8eQ5bQJFZms/+kgrwSDzDk1SGHQTdVRGsfrGq8Ay9GrfXgL98oc+WbROyXojTJwfddnxc98+noJFe1xEs/VX452xvaTUFKpgGeDUlbz++pWhhiX9x0Yytfq7r5wSPWWzKuLV1EeqZIuguBYaEVa9VPfj1OZ0ClcEKwGf9ZLYeuK0a6IFyTG6bXGTJmaE3PDn060BK4OSdd4Ja94zCua5T72Cm6a9AqM26zMFQGEojcuOQ+06PxPQylQstgDS+sIt7B2YlExErRyoQWj7nhE1lH+16wF9aE62cbONeBvNvzrBqW+w== 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=xRLPb2sXuW8r6ok6n6zo2W5AWbDjwMi+cmJb4GcOE5A=; b=hPUZb7E8Mdm/Hkg84Xc63m8Po4MOyI4E/EPkTtPuG9zsx85G5ZefTklFN1JAJtnhPqxRodHY9q/IXCduELHIrRpoVzdGh8CbsJPbusoY5yeNd/Az1tAMaWe6HTeelTCZWn+wNIffHnvsRECZp+SloODhDWtoN7ZYlyIpauMUIZMKoJLAEq1vmZrabgRwJfOBGyKyMmGxtcu3Uh++OR1S7QQNp951Nf5ZCvcH3pKKwNPCXhCKpqIMO5VVn7lEtW+c5X6+mkg24oGxQ6BCbGqwkZ6w1ClA+waqWvq3bagq2Dfkdzbv76yoTT6bW4eoQhexrNDU7MOIqUNYb8oDMJ1rUg== 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=xRLPb2sXuW8r6ok6n6zo2W5AWbDjwMi+cmJb4GcOE5A=; b=c9UzbKyCVJI2TmCQrjPI5SSoJLyVrne3YfefAe26LOf2E9DuiaFIcOZiixlwKnSYUah4PRzld46ugBR6wY3bcjsLwiO+YHkV19s+/tC/f7HofF+13CBRYRcehiTnOlHmhKCjRxYS5+Ojsz5ZeguFPOmvVllfT32S7QgSK75JIZI= 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 MN2PR01MB5917.prod.exchangelabs.com (2603:10b6:208:194::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 08:35:10 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::ff57:42f9:7d6d:de10]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::ff57:42f9:7d6d:de10%3]) with mapi id 15.20.6134.028; Fri, 10 Mar 2023 08:35:10 +0000 From: Quan Nguyen To: Quan Nguyen , Arnd Bergmann , Greg Kroah-Hartman , Paul Menzel , Joel Stanley , Andrew Jeffery , linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Open Source Submission Cc: Phong Vo , Thang Nguyen Subject: [PATCH v3 2/2] misc: smpro-errmon: Add dimm training failure syndrome Date: Fri, 10 Mar 2023 15:34:16 +0700 Message-Id: <20230310083416.3670980-3-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230310083416.3670980-1-quan@os.amperecomputing.com> References: <20230310083416.3670980-1-quan@os.amperecomputing.com> X-ClientProxiedBy: SI1PR02CA0055.apcprd02.prod.outlook.com (2603:1096:4:1f5::16) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|MN2PR01MB5917:EE_ X-MS-Office365-Filtering-Correlation-Id: f81f4239-0e26-4656-0889-08db21425c30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NYCgdyxhHdTGlUf2UOVt+pURizeqb/mpOnlzJk+SRYX2/aB3y8Ys+TGx55hWH2rziDBBwFM51MWIo83BJN+EaEksHAW9tA2U2p0nmwiiUAueZ/dyau/ACK1yyIuvzrCJVLRpjOEHq3Frd8YcRJ3syUCM+hmMdGIc4k7ymAzjm2qn+M5cYzYH51zc9zGjD+k/Jcs3i4Dk1Acxry1xHenPI1+0lBOIJNQzV8sdGOTMVffYIHojgiR4eI/Zl1ZHVwIzx+Gox2QTKLJBwhuuxS4xAO5o/fgvrtz/M7N+5SWn+VOT7bmVOYZ5v5BPHGU8tnY8yAuofwe3JIPd2nZVLJOzG0oSD9scDhYD/as8LTj5I1vhIDakmK0TxP8PDLAXcErgsr2QjG/1R29+o8FNfajq8HH+QiuyZB04dznyVuc7WcedC2sNNDkgSBomjyt7EzkWAT4VqCjQceo606v+qfdRE3fWRax6BUO3zIcojrO2xzMCbaq4JynFgsC4QDw+vxpx+Ehun/fhy4FCofKv1bq+scBPyp11yrX9NgbH26x6ycK2JTS7MvMMq83pMbc15IJopOlUE0BMv6KCS3HKXgFSaj/8zXevFU5HnPkJkq/MzP36st671rYP4idi+w0WDyBB1U6vLg/2BMpFfmSWfMT4UKa/wIWxrtknyaiFSQrquiOJdxCanD1bykmjOmoulGD5 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)(376002)(346002)(136003)(366004)(396003)(39850400004)(451199018)(54906003)(110136005)(6506007)(38350700002)(38100700002)(86362001)(1076003)(2616005)(6512007)(26005)(107886003)(83380400001)(186003)(316002)(52116002)(5660300002)(478600001)(6486002)(41300700001)(66556008)(8936002)(2906002)(4326008)(8676002)(66946007)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: urNAX2V17Ot4Q95mHLstr18p0zPP301GZ+U36aY2yuO5NomC6rqq/go37tEbbM2Kg3/WBLNSSEXt0x+Wj/YzjTycl6jffUGFmhMeSmVTSlIPqpjDXL2MimTuQu7y5IPVEKL8fIUEWb7s/jXDAssxUXqP6PXArsq6bhCDoCRJD20XvHRvHt5TWNvXqYILpkRPjwP+A5Nw1RrvlqFkB0Am1nT9TfS4MVgpTLrkaF7hsy/fbypvHFjCOlvNeEo8YZ/hTCfnKaIgo5LM9jJ6TyxeeFe3gEbgQGgqrGTw8bLF38Tm/JsZzQbfCSsZuwrRNvP/vtZWEMcz7vlJ8k6KZoGymXcS5nqBxUkiQqLXEKy8pkfRJ07C7ElVYlI1VHJldv1sdcld8S6PTEGH+dFXPmJY0keXE/NUN0MuShPUXOTlyD5htBlv1ET+Aj7Z1oAKUlnryj0U2EXY1z8i1B07J/2e3t/Jnfg9+G3nTUobkf1bYC8/UoOVQwFUKuQo7sqhDKQYC1v0wnzBvr6XDVQLiedwtseVmtjdEkqvjR24qU4FMz9iWLsgz9H1U5vv6ifXO6gQrE0kHqY8CV+xIqhPDZ13qOlRiVT3DBPpkI6qg6HONRMtrykHlDnjWsH2hAbhVKkyKBnVG4eQo1Me2UPD6KdsRPlpmsOcNDgcEUbzjTskO7Hi8VOyVs4+gwOM3h5ZeTgI7sOgeOP+B6rOXrG1MbH7pKKAUcnWt2lLaaBew8i5WRRF7rGwlUaJpmkk2H6SCjBKabp0fEqdvaSKxZSJWW3/Cj3D5dhcag8jXQ9G1u63LFxfrifSiGzDj1UU9oQwdYMzl+lTPnnImKyDXSolqJMr5xAWCGOyjlFFYpS9QpP7eWKN8kik7qKM21CTjjJ7nWHPx4x/yR2O/STuD5wvI0r11XMFl0Szt88AzqzDOUMZ3X8eYOaQeQT2alvJck2qGv745BgJOQuKjGUWAs4vOLSVVjZM5Ctl/pIGd51FwMPhC0+tWUIITsIFf4w1tj8RyosnW5Nd/QkTCETWf5IQ5ZxRZVe/4O2Xz2hs+7ZWMW5J/X9SUt8qLGJgkoAKtz4dGKpIs3eQO6Kg6LgpYfTihoLjRurbO7AxoFAiR7EPEofJBh47SQ6knJzwoBBfqQr22fVMFY/6FW2CdMnjpRwLPvgI8qV1tvxqOd8QclVm+MwGvHdjePk8jUpw6d0Yw8InAFQkkASpYpCScMEZN0Hvq0vNfC0ViBASk7LU3yhMcjblpBOk3Gpp0pNplc8gqDxUPba4Z19pbpVppdntcnVHUHWKtS5qMTUmJuhxMR2rpnJ9KohRhAHB/yz1OHSRROIxG8ggQjw+AO85ve6F278xxZne48JSqvy1CboU21YdnyfBuFupFXpD8CjGt+mAPgXmV2zIg3G4p36dgtCeUVD6efL88vwFIS7DQXX5bAZgyH+XU0RR0gPKb7FcUvUso37ZF1Y/O+5G9Ny9owZIxWLMeNjODWygdqsVEz7FF4B+n9niDOnQEz3nN060xFGto3wQZtRszIxf43p3f5zLl9nvdm3fkmT4BfMN9lIKE+MNlI2uCh4fOhW2gQ6UK+vfnlXRiXDEzQf07R50t3XuV8mjJJEaMZj7SW4lpL4oO+RASN0Zs80= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: f81f4239-0e26-4656-0889-08db21425c30 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 08:35:10.3454 (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: TsllEoQPGzCUsi/XQaNJWN/FpO8Tn42J8ZY2EYh0gHg9nBSShAkl6WWNZhZhSwUipMzhvj1sN6NTTP26eT4oOxyT8nznFUNM6Q9gSvRQjqk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR01MB5917 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,URIBL_BLOCKED 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?1759969555052301082?= X-GMAIL-MSGID: =?utf-8?q?1759969555052301082?= Adds event_dimm[0-15]_syndrome sysfs to report the failure syndrome to BMC when DIMM training failed. Signed-off-by: Quan Nguyen --- v3: + Corrected kernel version to 6.4 [Greg] v2: + Change "to initialized" to "to initialize" [Paul] + Corrected kernel version to 6.3 [Greg,Paul] + Corrected variables type to 'unsigned int" [Paul] --- .../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 14b58c893df5..fead760dcf77 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.4 +Contact: Quan Nguyen +Description: + (RO) The sysfs returns the 2-byte DIMM failure syndrome data for slot + 0-15 if it failed to initialize. + + 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..a1f0b2c77fac 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, unsigned int slot) +{ + struct smpro_errmon *errmon = dev_get_drvdata(dev); + unsigned int 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 };