cxl/pci: Register for and process CPER events
authorIra Weiny <ira.weiny@intel.com>
Thu, 21 Dec 2023 00:17:36 +0000 (16:17 -0800)
committerDan Williams <dan.j.williams@intel.com>
Tue, 9 Jan 2024 23:41:23 +0000 (15:41 -0800)
commitdc97f6344f205b0dfa144e1b3e16d6dc05383d57
tree1d8e0ea26554f22f8385a329096c1d17c4dbaa84
parentced085ef369af7a2b6da962ec2fbd01339f60693
cxl/pci: Register for and process CPER events

If the firmware has configured CXL event support to be firmware first
the OS can process those events through CPER records.  The CXL layer has
unique DPA to HPA knowledge and standard event trace parsing in place.

CPER records contain Bus, Device, Function information which can be used
to identify the PCI device which is sending the event.

Change the PCI driver registration to include registration of a CXL
CPER callback to process events through the trace subsystem.

Use new scoped based management to simplify the handling of the PCI
device object.

Tested-by: Smita-Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Reviewed-by: Smita-Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Link: https://lore.kernel.org/r/20231220-cxl-cper-v5-9-1bb8a4ca2c7a@intel.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
[djbw: use new pci_dev guard, flip init order]
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c
drivers/cxl/cxlmem.h
drivers/cxl/pci.c
include/linux/cxl-event.h