Re: [ndctl PATCH 2/2] cxl/list: list locked zero-sized decoders
Dave Jiang <[email protected]> Fri, 31 Jul 2026 08:40:24 -0700
| Newsgroups | dev.linux.lists.nvdimm,org.kernel.vger.linux-cxl |
|---|---|
| Message-ID | <[email protected]> |
On 7/30/26 6:55 PM, Alison Schofield wrote: > 'cxl list' hides zero-sized decoders unless --idle is given, assuming > they are unconfigured idle slots. That assumption does not hold for > locked HDM decoders, which may legitimately report size 0 while being > committed by firmware. > > Do not suppress locked zero-sized decoders from the default listing. > Combined with the "locked" field in the decoder JSON, they are visible > and distinguishable from idle, unlocked slots that remain hidden > without --idle. > > Signed-off-by: Alison Schofield <[email protected]> Reviewed-by: Dave Jiang <[email protected]> > --- > cxl/filter.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/cxl/filter.c b/cxl/filter.c > index 5d634d3b2512..e6d45ac7b9e6 100644 > --- a/cxl/filter.c > +++ b/cxl/filter.c > @@ -847,7 +847,8 @@ static void walk_decoders(struct cxl_port *port, struct cxl_filter_params *p, > if (!util_cxl_decoder_filter_by_region(decoder, > p->region_filter)) > goto walk_children; > - if (!p->idle && cxl_decoder_get_size(decoder) == 0) > + if (!p->idle && cxl_decoder_get_size(decoder) == 0 && > + !cxl_decoder_is_locked(decoder)) > continue; > jdecoder = util_cxl_decoder_to_json(decoder, flags); > if (!decoder) {