Re: [PATCH v4 05/14] cxl: Simplify cxl_root_ops allocation and handling

Dave Jiang
2025-11-07T15:50:29Z

On 11/7/25 8:45 AM, Robert Richter wrote:
> On 04.11.25 16:02:04, Dave Jiang wrote:
>>
>>
>> On 11/3/25 2:53 PM, Dave Jiang wrote:
>>>
>>>
>>> On 11/3/25 11:47 AM, Robert Richter wrote:
>>>> A root port's callback handlers are collected in struct cxl_root_ops.
>>>> The structure is dynamically allocated, though it contains only a
>>>> single pointer in it. This also requires to check two pointers to
>>>> check for the existance of a callback.
>>>>
>>>> Simplify the allocation, release and handler check by embedding the
>>>> ops statical in struct cxl_root.
>>>>
>>>> Signed-off-by: Robert Richter <rrichter@amd.com>
>>>
>>> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>>
>>
>
>> Thought about it for a bit, should the callback be with 'cxl_rd_ops'
>> and the rest of the translation functions under the root decoder
>> rather than cxl_root_ops with the cxl root? That seems to be the
>> better fit.
>
> The handler for address translation is needed to determine the root
> decoders. Because of that the cxl_rd_ops cannot be used to hold the
> callback reference. The use of cxl_root_ops works since the pci tree
> can be walked to get the cxl root without any cxl specific knowledge.
> A description of that is already in the patch that adds the callback.

Ok that is fair.

>
> I haven't evaluated moving qos to cxl_rd_ops as this is not the scope
> of the series.

The qos callback belongs with the cxl_root since the ACPI query is against the host bridge.>
> -Robert