Re: [PATCH v12 07/25] CXL/PCI: Move CXL DVSEC definitions into uapi/linux/pci_regs.h

From: Cheatham, Benjamin
Date: Fri Oct 03 2025 - 16:13:50 EST


On 10/2/2025 10:25 AM, Bowman, Terry wrote:
>
>
> On 10/1/2025 10:58 AM, Jonathan Cameron wrote:
>> On Thu, 25 Sep 2025 17:34:22 -0500
>> Terry Bowman <terry.bowman@xxxxxxx> wrote:
>>
>>> The CXL DVSECs are currently defined in cxl/core/cxlpci.h. These are not
>>> accessible to other subsystems.
>>>
>>> Change DVSEC name formatting to follow the existing PCI format in
>>> pci_regs.h. The current format uses CXL_DVSEC_XYZ. Change to be PCI_DVSEC_CXL_XYZ.
>>> Reuse the existing formatting.
>>>
>>> Update existing occurrences to match the name change.
>>>
>>> Update the inline documentation to refer to latest CXL spec version.
>>>
>>> Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx>
>> Maybe we discussed it in earlier versions and I've forgotten but generally renaming
>> uapi defines is a non starter.
>>
>> I was kind of assuming lspci used these, but nope, it uses hard coded
>> value of 3 and it's own defines for the fields. (A younger me even reviewed
>> the patch adding those :) )
>>
>> https://github.com/pciutils/pciutils/blob/master/ls-ecaps.c#L1279
>>
>> However, that doesn't mean other code isn't already using those defines.
>>
>> Minimum I think would be to state here why you think we can get away with
>> this change.
>>
>> Personally I'd just not bother changing that one.
>>
>> Jonathan
>>
>>
>
> Ok, I'll leave these below as-is.
>
> #define PCI_DVSEC_CXL_PORT                             3                                   
> #define PCI_DVSEC_CXL_PORT_CTL                         0x0c                                  
> #define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR              0x00000001
>
> Terry
>

I think updating to the new names would be better here since they match the other #defines introduced here.
I don't know if this is a no-no, but just re-routing the old ones to the new ones with a comment along the
lines of "Deprecated to match other DVSEC definitions" seems fine to me.