Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1887552rwb; Thu, 17 Nov 2022 03:38:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf44MUo21UvsFjC2jDZ5jWL3lmByhdGWm7p6tN15ZTsF0uK4O9lej4KVWFY0c2qIPXbD49Dk X-Received: by 2002:a63:ed46:0:b0:476:e11d:8d51 with SMTP id m6-20020a63ed46000000b00476e11d8d51mr1711529pgk.252.1668685087938; Thu, 17 Nov 2022 03:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668685087; cv=none; d=google.com; s=arc-20160816; b=COzTXaM+cJ6ySi14/zF+ew0APxNCsbRNcFfbAh8TtUgf1fWvHma6DH6FLH172ytoid pOrSrIjjQuxUqSZm8SpV3BZxHNXHsG5bcO6VM5N+htqEENvWuRGZrTKufDreMHc1vQZM LbQp7Htq/ayI1lKRLVurYUsbxaKPfytSZdYPrOw2fVRHGPL6ZKbvsutUpKx7i+uQVrty 6PrKFk1oQHFa0PinktdBY8pOguqhAVEp3twEuEQ//IiUbI3diPAr2npdJ6wN70tdlxha ryt3DEJwwo8wNaXrAb2/3FJgqztUHUELY0qYIv9bpjwWOIE2ICxSP5L8Mc1wgUvlROso Wm9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=oqf/RZ5X9tbr1BrNRjXgz06QkL7TFp9/K+WRK8IguAM=; b=KwvXIPTn+RflVpBVpwVmjON0bwtXc9lGv/YHH8wZiOUMi2cv0z4Xat+wcINSHZec1z +NVIiahrmja4jSBrJ6hvgWm1pDIA876/BjFPT8YW6+RSVXMtoCCE5V/zAIOM2zotYxOo PSHbPFTJcbKuJy1SO51J6EcvPuWA3lUvQgY3LTdvZXW8bjn94wi6ETPpC6b5JwseskG2 jvdXvpgfI/uOeCrLfyuF3cEgMpwJpiXRjFQxK6dUskbSnaH8/tLjMg4ZADkhWkMmBq++ 54SYuSdkU+JSjaX9iflVAZvzF0Di70kPZJZU4/8Rz2GPEVXQlHMTpHrLJIyTYW/NN6Vo EKMQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa11-20020a17090b1bcb00b001f06a6fdb2fsi4990103pjb.27.2022.11.17.03.37.56; Thu, 17 Nov 2022 03:38:07 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234887AbiKQLWl (ORCPT + 92 others); Thu, 17 Nov 2022 06:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbiKQLWi (ORCPT ); Thu, 17 Nov 2022 06:22:38 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2380C2F3B6; Thu, 17 Nov 2022 03:22:38 -0800 (PST) Received: from frapeml100004.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NCcs62FtSz67bjw; Thu, 17 Nov 2022 19:20:10 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by frapeml100004.china.huawei.com (7.182.85.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 12:22:36 +0100 Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 17 Nov 2022 11:22:35 +0000 Date: Thu, 17 Nov 2022 11:22:35 +0000 From: Jonathan Cameron To: Ira Weiny CC: Dan Williams , Alison Schofield , Vishal Verma , "Ben Widawsky" , Steven Rostedt , Davidlohr Bueso , , Subject: Re: [PATCH 07/11] cxl/mem: Trace Memory Module Event Record Message-ID: <20221117112235.00003243@Huawei.com> In-Reply-To: References: <20221110185758.879472-1-ira.weiny@intel.com> <20221110185758.879472-8-ira.weiny@intel.com> <20221116153528.00005af7@Huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 On Wed, 16 Nov 2022 17:23:58 -0800 Ira Weiny wrote: > On Wed, Nov 16, 2022 at 03:35:28PM +0000, Jonathan Cameron wrote: > > On Thu, 10 Nov 2022 10:57:54 -0800 > > ira.weiny@intel.com wrote: > > > > > From: Ira Weiny > > > > > > CXL rev 3.0 section 8.2.9.2.1.3 defines the Memory Module Event Record. > > > > > > Determine if the event read is memory module record and if so trace the > > > record. > > > > > > Signed-off-by: Ira Weiny > > > > > Noticed that we have a mixture of fully capitalized and not for flags. > > With that either explained or tidied up: > > > > Reviewed-by: Jonathan Cameron > > > > > +/* > > > + * Device Health Information - DHI > > > + * > > > + * CXL res 3.0 section 8.2.9.8.3.1; Table 8-100 > > > + */ > > > +#define CXL_DHI_HS_MAINTENANCE_NEEDED BIT(0) > > > +#define CXL_DHI_HS_PERFORMANCE_DEGRADED BIT(1) > > > +#define CXL_DHI_HS_HW_REPLACEMENT_NEEDED BIT(2) > > > +#define show_health_status_flags(flags) __print_flags(flags, "|", \ > > > + { CXL_DHI_HS_MAINTENANCE_NEEDED, "Maintenance Needed" }, \ > > > + { CXL_DHI_HS_PERFORMANCE_DEGRADED, "Performance Degraded" }, \ > > > + { CXL_DHI_HS_HW_REPLACEMENT_NEEDED, "Replacement Needed" } \ > > > > Why are we sometime using capitals for flags (e.g patch 5) and not other times? > > Not sure what you mean. Do you mean this from patch 5? Nope +#define CXL_DPA_VOLATILE BIT(0) +#define CXL_DPA_NOT_REPAIRABLE BIT(1) +#define show_dpa_flags(flags) __print_flags(flags, "|", \ + { CXL_DPA_VOLATILE, "VOLATILE" }, \ + { CXL_DPA_NOT_REPAIRABLE, "NOT_REPAIRABLE" } \ +) + Where they are all capitals. I thought that was maybe a flags vs other fields thing but it doesn't seem to be. > > ... > { CXL_GMER_EVT_DESC_UNCORECTABLE_EVENT, "Uncorrectable Event" }, \ > { CXL_GMER_EVT_DESC_THRESHOLD_EVENT, "Threshold event" }, \ > { CXL_GMER_EVT_DESC_POISON_LIST_OVERFLOW, "Poison List Overflow" } \ > ... > > Threshold event was a mistake. This is the capitalization the spec uses. > > Bit[0]: Uncorrectable Event: When set, indicates the reported event is > ^^^^^^^^^^^^^^^^^^^ > uncorrectable by the device. When cleared, indicates the reported > event was corrected by the device. > > Bit[1]: Threshold Event: When set, the event is the result of a > ^^^^^^^^^^^^^^^ > threshold on the device having been reached. When cleared, the event > is not the result of a threshold limit. > > Bit[2]: Poison List Overflow Event: When set, the Poison List has > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > overflowed, and this event is not in the Poison List. When cleared, the > Poison List has not overflowed. > > > I'll update this 'Event' in patch 5. Probably need to add 'Event' to the > Poison List... > > Ira