Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp762713rwd; Thu, 1 Jun 2023 06:20:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ugl9Fa0jqcZsTHiSqt7FEJnNG0mFtvzU5H8R4e4BiCMdTZkorZ7eI9f6C16gCsitCsvY2 X-Received: by 2002:a17:90b:118:b0:250:8f09:75f2 with SMTP id p24-20020a17090b011800b002508f0975f2mr5731993pjz.22.1685625636781; Thu, 01 Jun 2023 06:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685625636; cv=none; d=google.com; s=arc-20160816; b=vtRueTzFYDEwkez0WfM6vgTTbMEV67E3jYK50eNA1uuRJaLKJ4u8CVWjSup6tsvt1s r8SC7SXMMRRVBsg1Tn0DJ4RFmiDRu0cCJsE7d4d0dRpZJQkauXZj5b1g0GdHC5oGCrpk JuAubuVMqbo+wyeHtOBuMKNzAHjkS1scrcLIhMQpgYfNwIcf9p8PjLDE+v9xPknGZcEq zVoTlz5+BLKd0ZhuBkPLOh8ubNmwDWlGw/1qXNtW9fbUxvxJSWVbfZ9xIp72xxoDJv11 XH9LAVmoNkemmlsCCfNvpwsRZdCHCntVdKIAj650ksd21EXTDhQOkxXQK7C6Vxyshd0/ //KQ== 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=FK73RnAySDzcu8UFxDGU58mwNaTISNmZa62r3/XeMJk=; b=q3SHxSoYJiNS1agGK7ME5QLMrAij16LUyOWDahyKti53ePxY2RRWAhkXiGwHNSGxTR i5uqL3/FRpJDFVREREJhy/veFsAD5N1lQhXmwfH12VXIu/O2ePULBoNvLKlKcUaQQctX h2EKmxFfOyWputG3ZuvLQLe7uGC0uFltJUwiuBAe5uhHoheD8Ll8A/KLpkPLHaZXMtEa +cJfODvsMZWvZvOtYKbEfYXSmoTx6Z4ZL+lV+PWEFBtmYqVGIJt8ObmT57ZC/H/fG47w 7J7hh82TWU9+Qg30S0xExILIHKMrEQKdvteclITinD6ZoWhsuQgQ7Ab7qEz1L3vHEe4X 6Wig== 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 c192-20020a6335c9000000b0053f8327e0e1si2846988pga.448.2023.06.01.06.20.23; Thu, 01 Jun 2023 06:20:36 -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 S233293AbjFANH5 (ORCPT + 99 others); Thu, 1 Jun 2023 09:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232895AbjFANH4 (ORCPT ); Thu, 1 Jun 2023 09:07:56 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9D7AE7; Thu, 1 Jun 2023 06:07:53 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QX5wQ0gv6z67LMV; Thu, 1 Jun 2023 21:05:42 +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:07:51 +0100 Date: Thu, 1 Jun 2023 14:07:50 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v4 12/23] cxl/pci: Store the endpoint's Component Register mappings in struct cxl_dev_state Message-ID: <20230601140750.000006e6@Huawei.com> In-Reply-To: <20230523232214.55282-13-terry.bowman@amd.com> References: <20230523232214.55282-1-terry.bowman@amd.com> <20230523232214.55282-13-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: lhrpeml100002.china.huawei.com (7.191.160.241) 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:22:03 -0500 Terry Bowman wrote: > From: Robert Richter > > Same as for ports and dports, also store the endpoint's Component > Register mappings, use struct cxl_dev_state for that. > > Signed-off-by: Robert Richter > Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron > --- > drivers/cxl/cxlmem.h | 3 ++- > drivers/cxl/pci.c | 9 +++++---- > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h > index a2845a7a69d8..2823c5aaf3db 100644 > --- a/drivers/cxl/cxlmem.h > +++ b/drivers/cxl/cxlmem.h > @@ -263,6 +263,7 @@ struct cxl_poison_state { > * > * @dev: The device associated with this CXL state > * @cxlmd: The device representing the CXL.mem capabilities of @dev > + * @comp_map: component register capability mappings > * @regs: Parsed register blocks > * @cxl_dvsec: Offset to the PCIe device DVSEC > * @rcd: operating in RCD mode (CXL 3.0 9.11.8 CXL Devices Attached to an RCH) > @@ -299,7 +300,7 @@ struct cxl_poison_state { > struct cxl_dev_state { > struct device *dev; > struct cxl_memdev *cxlmd; > - > + struct cxl_register_map comp_map; > struct cxl_regs regs; > int cxl_dvsec; > > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 54c486cd65dd..00983770ea7b 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -662,15 +662,16 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > * 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, &map); > + rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT, > + &cxlds->comp_map); > if (rc) > dev_warn(&pdev->dev, "No component registers (%d)\n", rc); > - else if (!map.component_map.ras.valid) > + else if (!cxlds->comp_map.component_map.ras.valid) > dev_dbg(&pdev->dev, "RAS registers not found\n"); > > - cxlds->component_reg_phys = map.resource; > + cxlds->component_reg_phys = cxlds->comp_map.resource; > > - rc = cxl_map_component_regs(&map, &cxlds->regs.component, > + rc = cxl_map_component_regs(&cxlds->comp_map, &cxlds->regs.component, > BIT(CXL_CM_CAP_CAP_ID_RAS)); > if (rc) > dev_dbg(&pdev->dev, "Failed to map RAS capability.\n");