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 40A78C433F5 for ; Wed, 18 May 2022 17:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241007AbiERRZh (ORCPT ); Wed, 18 May 2022 13:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241008AbiERRZc (ORCPT ); Wed, 18 May 2022 13:25:32 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0782E19CECC for ; Wed, 18 May 2022 10:25:31 -0700 (PDT) Received: from fraeml702-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4L3Kcv44Qyz6F8gY; Thu, 19 May 2022 01:25:19 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml702-chm.china.huawei.com (10.206.15.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.24; Wed, 18 May 2022 19:25:28 +0200 Received: from localhost (10.122.247.231) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 18 May 2022 18:25:28 +0100 Date: Wed, 18 May 2022 18:25:27 +0100 From: Jonathan Cameron To: Dan Williams CC: , , , , Subject: Re: [PATCH 08/14] cxl/mem: Skip range enumeration if mem_enable clear Message-ID: <20220518182527.00002c69@huawei.com> In-Reply-To: <165237929979.3832067.5582691867405954753.stgit@dwillia2-desk3.amr.corp.intel.com> References: <165237925642.3832067.15995008431029494571.stgit@dwillia2-desk3.amr.corp.intel.com> <165237929979.3832067.5582691867405954753.stgit@dwillia2-desk3.amr.corp.intel.com> Organization: Huawei Technologies R&D (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhreml737-chm.china.huawei.com (10.201.108.187) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On Thu, 12 May 2022 11:14:59 -0700 Dan Williams wrote: > When a device does not have mem_enable set then the current range > settings are moot. Skip the enumeration and cause cxl_hdm_decode_init() > to proceed directly to enable the HDM Decoder Capability. > > Fixes: 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info") > Signed-off-by: Dan Williams Reviewed-by: Jonathan Cameron > --- > drivers/cxl/core/pci.c | 2 ++ > drivers/cxl/mem.c | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c > index ea6711721901..f3e59f8b6621 100644 > --- a/drivers/cxl/core/pci.c > +++ b/drivers/cxl/core/pci.c > @@ -224,6 +224,8 @@ int cxl_dvsec_ranges(struct cxl_dev_state *cxlds, > } > > info->mem_enabled = FIELD_GET(CXL_DVSEC_MEM_ENABLE, ctrl); > + if (!info->mem_enabled) > + return 0; > > for (i = 0; i < hdm_count; i++) { > u64 base, size; > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > index 0cfbde134fc7..902d1f6e189e 100644 > --- a/drivers/cxl/mem.c > +++ b/drivers/cxl/mem.c > @@ -92,7 +92,7 @@ __mock bool cxl_hdm_decode_init(struct cxl_dev_state *cxlds, > * are expected even though Linux does not require or maintain that > * match. > */ > - if (!global_enable && info->ranges) > + if (!global_enable && info->mem_enabled && info->ranges) > goto out; > > retval = true; >