Re: [PATCH v2] cxl/hdm: allow zero sized committed decoders

From: Gregory Price
Date: Fri Oct 03 2025 - 00:28:41 EST


On Fri, Oct 03, 2025 at 12:59:07AM +0000, Vishal Aslot wrote:
>
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index e9e1d555cec6..50164fd1b434 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
> @@ -1047,10 +1047,10 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
> }
>
> + port->commit_end = cxld->id;
> +

Went looking to understand what commit_end actually does here, can you
help explain?

> if (size == 0) {
> - dev_warn(&port->dev,
> + dev_dbg(&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,9 @@ 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) {
> + continue;
> + }

Don't need brackets here

> dev_warn(&port->dev,
> "Failed to initialize decoder%d.%d\n",
> port->id, i);
> --
> 2.34.1