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

From: Davidlohr Bueso
Date: Fri Oct 03 2025 - 20:22:49 EST


On Fri, 03 Oct 2025, Vishal Aslot wrote:

init_hdm_decoder() fails with -ENXIO if a
committed HDM decoder has zero size.

This can be removed.


The CXL spec permits committing zero sized decoders.

This is enough info, no need for the quote below.
And then add "Linux currently considers them an error".

See "8.2.4.20.12 Committing Decoder Programming".
It says,"It is legal for software to program Decoder
Size to 0 and commit it. Such a decoder will not
participate in HDM decode."

This patch updates init_hdm_decoder() to return
-ENOSPC if the decoder is commited with zero-size.

This is not needed in the changelog. Instead the reader
could be enlightened for potential reasons and use
cases of 0 sized decoders.

The caller leaves the decoder allocated but does not
add it. It simply continues to the next decoder.

Thanks,
Davidlohr