From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 337AAEB64DB for ; Thu, 22 Jun 2023 11:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjFVLR0 (ORCPT ); Thu, 22 Jun 2023 07:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjFVLRT (ORCPT ); Thu, 22 Jun 2023 07:17:19 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943A91BDF; Thu, 22 Jun 2023 04:17:18 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QmySS4Tjfz67Gvv; Thu, 22 Jun 2023 19:14:32 +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.27; Thu, 22 Jun 2023 12:17:16 +0100 Date: Thu, 22 Jun 2023 12:17:15 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v6 13/27] cxl/mem: Prepare for early RCH dport component register setup Message-ID: <20230622121715.000056fb@Huawei.com> In-Reply-To: <20230622035126.4130151-14-terry.bowman@amd.com> References: <20230622035126.4130151-1-terry.bowman@amd.com> <20230622035126.4130151-14-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: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Jun 2023 22:51:12 -0500 Terry Bowman wrote: > From: Robert Richter > > In order to move the RCH dport component register setup to cxl_pci the > base address must be stored in CXL device state (cxlds) for both > modes, RCH and VH. Store it in cxlds->component_reg_phys and use it > for endpoint creation. > > Signed-off-by: Robert Richter > Signed-off-by: Terry Bowman Seems reasonable. Reviewed-by: Jonathan Cameron > --- > drivers/cxl/mem.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > index 4cc461c22b8b..7638a7f8f333 100644 > --- a/drivers/cxl/mem.c > +++ b/drivers/cxl/mem.c > @@ -51,7 +51,6 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd, > struct cxl_port *parent_port = parent_dport->port; > struct cxl_dev_state *cxlds = cxlmd->cxlds; > struct cxl_port *endpoint, *iter, *down; > - resource_size_t component_reg_phys; > int rc; > > /* > @@ -72,11 +71,11 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd, > * typical register locator mechanism. > */ > if (parent_dport->rch && cxlds->component_reg_phys == CXL_RESOURCE_NONE) > - component_reg_phys = > + cxlds->component_reg_phys = > cxl_rcd_component_reg_phys(&cxlmd->dev, parent_dport); > - else > - component_reg_phys = cxlds->component_reg_phys; > - endpoint = devm_cxl_add_port(host, &cxlmd->dev, component_reg_phys, > + > + endpoint = devm_cxl_add_port(host, &cxlmd->dev, > + cxlds->component_reg_phys, > parent_dport); > if (IS_ERR(endpoint)) > return PTR_ERR(endpoint);