Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1418639rdb; Mon, 2 Oct 2023 08:59:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaqVVvVQff+u2cdwVaOLaZRDeeAkEQe9I28lSVLzZVHrDY71B5MK+mUYfPWbSjUf/KSlZx X-Received: by 2002:a17:903:1211:b0:1bd:c7e2:462 with SMTP id l17-20020a170903121100b001bdc7e20462mr10287005plh.11.1696262342452; Mon, 02 Oct 2023 08:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696262342; cv=none; d=google.com; s=arc-20160816; b=o//Oh0ha07aOwY+CLDMxZe415uJ32nXFzAgXiobV4qaxXJCKf/83wosNz7uNj9D4yP vlsHT20zD40sGb0GYI8Tg/BvFUrxdkR/lKuovbTF6brnGJDVGmCleVU8J/73G2kiI6Oi r30kglOBylQEdZGtW/Bwwp40gz+32dlc8LrNwpQuliW5GOcJNp+J9jCXJpQJDkytEi5j r0OjVjgD+IxBNoqjhkrBeISZWDNdrkvf+8NJjpF9hmYQfXJJcOJcT9lv5R4ALZlI82WS /A4yy+ueIcRDu2PgJEp5gT/kC9u55wsyUO/v/hH5e8bwUK0t/nZgltf262rJrQG5t6Ka sCZw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=jw/WMqWejfWvt61tyPh9xsiunA8siPOgBMBmdgnd1dk=; fh=6T4zZ8HeN4FNvjm5k4DIT/y7+At3BG9x6FXMDOBhu9c=; b=yNXGLUt9fVzLHUEN3tPwkxrYp00CXUMccclk3SQKvY+53ui/CH/xwjeWJvrn+CZYFN QjSB3EEXhcOZB7YATLJ0anqyu2XnzPEIZy1wO3rLVTP/YTMiOoH9TdaOlgV+Jdezc5aE i35YLjN+o7etMwWflfIXDFN0ckIR9+boNNicBIidrd17OAdWSZu/Be3hmHSbOkUqkt/7 z/UK1azyA8xqNTwkS8Btqo9mLtJRD5BwD9y6o3JZ+mKurMbVoZigM1/udAQoZSUckZep xgURP5RPiIzeuddsNj3hoZhxIudLG7mI3ANQHapO4WRwTwE5US9vD6yYw86oyNvA6ICD qcIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id e4-20020a17090301c400b001c60ee5a9dcsi22097785plh.428.2023.10.02.08.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 08:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D9E8C80241AF; Mon, 2 Oct 2023 07:46:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237861AbjJBOqh (ORCPT + 99 others); Mon, 2 Oct 2023 10:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237832AbjJBOqf (ORCPT ); Mon, 2 Oct 2023 10:46:35 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C7BAD; Mon, 2 Oct 2023 07:46:32 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RzkKp4Jg4z6K6h7; Mon, 2 Oct 2023 22:46:22 +0800 (CST) Received: from localhost (10.202.227.76) 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.2507.31; Mon, 2 Oct 2023 15:46:29 +0100 Date: Mon, 2 Oct 2023 15:46:28 +0100 From: Jonathan Cameron To: Robert Richter CC: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , "Davidlohr Bueso" , Dave Jiang , , , Bjorn Helgaas , Terry Bowman Subject: Re: [PATCH v11 10/20] cxl/pci: Introduce config option PCIEAER_CXL Message-ID: <20231002154628.00004f9b@Huawei.com> In-Reply-To: <20230927154339.1600738-11-rrichter@amd.com> References: <20230927154339.1600738-1-rrichter@amd.com> <20230927154339.1600738-11-rrichter@amd.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 07:46:48 -0700 (PDT) On Wed, 27 Sep 2023 17:43:29 +0200 Robert Richter wrote: > CXL error handling depends on AER. > > Introduce config option PCIEAER_CXL in preparation of the AER dport > error handling. Also, introduce the stub function > devm_cxl_setup_parent_dport() to setup dports. > > This is in preparation of follow on patches. > > Note the Kconfg part of the option is added in a later patch to enable > it once coding of the feature is complete. > > Signed-off-by: Robert Richter Feels like it should just be combined with a later patch that fills some of this in as on it's own it's just a weird snippet of code :) Still, one comment inline anyway. > --- > drivers/cxl/core/pci.c | 9 +++++++++ > drivers/cxl/cxl.h | 7 +++++++ > drivers/cxl/mem.c | 2 ++ > 3 files changed, 18 insertions(+) > > diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c > index c7a7887ebdcf..6ba3b7370816 100644 > --- a/drivers/cxl/core/pci.c > +++ b/drivers/cxl/core/pci.c > @@ -718,6 +718,15 @@ static bool cxl_report_and_clear(struct cxl_dev_state *cxlds) > return true; > } > > +#ifdef CONFIG_PCIEAER_CXL > + > +void devm_cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport) > +{ > +} > +EXPORT_SYMBOL_NS_GPL(devm_cxl_setup_parent_dport, CXL); > + > +#endif > + > pci_ers_result_t cxl_error_detected(struct pci_dev *pdev, > pci_channel_state_t state) > { > diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h > index c07064e0c136..cfa2f6bede41 100644 > --- a/drivers/cxl/cxl.h > +++ b/drivers/cxl/cxl.h > @@ -704,6 +704,13 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port, > struct device *dport_dev, int port_id, > resource_size_t rcrb); > > +#ifdef CONFIG_PCIEAER_CXL > +void devm_cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport); > +#else > +static inline void devm_cxl_setup_parent_dport(struct device *host, > + struct cxl_dport *dport) { } > +#endif > + > struct cxl_decoder *to_cxl_decoder(struct device *dev); > struct cxl_root_decoder *to_cxl_root_decoder(struct device *dev); > struct cxl_switch_decoder *to_cxl_switch_decoder(struct device *dev); > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > index 04107058739b..61ca21c020fa 100644 > --- a/drivers/cxl/mem.c > +++ b/drivers/cxl/mem.c > @@ -157,6 +157,8 @@ static int cxl_mem_probe(struct device *dev) > else > endpoint_parent = &parent_port->dev; > > + devm_cxl_setup_parent_dport(dev, dport); devm calls can always fail (because if nothing else you have to register some cleanup and that involves an allocation. If you want to ignore that I'd expect a comment here. > + > device_lock(endpoint_parent); > if (!endpoint_parent->driver) { > dev_err(dev, "CXL port topology %s not enabled\n",