Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp799883rwe; Wed, 24 Aug 2022 09:08:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7kVV1gTu3S312rdKwDBfnOfoJyD8Ghx6Nb+dPChA47Gjin9xRuWiObMh4eChJAun85CNjt X-Received: by 2002:a62:1bd1:0:b0:536:65a:984d with SMTP id b200-20020a621bd1000000b00536065a984dmr26324116pfb.48.1661357327133; Wed, 24 Aug 2022 09:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661357327; cv=none; d=google.com; s=arc-20160816; b=tViYL5tD8jrKSCjkRkp812fyIdiH0OdfhgW09IQECc8Itb/Ib9Gnq0Z2//PA8YK0Pu VpnL71m+8Ml81X53us3c7DosEYJwy91lRthdhnMqyl3ieFUvYyd2suedb8Xqk5Nhcj+8 dw57mS1RpIkmxgiTTxKjLFomkliqGb0Bx8mGkrY6H8JCv2C2r8rzLhfuEKfdhY+03OER mHKILScHHnKQgYgiNLHFN7b5JYCa40ltVdCiuw9Y4C8JPSOGHhv+TJHCXWdIuYLmYONq BS+mAU8RBQZ1U0bWx11Bhp8uhvY3Z/K9Z8gQluEEyc0pWFaDvLRC0to8HTI9maD3UKIf RU5Q== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=FaOECOTob2T1hqhG4G2fCn2esY4I9uMBNKPo1VfFrvM=; b=qLFBvUEyKwEq8ZrOI7r5zLecihkKf8MUsUH2pBG7r7hNwWv3CyoIRxeeHA7ogDDb34 ADSYhM5031HCqRQLE66a6iAZpooc2ffJ0sVWQzTYmhy4QO/dE7bbuAd34cyChrBE7NE6 WRFxoeyS+w3X0GuYxm3ruflOOXtZEdO+lSR8KLoWjyZcYrxvH/HuRFBBuaNMPOud7YCM z+gZf3R1rk3bY6amoL5HfMMN+/aATospraJUghAp55VFeXpE7b0cbHvaqOVfjq1iExDv VJofM2QbN4DGg48DCvszRLQaxLu/EXrXmbYI39jSwkfFUV60p6A+Sbw8XLochhrf8e32 h+Vw== 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 f132-20020a636a8a000000b0042b32127ed1si984037pgc.534.2022.08.24.09.08.35; Wed, 24 Aug 2022 09:08:47 -0700 (PDT) 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 S238217AbiHXP6K (ORCPT + 99 others); Wed, 24 Aug 2022 11:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235466AbiHXP6H (ORCPT ); Wed, 24 Aug 2022 11:58:07 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2898C7CABC; Wed, 24 Aug 2022 08:58:02 -0700 (PDT) Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MCW2c0d10z67Mxp; Wed, 24 Aug 2022 23:57:44 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Wed, 24 Aug 2022 17:58:00 +0200 Received: from localhost (10.202.226.42) 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.24; Wed, 24 Aug 2022 16:58:00 +0100 Date: Wed, 24 Aug 2022 16:57:59 +0100 From: Jonathan Cameron To: CC: Dan Williams , Alison Schofield , Vishal Verma , "Ben Widawsky" , Steven Rostedt , Davidlohr Bueso , , Subject: Re: [RFC PATCH 3/9] cxl/mem: Clear events on driver load Message-ID: <20220824165759.0000163b@huawei.com> In-Reply-To: <20220813053243.757363-4-ira.weiny@intel.com> References: <20220813053243.757363-1-ira.weiny@intel.com> <20220813053243.757363-4-ira.weiny@intel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.42] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) 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,T_SCC_BODY_TEXT_LINE 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 Fri, 12 Aug 2022 22:32:37 -0700 ira.weiny@intel.com wrote: > From: Ira Weiny > > The information contained in the events prior to the driver loading can > be queried at any time through other mailbox commands. > > Ensure a clean slate of events by reading and clearing the events. The > events are sent to the trace buffer but it is not anticipated to have > anyone listening to it at driver load time. I'm not totally sold on it being a good idea to drop records on binding the device. Let's see what others think... > > Signed-off-by: Ira Weiny > --- > drivers/cxl/pci.c | 2 ++ > tools/testing/cxl/test/mem.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index faeb5d9d7a7a..5f1b492bd388 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -498,6 +498,8 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > if (IS_ERR(cxlmd)) > return PTR_ERR(cxlmd); > > + cxl_mem_get_event_records(cxlds); > + > if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM)) > rc = devm_cxl_add_nvdimm(&pdev->dev, cxlmd); > > diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c > index aa2df3a15051..e2f5445d24ff 100644 > --- a/tools/testing/cxl/test/mem.c > +++ b/tools/testing/cxl/test/mem.c > @@ -285,6 +285,8 @@ static int cxl_mock_mem_probe(struct platform_device *pdev) > if (IS_ERR(cxlmd)) > return PTR_ERR(cxlmd); > > + cxl_mem_get_event_records(cxlds); > + > if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM)) > rc = devm_cxl_add_nvdimm(dev, cxlmd); >