Re: [ndctl PATCH 2/2] cxl/list: list locked zero-sized decoders
Richard Cheng <[email protected]>
| Newsgroups | org.kernel.vger.linux-cxl,dev.linux.lists.nvdimm |
|---|---|
| Message-ID | <anVoHcsukSEELpCi@MWDK4CY14F> |
On Fri, Jul 31, 2026 at 08:40:24AM +0800, Dave Jiang wrote: > > > 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. > > Hi Alison, patch looks good to me, just one small question, what if the zero size decoder is programmed by userspace, not from FW. in which case cxl_decoder_is_locked() won't return true, can we handle that situation ? Reviewed-by: Richard Cheng <[email protected]> Best regards, Richard Cheng. > > 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) { >