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 57A32C77B7A for ; Thu, 1 Jun 2023 13:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234122AbjFAN3r (ORCPT ); Thu, 1 Jun 2023 09:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234010AbjFAN3d (ORCPT ); Thu, 1 Jun 2023 09:29:33 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84608E56; Thu, 1 Jun 2023 06:29:11 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QX6Qz5RG2z6J748; Thu, 1 Jun 2023 21:28:43 +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 14:28:44 +0100 Date: Thu, 1 Jun 2023 14:28:44 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v4 16/23] cxl/pci: Remove Component Register base address from struct cxl_dev_state Message-ID: <20230601142844.0000028c@Huawei.com> In-Reply-To: <20230523232214.55282-17-terry.bowman@amd.com> References: <20230523232214.55282-1-terry.bowman@amd.com> <20230523232214.55282-17-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: lhrpeml500003.china.huawei.com (7.191.162.67) 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 Tue, 23 May 2023 18:22:07 -0500 Terry Bowman wrote: > From: Robert Richter > > The Component Register base address @component_reg_phys is no longer > used after the rework of the Component Register setup which now uses > struct member @comp_map instead. Remove the base address. > > Signed-off-by: Robert Richter > Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron > --- > drivers/cxl/cxlmem.h | 2 -- > drivers/cxl/mem.c | 4 ++-- > drivers/cxl/pci.c | 3 --- > 3 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > index 2823c5aaf3db..7b5b2d3187bf 100644 > --- a/drivers/cxl/cxlmem.h > +++ b/drivers/cxl/cxlmem.h > @@ -287,7 +287,6 @@ struct cxl_poison_state { > * @active_persistent_bytes: sum of hard + soft persistent > * @next_volatile_bytes: volatile capacity change pending device reset > * @next_persistent_bytes: persistent capacity change pending device reset > - * @component_reg_phys: register base of component registers > * @info: Cached DVSEC information about the device. > * @serial: PCIe Device Serial Number > * @event: event log driver state > @@ -326,7 +325,6 @@ struct cxl_dev_state { > u64 next_volatile_bytes; > u64 next_persistent_bytes; > > - resource_size_t component_reg_phys; > u64 serial; > > struct cxl_event_state event; > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > index 0643852444f3..618e839919eb 100644 > --- a/drivers/cxl/mem.c > +++ b/drivers/cxl/mem.c > @@ -49,7 +49,6 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd, > struct cxl_dport *parent_dport) > { > struct cxl_port *parent_port = parent_dport->port; > - struct cxl_dev_state *cxlds = cxlmd->cxlds; > struct cxl_port *endpoint, *iter, *down; > int rc; > > @@ -65,8 +64,9 @@ static int devm_cxl_add_endpoint(struct device *host, struct cxl_memdev *cxlmd, > ep->next = down; > } > > + /* The Endpoint's component regs are located in cxlds. */ > endpoint = devm_cxl_add_port(host, &cxlmd->dev, > - cxlds->component_reg_phys, > + CXL_RESOURCE_NONE, > parent_dport); > if (IS_ERR(endpoint)) > return PTR_ERR(endpoint); > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 00983770ea7b..0db71493db5d 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -661,7 +661,6 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > * If the component registers can't be found, the cxl_pci driver may > * still be useful for management functions so don't return an error. > */ > - cxlds->component_reg_phys = CXL_RESOURCE_NONE; > rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT, > &cxlds->comp_map); > if (rc) > @@ -669,8 +668,6 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > else if (!cxlds->comp_map.component_map.ras.valid) > dev_dbg(&pdev->dev, "RAS registers not found\n"); > > - cxlds->component_reg_phys = cxlds->comp_map.resource; > - > rc = cxl_map_component_regs(&cxlds->comp_map, &cxlds->regs.component, > BIT(CXL_CM_CAP_CAP_ID_RAS)); > if (rc)