Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1117942rwb; Thu, 10 Nov 2022 11:23:25 -0800 (PST) X-Google-Smtp-Source: AMsMyM7vEqUaMNAOiOQToIn2VyP/ya8RIf/OOU2Sl3CANKNiInp81QB5VHv2s4FcF6cZWebeDFUD X-Received: by 2002:a17:90a:c7d1:b0:210:7cd5:db0e with SMTP id gf17-20020a17090ac7d100b002107cd5db0emr1871211pjb.30.1668108205657; Thu, 10 Nov 2022 11:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668108205; cv=none; d=google.com; s=arc-20160816; b=vdxG8BUpCSOojKzC59KNt0seJ1h/vJUVUq7jQY4Pbg5DWbnqYnmc7kRz21SdGV3Fp5 XMWwNP3PMlDIs+V1crRsEyFCXH+tu7+fWP3eO2k1i+8buF7WAV4wyXfKfK73nyOX5lSK AUbj2cC1J1IaLPdGnJxmxMn2fI10ye1A/GWRzXLqp/WMbWq2P684E4THm7AELSgUDCLi 1qrxT6geshi83mcBdlwoUKewwD7fTzgBwrB+4xev6JY+nPDfqVCSNWnd6LMgffU8ilAs GilTKskMsF8Jc8k/ciH8qDEh/SGP6oZd4zdBdSxhqccL5Ogx6PO4EuWl+qxUaAOYPTq5 JEsg== 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=7jsU0HbW7jVe8LcGm1mNiJA6NbF9Gb1QnkqI/WOFhds=; b=a7THQ7X8qMwBguuyVyw9gkpM8je8eMkn7tPFIG3ic4Vmt6fGW/jA700jrjnt5Xgux9 uO7HVQzI9Y2UVAhxOSe/0AHw1s3aavbRe0L/e5ostE11PIeSCSJHqFzbl+nxYsAO1i7p 5wPwpyOFcZmZfMKavGFm0HvSPiuT8E7zmknDe8168xkgBDsEELeD9WTX9ihSMaGKo1C7 BwFkXYMkEgAWC45wr22lszrBXXaQDuVBiCzoRvw6koridLbKXn9jzCsPRLoPwSE367Th jZWqkyyRxPc9kHKzw4l+ASbMe07+sOAYgn+LRn3HfY18EH2MbjIqJtVZ1pNS14QAUBuR Bitg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cbYK3Jag; 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 t15-20020a17090340cf00b001868827ed1esi149754pld.131.2022.11.10.11.23.13; Thu, 10 Nov 2022 11:23:25 -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=cbYK3Jag; 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 S231612AbiKJTGI (ORCPT + 92 others); Thu, 10 Nov 2022 14:06:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbiKJTFg (ORCPT ); Thu, 10 Nov 2022 14:05:36 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D5B245EF5; Thu, 10 Nov 2022 11:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668107116; x=1699643116; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JX6SVwcJaEAfjGLJHiyrrsbi4lffntQ1KMrxCo39Jzw=; b=cbYK3Jag9kjfqOHHscalysx0gmDcxcEL18OZAGrYXc0XpJ5ciCtNVhYz /xzxAFa2tjy9rOMZmi5D3jPAka/OHXkrSgWR3KQyQkgSB5Dh6ZjQ5tM8y 6Lt5EzrhSy6H63qA6M9TfZsLjtJ4cNBEBYTumKj1Kbi3wzM35m+hjHW2S 955bHs2+MPH2kAtIOdY3vximJD+pn/hMGoKhXuRc+EadAT0LZn2al9wq8 55d2Ot98jgWSl2AhpuajuDacCvjZ5SLqN1fexy7+CuQOhddyx+VRJqaNR XBCJje+AMWaQUhVFILgGDpfe3s+TU1vNBGxr3J+i9Gyp6CWkSyrtwbYnS w==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="375662085" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="375662085" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 10:58:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="882473419" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="882473419" Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.212.6.223]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 10:58:07 -0800 From: ira.weiny@intel.com To: Dan Williams Cc: Ira Weiny , Jonathan Cameron , Alison Schofield , Vishal Verma , Ben Widawsky , Steven Rostedt , Davidlohr Bueso , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: [PATCH 04/11] cxl/mem: Clear events on driver load Date: Thu, 10 Nov 2022 10:57:51 -0800 Message-Id: <20221110185758.879472-5-ira.weiny@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221110185758.879472-1-ira.weiny@intel.com> References: <20221110185758.879472-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,RCVD_IN_DNSWL_MED, 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. Reviewed-by: Jonathan Cameron 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 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); -- 2.37.2