Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp917342rwb; Fri, 13 Jan 2023 05:55:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXty5TeOHxQu2GqieArbRGCnvaVdxgrf0nlWfj3rRgv62jcIRVp/172fTFS3/0+/7/s5PWdU X-Received: by 2002:a05:6402:d71:b0:498:5cfe:da81 with SMTP id ec49-20020a0564020d7100b004985cfeda81mr22749614edb.3.1673618108314; Fri, 13 Jan 2023 05:55:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673618108; cv=none; d=google.com; s=arc-20160816; b=Zv5/J4JIWvywBgFKy8LqEtbPv+CXVmfeaNdnLYqN7ubyt1o3Xd3OB7jO6Bo9vQ2S0R gNlAKCYg8dKGxq1mYref5h+KXndu3gHnbNe8i73EpDvdvZFdhPuWYzRoTbtxJt9gbcDl /+HKhZ2DchxHuk21v1DDuOWdPey+ePmGF9WwEMAdV0EnINRMmnmiGd8ye8s/BO5Z44SR 7Ctf6eXyphg/mv0iGMSGsQn5KVtsWVVhd1Mk5wcokAwGKijWHu4IP6JsNGjdhZ9V6P7I jheXJnDcGVAllukCsyMqyndLqK89t0pUNkXxx8pjtJsEKKErIk1wxEDRCVYY/w8EYnYy unOw== 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=pbVvgh85eKw9o61g2SVphwlUZtTepWPyhZIYM50bXqM=; b=TOXO7ThWg08Tr1c4HjTL5+dK2KLdnWT8uLqGX62D7NTm9Kr4Rrc55NLTSVVa4aFCVC FIjIZuY/wx0wKxO+qQvbRTv+ZTYgHo5OqzCc6x2fYORYSsg11TMVZVCbuUA3ChTTMAeN BHY4c85pdLAHBCalLAhfy5Q1eqVyj4DBToG638ObNzsYhtX1MDV98Sj7/MCHqW488gaS g9FNjL+eUXtnLoJCqP7ZBZnReXykfZVLmqSgNhumS7NaXZIkNVX36Gr1RQiVq3tfqwU5 PLINuAXpqetSUo9EGqjhspLxzYMT4Ra6aKTmzvp/zL1KkUxsiIY3BnW3zmb2Bc0aHN4Q sSTg== 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 r25-20020aa7d599000000b0048ccd99d3fasi20320924edq.482.2023.01.13.05.54.55; Fri, 13 Jan 2023 05:55: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; 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 S241250AbjAMMzd (ORCPT + 51 others); Fri, 13 Jan 2023 07:55:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241650AbjAMMzA (ORCPT ); Fri, 13 Jan 2023 07:55:00 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C650DAE48; Fri, 13 Jan 2023 04:41:43 -0800 (PST) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Ntgyg69p0z6J9YS; Fri, 13 Jan 2023 20:41:31 +0800 (CST) Received: from localhost (10.81.201.219) 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.34; Fri, 13 Jan 2023 12:41:40 +0000 Date: Fri, 13 Jan 2023 12:41:39 +0000 From: Jonathan Cameron To: Ira Weiny CC: Dan Williams , Bjorn Helgaas , Alison Schofield , Vishal Verma , Davidlohr Bueso , Dave Jiang , Ben Widawsky , Steven Rostedt , , , , Subject: Re: [PATCH v6 5/8] cxl/mem: Trace Memory Module Event Record Message-ID: <20230113124139.000034c0@Huawei.com> In-Reply-To: <20221216-cxl-ev-log-v6-5-346583105b30@intel.com> References: <20221216-cxl-ev-log-v6-0-346583105b30@intel.com> <20221216-cxl-ev-log-v6-5-346583105b30@intel.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.81.201.219] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) 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 Mon, 09 Jan 2023 11:42:24 -0800 Ira Weiny wrote: > 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. > > Reviewed-by: Dan Williams > Signed-off-by: Ira Weiny Typo inline. With that fixed Reviewed-by: Jonathan Cameron > diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h > index b6321cfb1d9f..ebb4c8ce8587 100644 > --- a/drivers/cxl/core/trace.h > +++ b/drivers/cxl/core/trace.h > @@ -439,6 +439,149 @@ TRACE_EVENT(cxl_dram, > ) > ); > > +/* > + * Memory Module Event Record - MMER > + * > + * CXL res 3.0 section 8.2.9.2.1.3; Table 8-45 > + */ > +#define CXL_MMER_HEALTH_STATUS_CHANGE 0x00 > +#define CXL_MMER_MEDIA_STATUS_CHANGE 0x01 > +#define CXL_MMER_LIFE_USED_CHANGE 0x02 > +#define CXL_MMER_TEMP_CHANGE 0x03 > +#define CXL_MMER_DATA_PATH_ERROR 0x04 > +#define CXL_MMER_LAS_ERROR 0x05 CXL_MMER_LSA_ERROR > +#define show_dev_evt_type(type) __print_symbolic(type, \ > + { CXL_MMER_HEALTH_STATUS_CHANGE, "Health Status Change" }, \ > + { CXL_MMER_MEDIA_STATUS_CHANGE, "Media Status Change" }, \ > + { CXL_MMER_LIFE_USED_CHANGE, "Life Used Change" }, \ > + { CXL_MMER_TEMP_CHANGE, "Temperature Change" }, \ > + { CXL_MMER_DATA_PATH_ERROR, "Data Path Error" }, \ > + { CXL_MMER_LAS_ERROR, "LSA Error" } \ > +)