Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7559261rwb; Tue, 15 Nov 2022 14:18:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6o8JPebiscVJU5+oKRUP/o99YGtsDv1Nsdn2XbYOzOr1AevMS4bPWqmjRHro6p3+TotcC2 X-Received: by 2002:a63:4509:0:b0:46f:b6df:3107 with SMTP id s9-20020a634509000000b0046fb6df3107mr17968015pga.454.1668550729945; Tue, 15 Nov 2022 14:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668550729; cv=none; d=google.com; s=arc-20160816; b=QvZqNRTbLlUX60Xm8riMO53Ho3RA+04keAeVdMqDjxApsBt8kDocARhLYWDwgsESEL 7Ksk0K/oJ/gJ+hpTwG9j0I92MVEYiZ8TWwM/ehUS2P4JiUQjopgJpv//qMN04yhHVi+d li3DbktehuNSae7K7aMv6EYE4BdJF40YYqSEx5BZJXhOyx6MmKtN785VF9lWSv1e8Zej q1l7kBycMEB9LrvKrRd0WmW5BJ+6w4q1cCqYKT+H3Ye0G07vTOtsvxsFXT0rG7dx37jM KZzgLTGdxHtsZqIbIi6n12icDuEOjEy0tAQOZzsNZTSscVqBOCUzi3PHGWwb7UQQ84OU 7ifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=YxZCA686j9asTailhZYuO8OvoENuyGCcAvgXCImdTU8=; b=SfOxMUasbZmXTc8l0K/hacENkNeSi6psc4mdNLBUxlnZqXIidiCUIP/rgLYt+EMkhO E6fOssWMDPHbvSprGa/tsiqECBfTCn8VCq79JXcF8wcfgvK5JLLffGu6ujH1Asg8vTUh LE2OdWnDWS9P7/D6gQzMmJfjyyP6Kic24SBQnKjGZekccFpA+kRlqX8h1kTBNXJTSs2e EjtvI0gG0o2QsgqpxSoPIY2GqjF68zn//+K8N4huln3Jl1j2gPAfMKdsrRv+8yxoO4Jo 62mgpC8GCwgDDt8f8m/DAeSOSFQEO9NiGFZZgUHYLra4lK+Tf6LuXuNmNbY4bJNmK+aU kwhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L3paLrCe; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a056a00134700b0056301324a24si14874965pfu.133.2022.11.15.14.18.16; Tue, 15 Nov 2022 14:18:49 -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=@intel.com header.s=Intel header.b=L3paLrCe; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbiKOWKt (ORCPT + 90 others); Tue, 15 Nov 2022 17:10:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbiKOWKr (ORCPT ); Tue, 15 Nov 2022 17:10:47 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE4C30569; Tue, 15 Nov 2022 14:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668550245; x=1700086245; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=uc5sP24YBpavzKtyWJtoabUUBoa+hAu1OnMqFJhT2cI=; b=L3paLrCelRn0zqmSte58gXhosoitWYiZzKYrKqfDKc1UDZcECY0ywN6s SbZ/UzgR3SGQapzQmlgPRhUN+eFtjpZQKXb3SmkEsVqDMJIS7dLzcbLAb 2jednWCbAIAPmBSfNNANCzGeC0Uy8297pNMq96iv50DTYl2oVS9yMXjme r6eLgtPXc53Z43tbDxk5V7yGzzE+NCsRk3XplGbeYjODTj2jGiEkrr96g vFmwF2wCNEqlaWrBBl3U5grEb7Iys77poBrHcR0aF3cmvVoes5A+QkLPP FGs2Q7dUPEd/Q2W9onBuuOdh42huMaCLIP2qDxDqJQtP+3vJJu39uaTMJ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="299906683" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="299906683" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2022 14:10:44 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="589950332" X-IronPort-AV: E=Sophos;i="5.96,167,1665471600"; d="scan'208";a="589950332" Received: from djiang5-mobl2.amr.corp.intel.com (HELO [10.212.7.249]) ([10.212.7.249]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2022 14:10:43 -0800 Message-ID: Date: Tue, 15 Nov 2022 15:10:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.4.1 Subject: Re: [PATCH 04/11] cxl/mem: Clear events on driver load Content-Language: en-US To: ira.weiny@intel.com, Dan Williams Cc: Jonathan Cameron , Alison Schofield , Vishal Verma , Ben Widawsky , Steven Rostedt , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org References: <20221110185758.879472-1-ira.weiny@intel.com> <20221110185758.879472-5-ira.weiny@intel.com> From: Dave Jiang In-Reply-To: <20221110185758.879472-5-ira.weiny@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE 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 11/10/2022 10:57 AM, 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. > > Reviewed-by: Jonathan Cameron > Signed-off-by: Ira Weiny Reviewed-by: Dave Jiang > --- > 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 62e560063e50..e0d511575b45 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -530,6 +530,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); >