On Fri, Aug 07, 2026 at 01:10:47PM +0800, Richard Cheng wrote:
> 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.

I don't see a path to that happening. Userspace can't commit a zero-size 
decoder.
Writing 0 to dpa_size just frees the allocation, and region attach rejects empty
decoders, so a committed zero-size decoder can only come from firmware.

> 
> in which case cxl_decoder_is_locked() won't return true, can we handle that 
> situation ?
> 

More generally, an unlocked committed zero-size decoder looks identical to an 
idle slot
in sysfs, so telling them apart would need a new kernel attribute.

I'm going to merge these patches as is, and as we discover new flavors and ways 
to list
them we can add on.

Thanks for the reviews!

-- Alison


> 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) {
> > 

Reply via email to