Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1410826rwi; Mon, 10 Oct 2022 16:19:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4U75WthJUuaOsohGzvbABarKjCE3yAKcFsCZWkDHneFuJRpjXKmbsYdXXMhFWsGgxDn3m6 X-Received: by 2002:a17:906:eec7:b0:733:189f:b07a with SMTP id wu7-20020a170906eec700b00733189fb07amr16889013ejb.230.1665443971416; Mon, 10 Oct 2022 16:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665443971; cv=none; d=google.com; s=arc-20160816; b=RbRfHoRoij7omr7KgXmtrhOqfmLKo0kzRHTOfR2mkP84BX3/IMjeU5/U0hKfE23lHR sRtjpYuYIHihJEzNAws/A77P1U5HaiYQCqHNJT77D/yyAV3HQy/WNd3CGVSs/EwkDYxJ DPZ8VKtLxOgciGHMa9E7MZgG4trPUZGD362xoKjAM0lOzuAJ7YS+NyPId3hni4gabF2y UCEI4EFZrKSHrmz970XutACp+OirdUuY7HJEjJdrMTYTk5tXma5X78aQSgxZerf8Palv jOeA8OLaCCvSiklUGCZ3liprqj/UmFWMUX39p7NW1JFKZyKWO/MEQOEebfaEgSpHiFAf tSyw== 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:date:subject:cc:to:from :dkim-signature; bh=78/B6d8f26OzOYK+dVlCVZGqOnKh246wi/kitovfOzw=; b=YaR5nglbLuEb7B814NmGE9evvaKTN2INAZCD+VRJYIFl7HSashyd4tlYf6r+xnY6EN 7uvJf2Re/urFU+swVV/eIfGXfwtEhdQuXtorLW1/DQXJgAhXT+w9Fg8NPwIWuzOPez7S tX50+2XFbo3DtIT177avLoMGE6sxh+xMHnmWa83fK7AYkkJQu861WZZDoS9tDdrmEjhl A3d06BFPcuJT6k9O7lQUJgOnN6DwQnrpOBLrAu/U14QeHRiVNexHLnh3d4jH7GtetHVD YxVomrsU7RJtTPs0sYfjhssATXMtLVJ3MGerykc3dirhbkqnI71PDVHTwqPkbGvyvVwB X9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VRF8fLhv; 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 s5-20020a056402520500b00458d1c48708si12930387edd.303.2022.10.10.16.19.03; Mon, 10 Oct 2022 16:19:31 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=VRF8fLhv; 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 S229875AbiJJWnQ (ORCPT + 99 others); Mon, 10 Oct 2022 18:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiJJWnH (ORCPT ); Mon, 10 Oct 2022 18:43:07 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D42066A4F; Mon, 10 Oct 2022 15:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665441786; x=1696977786; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TcEJ7wbxfjNB+eaSwMkMs0VQ6oiJbVp1r0I0LqEARfg=; b=VRF8fLhvsIQLhCCMp0lj6+1EUHQZD0vHR87fa95omvihkeMBhGxSTNKx IGCbab8E0wokr6N3u03nKTs1Y+IiO/FuKFxg8vx14a3XKwiXbOZisecSW BGDDKLoCrRRD+b45abFAUxBypC7ywtTVlFOGDYsyciQnLAmRubR/15gka HETVwZsgoT3VFWhTj9v5bq26VxhY7vqqEEBQQ1XeDy8wkTLmrwxeOhkAh ZthasWJ8zIx94hNO+e3F4Yv/sgnWjghOK/UqOXoIf/8FjCrEKLXkvReG8 exntcmJZrvQ3TpznqiZTQeCOAxj8M1dzgn9iluiZrzArBw56/DTEnIWCv Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="287615381" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="287615381" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:43:06 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="621191356" X-IronPort-AV: E=Sophos;i="5.95,173,1661842800"; d="scan'208";a="621191356" Received: from iweiny-desk3.amr.corp.intel.com (HELO localhost) ([10.252.141.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 15:43:05 -0700 From: ira.weiny@intel.com To: Dan Williams Cc: Ira Weiny , Alison Schofield , Vishal Verma , Ben Widawsky , Steven Rostedt , Jonathan Cameron , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: [RFC V2 PATCH 04/11] cxl/mem: Clear events on driver load Date: Mon, 10 Oct 2022 15:41:24 -0700 Message-Id: <20221010224131.1866246-5-ira.weiny@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221010224131.1866246-1-ira.weiny@intel.com> References: <20221010224131.1866246-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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 --- 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); -- 2.37.2