Re: [PATCH v11 06/23] CXL/AER: Introduce rch_aer.c into AER driver for handling CXL RCH errors

Bowman, Terry
2025-09-10T16:56:17Z

On 8/28/2025 3:53 PM, Dave Jiang wrote:
>
> On 8/26/25 6:35 PM, Terry Bowman wrote:
>> The restricted CXL Host (RCH) AER error handling logic currently resides
>> in the AER driver file, drivers/pci/pcie/aer.c. CXL specific changes are
>> conditionally compiled using #ifdefs.
>>
>> Improve the AER driver maintainability by separating the RCH specific logic
>> from the AER driver's core functionality and removing the ifdefs. Introduce
>> drivers/pci/pcie/rch_aer.c for moving the RCH AER logic into.
>>
>> Move the CXL logic into the new file but leave helper functions in aer.c
>> for now as they will be moved in future patch for CXL virtual hierarchy
>> handling.
>>
>> 2 changes are required to maintain compilation after the move. Change
>> cxl_rch_handle_error() & cxl_rch_enable_rcec() to be non-static inorder for
>> accessing from the AER driver in aer.c.
>>
>> Introduce CONFIG_CXL_RCH_RAS in cxl/Kconfig. Update pcie/pcie/Makefile to
>> conditionally compile rch_aer.c file using CONFIG_CXL_RCH_RAS.
>>
>> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
>>
>> ---
>> Changes in v10->v11:
>> - Remove changes in code-split and move to earlier, new patch
>> - Add #include <linux/bitfield.h> to cxl_ras.c
>> - Move cxl_rch_handle_error() & cxl_rch_enable_rcec() declarations from pci.h
>> to aer.h, more localized.
>> - Introduce CONFIG_CXL_RCH_RAS, includes Makefile changes, ras.c ifdef changes
>> ---
>> drivers/cxl/Kconfig | 9 +++-
>> drivers/cxl/core/ras.c | 3 ++
>> drivers/pci/pci.h | 20 +++++++
>> drivers/pci/pcie/Makefile | 1 +
>> drivers/pci/pcie/aer.c | 108 +++----------------------------------
>> drivers/pci/pcie/rch_aer.c | 99 ++++++++++++++++++++++++++++++++++
> I wonder if this should be cxl_rch_aer.c to be clear that it's cxl related code.
>
> DJ

Good idea. I'll make the change.

I know Dan had an interest in the naming for this file. Dan, let me know if
this is a problem or needs to be discussed.

Terry