[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SN7PR12MB81316C958DF0F4B10369B928BBE6A@SN7PR12MB8131.namprd12.prod.outlook.com>
Date: Wed, 1 Oct 2025 20:37:26 +0000
From: Vishal Aslot <vaslot@...dia.com>
To: Davidlohr Bueso <dave@...olabs.net>, Jonathan Cameron
<jonathan.cameron@...wei.com>, Dave Jiang <dave.jiang@...el.com>, Alison
Schofield <alison.schofield@...el.com>, Vishal Verma
<vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Dan Williams
<dan.j.williams@...el.com>, Li Ming <ming.li@...omail.com>, Peter Zijlstra
<peterz@...radead.org>, Dan Carpenter <dan.carpenter@...aro.org>, Zijun Hu
<zijun.hu@....qualcomm.com>, "linux-cxl@...r.kernel.org"
<linux-cxl@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] cxl/hdm: allow zero sized committed decoders
Signed-off-by: Vishal Aslot <vaslot@...dia.com>
---
drivers/cxl/core/hdm.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index e9e1d555cec6..97a5f27f5b72 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
+/* Copyright(c) 2022-2025 Intel Corporation. All rights reserved. */
#include <linux/seq_file.h>
#include <linux/device.h>
#include <linux/delay.h>
@@ -1050,7 +1050,7 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
dev_warn(&port->dev,
"decoder%d.%d: Committed with zero size\n",
port->id, cxld->id);
- return -ENXIO;
+ return -ENOSPC;
}
port->commit_end = cxld->id;
} else {
@@ -1210,6 +1210,11 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
rc = init_hdm_decoder(port, cxld, target_map, hdm, i,
&dpa_base, info);
if (rc) {
+ if (rc == -ENOSPC) {
+ put_device(&cxld->dev);
+ rc = 0;
+ continue;
+ }
dev_warn(&port->dev,
"Failed to initialize decoder%d.%d\n",
port->id, i);
--
2.34.1
Powered by blists - more mailing lists