Re: [RFC PATCH 2/4] PCI/CXL: Populate and insert/remove pdev->coh_resource[]

From: Ankit Agrawal

Date: Thu Oct 22 2026 - 07:12:49 EST


>> + if (!(config->flags & CXL_DECODER_F_ENABLE))
>> + continue;
>> +
>
> Hi Ankit,
>
> In cover letter you said decoder mappings are fixed and locked, don't we need
> to check CXL_DECODER_F_LOCK here ?
> An unlocked decoder can change later, leaving coh_resource[] stale.

Right, I'll skip any decoder that isn't both ENABLE and LOCK in v2.

>> +             *res = DEFINE_RES_NAMED_DESC(config->hpa_range.start,
>> +                                          range_len(&config->hpa_range),
>> +                                          "CXL coherent memory",
>> +                                          IORESOURCE_MEM, IORES_DESC_NONE);
>> +
>
> Hello Ankit,
>
> If we encounter zero-sized HDM decoder here, the resource's end address wraps
> to 0xffffffffffffffff.
>
> I think we need to skip zero-size decoder here or explicitly make its resource
> empty.

Yeah, good point. I'll compute the size up front and skip when it is 0.

> Best regards,
> Richard Cheng.