From patchwork Thu Nov 10 18:57:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 18291 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp323883wru; Thu, 10 Nov 2022 11:08:33 -0800 (PST) X-Google-Smtp-Source: AMsMyM7h8FBri1hvcuK5IW3na8/R5cawUDXZjGaRSzGypGq1e013Q0mkGZDt2gwpJwQ0a1wvi/zz X-Received: by 2002:a17:907:20a7:b0:7ad:d7f9:1f96 with SMTP id pw7-20020a17090720a700b007add7f91f96mr3574731ejb.384.1668107312987; Thu, 10 Nov 2022 11:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668107312; cv=none; d=google.com; s=arc-20160816; b=ZkVrVvXs5l+1SGIxcucDVnrS3wMcWaSIuneu7jIcUvUs6yPifiCS3eyW3RstCsCvh+ vOfNF8FiZG/SDXG0JLtSF3G17hhOpY1ZOMXm8rvQ/nZfIOlZmHRMMDwUI1RuvzwTDMCz ap0mJMX9ISwTSsYpoteaSzfJcysLmRoA2DxwP85Swzu07icM6S5KCr37JQohL5xXNJ3p HwdPEkISfnxkOlFyyZDM9whyQ/4r1K/gNGT8qZrboxDcsHfPDBsTqyQxa///i9AB/yVj +mA8BfIBMVHKNMKPiGv1KJxPwKQwR2CgJo7B31FSEGw4cw7vquJwhhZhOUUVyzOiX5Zp IDbg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba28-20020a0564021adc00b0045bc92ef2c0si320032edb.195.2022.11.10.11.08.08; Thu, 10 Nov 2022 11:08:32 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749137293588587935?= X-GMAIL-MSGID: =?utf-8?q?1749137293588587935?= 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);