Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2187618rwi; Tue, 11 Oct 2022 06:04:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KGxqe6W6cOihyV8eEskyAyCgg5HZHurhuyLidahBkdQv0LpBfmAx4WC3NOEc6wfFafSKe X-Received: by 2002:a63:81c8:0:b0:462:953a:8534 with SMTP id t191-20020a6381c8000000b00462953a8534mr8456954pgd.69.1665493447686; Tue, 11 Oct 2022 06:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665493447; cv=none; d=google.com; s=arc-20160816; b=QzUxeZzTt2e+7/pKVRg5ovs9Bydqs/KfM4fXcDwE4eueiWQv+3htSMucWshD2wGYta n6J6Jl+Xcna3Xk8uTh+dWHpmkn1kF4KlR9pKPvYzL8gcIMkmXec+IcqlYTBWC8wRKEPL MNLY2MCBuwsOTrY+Ipz0dRt7Yq6/DOB5wBN9a9qgL/UYDBr3AVKrUlRNweSD3IYGN4wK PbtNMam/Z2cNeRVeofZi7cOZYI6JNGpoTSeDHkLIjr7uUuG77xvVSx0QUhdndneduUx3 Otk4DGNIONFYJbC5fNGUr3LVSg4P1axK5v8JZdIIIyODGJCWCKnRPz0CxpXm/lzI0JoZ unXg== 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=w0s+BcYnQZ6ecTHGqkjwMISAIuCNulzGE/7MbX+7P0k=; b=wV4IxQ8iT7XO2QXF/yoErj6eCp5xaUw8ScI8uYz+c/+dpgq3xEGcAygd8Pi/OpijhF VY6WJZ9YTnQIhlffnY3w7VKMpsLnnSh0NgGbFFV+4+IaC1j8mI4IYbrVwTaRMM1mJmEM +83fqc4prBayNIH78OUU/Nuv/BEp0G/3Mcqn87r2NbTUOKcJiPH3xkMWcBP9WR+1muxB mxer0ouwlgsophwWkstz7BhS2OKabQ7UyYtdOpkkV5HIqKIZUJXJg8M4O7yiemp0Ftdi aSLlmgYBXqjvYeFjJE7ymKxoRlYx5LrjlBqoBTTI3ljRaz4HxDVoFjYuI+X0AkPtF0En bSdg== 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 u8-20020a170902e80800b0017f8408cc69si16733961plg.226.2022.10.11.06.03.54; Tue, 11 Oct 2022 06:04:07 -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 S229698AbiJKMnB (ORCPT + 99 others); Tue, 11 Oct 2022 08:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiJKMnA (ORCPT ); Tue, 11 Oct 2022 08:43:00 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5317463FF9; Tue, 11 Oct 2022 05:42:59 -0700 (PDT) Received: from fraeml742-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MmwPw57Pfz68409; Tue, 11 Oct 2022 20:41:24 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml742-chm.china.huawei.com (10.206.15.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 11 Oct 2022 14:42:57 +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.31; Tue, 11 Oct 2022 13:42:57 +0100 Date: Tue, 11 Oct 2022 13:42:56 +0100 From: Jonathan Cameron To: CC: Dan Williams , Alison Schofield , Vishal Verma , "Ben Widawsky" , Steven Rostedt , Davidlohr Bueso , , Subject: Re: [RFC V2 PATCH 04/11] cxl/mem: Clear events on driver load Message-ID: <20221011134256.00004fa5@huawei.com> In-Reply-To: <20221010224131.1866246-5-ira.weiny@intel.com> References: <20221010224131.1866246-1-ira.weiny@intel.com> <20221010224131.1866246-5-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: 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 Mon, 10 Oct 2022 15:41:24 -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. > > Signed-off-by: Ira Weiny Makes sense I think. Reviewed-by: Jonathan Cameron > --- > 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); >