Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp577061rwd; Thu, 1 Jun 2023 04:13:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41jPWEQNUw+UQATrOk1PzkfoknwsRAd7cHwdzuNDNXvnF4ZpIWM+4qIXr8HvLwmxPhVWNK X-Received: by 2002:a25:7301:0:b0:ba8:7015:36df with SMTP id o1-20020a257301000000b00ba8701536dfmr10417775ybc.26.1685618003965; Thu, 01 Jun 2023 04:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685618003; cv=none; d=google.com; s=arc-20160816; b=H6U1/5AathHqBmCz894v2vHVchXAKpjdXO4BPh/V/nSDyhT+/zQocif3kBvOw4wD5B Z7eU4sfq3ukCwqHSjxEUA42jdaxQwtFd6MMtQaR23uyd94/rnbFV0VjOAkgnb5zUxJj1 seazaoToEqik5YWnFBnBiQBi2DUl1uHuhaB8fyrtUnczm0mJm6iz4X+vIJWgn2/Xt8mm BrjxZwOq5HSjRa2O1WTyMAMfmE6/qxHu4BogIPcYJc+0WZcLfevOmUjWtFirI5fH+QFW MHl28o6LHV40vH4yuZnK8KfzBzwIHsKMSeGq/xh6mGg+fte2h5cqD8z6jU6FoTmBtSIK qyJg== 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=iGrDaq6rVN4osqN72blYYZinYbOzRIrV+uNbW5GQUpM=; b=U+/6gwUyHRw0ACDR4EGDxb12cQSXRx5xFRyFBC4B7/7KCsM0N5MG6o0I6+oaeKbK92 3AbKAQ6QrQnsYWeF9xv16SYms075SgpVXKQBH4G3WAIT12Om28j+mfVRJVq64XTTh1h9 CsSrNWbGZ+G3QgI2fIkQozoHE4uHa96sBAmaMIkRYLWSTpY+S+5n2KJkLTtJmM0Inc5i 8pnWNVO0Y9LS8LzRi5gAuurjcqXp0wvp3ARhK2qnbV525gtSavxC4urvk9aONLVk6g5o 0EEV46LCk0vA367SU3EcjUnd8wTL9xatMCVvRdSaqND/poIJLWUilKhU4mMbUQpSxcEU plwA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a17090a694f00b00257a8dc0348si984537pjm.75.2023.06.01.04.12.47; Thu, 01 Jun 2023 04:13:23 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233093AbjFAKzF (ORCPT + 99 others); Thu, 1 Jun 2023 06:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233207AbjFAKyv (ORCPT ); Thu, 1 Jun 2023 06:54:51 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F302F2; Thu, 1 Jun 2023 03:54:50 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QX2zN4Smcz67Ph9; Thu, 1 Jun 2023 18:53:04 +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.23; Thu, 1 Jun 2023 11:54:48 +0100 Date: Thu, 1 Jun 2023 11:54:47 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v4 06/23] cxl/acpi: Moving add_host_bridge_uport() around Message-ID: <20230601115447.000055e6@Huawei.com> In-Reply-To: <20230523232214.55282-7-terry.bowman@amd.com> References: <20230523232214.55282-1-terry.bowman@amd.com> <20230523232214.55282-7-terry.bowman@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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Tue, 23 May 2023 18:21:57 -0500 Terry Bowman wrote: > From: Robert Richter > > Just moving code to reorder functions to later share cxl_get_chbs() > with add_host_bridge_uport(). > > This makes changes in the next patch visible. No other changes at all. > > Signed-off-by: Robert Richter > Signed-off-by: Terry Bowman Given it's just a move FWIW Reviewed-by: Jonathan Cameron > --- > drivers/cxl/acpi.c | 90 +++++++++++++++++++++++----------------------- > 1 file changed, 45 insertions(+), 45 deletions(-) > > diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c > index 39227070da9b..4fd9fe32f830 100644 > --- a/drivers/cxl/acpi.c > +++ b/drivers/cxl/acpi.c > @@ -327,51 +327,6 @@ __mock struct acpi_device *to_cxl_host_bridge(struct device *host, > return NULL; > } > > -/* > - * A host bridge is a dport to a CFMWS decode and it is a uport to the > - * dport (PCIe Root Ports) in the host bridge. > - */ > -static int add_host_bridge_uport(struct device *match, void *arg) > -{ > - struct cxl_port *root_port = arg; > - struct device *host = root_port->dev.parent; > - struct acpi_device *hb = to_cxl_host_bridge(host, match); > - struct acpi_pci_root *pci_root; > - struct cxl_dport *dport; > - struct cxl_port *port; > - struct device *bridge; > - int rc; > - > - if (!hb) > - return 0; > - > - pci_root = acpi_pci_find_root(hb->handle); > - bridge = pci_root->bus->bridge; > - dport = cxl_find_dport_by_dev(root_port, bridge); > - if (!dport) { > - dev_dbg(host, "host bridge expected and not found\n"); > - return 0; > - } > - > - if (dport->rch) { > - dev_info(bridge, "host supports CXL (restricted)\n"); > - return 0; > - } > - > - rc = devm_cxl_register_pci_bus(host, bridge, pci_root->bus); > - if (rc) > - return rc; > - > - port = devm_cxl_add_port(host, bridge, dport->component_reg_phys, > - dport); > - if (IS_ERR(port)) > - return PTR_ERR(port); > - > - dev_info(bridge, "host supports CXL\n"); > - > - return 0; > -} > - > struct cxl_chbs_context { > unsigned long long uid; > resource_size_t base; > @@ -464,6 +419,51 @@ static int add_host_bridge_dport(struct device *match, void *arg) > return 0; > } > > +/* > + * A host bridge is a dport to a CFMWS decode and it is a uport to the > + * dport (PCIe Root Ports) in the host bridge. > + */ > +static int add_host_bridge_uport(struct device *match, void *arg) > +{ > + struct cxl_port *root_port = arg; > + struct device *host = root_port->dev.parent; > + struct acpi_device *hb = to_cxl_host_bridge(host, match); > + struct acpi_pci_root *pci_root; > + struct cxl_dport *dport; > + struct cxl_port *port; > + struct device *bridge; > + int rc; > + > + if (!hb) > + return 0; > + > + pci_root = acpi_pci_find_root(hb->handle); > + bridge = pci_root->bus->bridge; > + dport = cxl_find_dport_by_dev(root_port, bridge); > + if (!dport) { > + dev_dbg(host, "host bridge expected and not found\n"); > + return 0; > + } > + > + if (dport->rch) { > + dev_info(bridge, "host supports CXL (restricted)\n"); > + return 0; > + } > + > + rc = devm_cxl_register_pci_bus(host, bridge, pci_root->bus); > + if (rc) > + return rc; > + > + port = devm_cxl_add_port(host, bridge, dport->component_reg_phys, > + dport); > + if (IS_ERR(port)) > + return PTR_ERR(port); > + > + dev_info(bridge, "host supports CXL\n"); > + > + return 0; > +} > + > static int add_root_nvdimm_bridge(struct device *match, void *data) > { > struct cxl_decoder *cxld;