RE: [PATCH v12 14/20] cxl/pci: Map RCH downstream AER registers for logging protocol errors

From: Dan Williams
Date: Fri Oct 27 2023 - 18:16:46 EST


Robert Richter wrote:
> From: Terry Bowman <terry.bowman@xxxxxxx>
>
> The restricted CXL host (RCH) error handler will log protocol errors
> using AER and RAS status registers. The AER and RAS registers need to
> be virtually memory mapped before enabling interrupts. Create the
> initializer function devm_cxl_setup_parent_dport() for this when the
> endpoint is connected with the dport. The initialization sets up the
> RCH RAS and AER mappings.
>
> Add 'struct cxl_regs' to 'struct cxl_dport' for saving a pointer to
> the RCH downstream port's AER and RAS registers.
>
> Signed-off-by: Terry Bowman <terry.bowman@xxxxxxx>
> Co-developed-by: Robert Richter <rrichter@xxxxxxx>
> Signed-off-by: Robert Richter <rrichter@xxxxxxx>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> ---
> drivers/cxl/core/pci.c | 36 ++++++++++++++++++++++++++++++++++++
> drivers/cxl/cxl.h | 10 ++++++++++
> 2 files changed, 46 insertions(+)
>
> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
> index d101fdafb07c..3b4bb8d05035 100644
> --- a/drivers/cxl/core/pci.c
> +++ b/drivers/cxl/core/pci.c
> @@ -5,6 +5,7 @@
> #include <linux/delay.h>
> #include <linux/pci.h>
> #include <linux/pci-doe.h>
> +#include <linux/aer.h>
> #include <cxlpci.h>
> #include <cxlmem.h>
> #include <cxl.h>
> @@ -730,6 +731,38 @@ static bool cxl_handle_endpoint_ras(struct cxl_dev_state *cxlds)
>
> #ifdef CONFIG_PCIEAER_CXL

Here is more code in an ifdef block that has no compile time dependency
on the config symbol. Please do not use ifdef blocks for runtime
dependencies.

Again, this will need to be a post -rc1 cleanup.