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 83F9BC433F5 for ; Fri, 25 Mar 2022 11:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238846AbiCYLlO (ORCPT ); Fri, 25 Mar 2022 07:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345552AbiCYLlO (ORCPT ); Fri, 25 Mar 2022 07:41:14 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F15F965171 for ; Fri, 25 Mar 2022 04:39:38 -0700 (PDT) Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4KQ0Sv3sQXz67x9D; Fri, 25 Mar 2022 19:37:51 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 25 Mar 2022 12:39:37 +0100 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.2308.21; Fri, 25 Mar 2022 11:39:36 +0000 Date: Fri, 25 Mar 2022 11:39:35 +0000 From: Jonathan Cameron To: Dan Williams CC: , , , , Subject: Re: [PATCH v2 3/6] cxl/mem: Make cxl_dvsec_range() init failure fatal Message-ID: <20220325113935.00004dcb@huawei.com> In-Reply-To: <164730735324.3806189.4167509857771192422.stgit@dwillia2-desk3.amr.corp.intel.com> References: <164730733718.3806189.9721916820488234094.stgit@dwillia2-desk3.amr.corp.intel.com> <164730735324.3806189.4167509857771192422.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: lhreml745-chm.china.huawei.com (10.201.108.195) 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 Mon, 14 Mar 2022 18:22:33 -0700 Dan Williams wrote: > In preparation for the cxl_pci driver to continue operation after > cxl_dvsec_range() failure, update cxl_mem to check for negative error > codes in info->ranges. Treat that condition as fatal regardless of the > state of the HDM configuration since cxl_mem needs positive confirmation > that legacy ranges were not established by platform firmware or another > agent. > > Signed-off-by: Dan Williams Reviewed-by: Jonathan Cameron --- > drivers/cxl/mem.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > index cd4e8bba82aa..50704deb2ff0 100644 > --- a/drivers/cxl/mem.c > +++ b/drivers/cxl/mem.c > @@ -88,6 +88,9 @@ __mock bool cxl_dvsec_decode_init(struct cxl_dev_state *cxlds) > void __iomem *crb; > u32 global_ctrl; > > + if (info->ranges < 0) > + return false; > + > /* map hdm decoder */ > crb = ioremap(cxlds->component_reg_phys, CXL_COMPONENT_REG_BLOCK_SIZE); > if (!crb) { >