Skip to content

Commit f3e6b3a

Browse files
committed
acpi/ghes: Remove CXL CPER notifications
Initial tests with the CXL CPER implementation identified that error reports were being duplicated in the log and the trace event [1]. Then it was discovered that the notification handler took sleeping locks while the GHES event handling runs in spin_lock_irqsave() context [2] While the duplicate reporting was fixed in v6.8-rc4, the fix for the sleeping-lock-vs-atomic collision would enjoy more time to settle and gain some test cycles. Given how late it is in the development cycle, remove the CXL hookup for now and try again during the next merge window. Note that end result is that v6.8 does not emit CXL CPER payloads to the kernel log, but this is in line with the CXL trend to move error reporting to trace events instead of the kernel log. Cc: Ard Biesheuvel <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Jonathan Cameron <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Link: http://lore.kernel.org/r/[email protected] [1] Closes: http://lore.kernel.org/r/[email protected] [2] Signed-off-by: Dan Williams <[email protected]>
1 parent b401b62 commit f3e6b3a

File tree

3 files changed

+1
-137
lines changed

3 files changed

+1
-137
lines changed

drivers/acpi/apei/ghes.c

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <linux/interrupt.h>
2727
#include <linux/timer.h>
2828
#include <linux/cper.h>
29-
#include <linux/cxl-event.h>
3029
#include <linux/platform_device.h>
3130
#include <linux/mutex.h>
3231
#include <linux/ratelimit.h>
@@ -674,52 +673,6 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
674673
schedule_work(&entry->work);
675674
}
676675

677-
/*
678-
* Only a single callback can be registered for CXL CPER events.
679-
*/
680-
static DECLARE_RWSEM(cxl_cper_rw_sem);
681-
static cxl_cper_callback cper_callback;
682-
683-
static void cxl_cper_post_event(enum cxl_event_type event_type,
684-
struct cxl_cper_event_rec *rec)
685-
{
686-
if (rec->hdr.length <= sizeof(rec->hdr) ||
687-
rec->hdr.length > sizeof(*rec)) {
688-
pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
689-
rec->hdr.length);
690-
return;
691-
}
692-
693-
if (!(rec->hdr.validation_bits & CPER_CXL_COMP_EVENT_LOG_VALID)) {
694-
pr_err(FW_WARN "CXL CPER invalid event\n");
695-
return;
696-
}
697-
698-
guard(rwsem_read)(&cxl_cper_rw_sem);
699-
if (cper_callback)
700-
cper_callback(event_type, rec);
701-
}
702-
703-
int cxl_cper_register_callback(cxl_cper_callback callback)
704-
{
705-
guard(rwsem_write)(&cxl_cper_rw_sem);
706-
if (cper_callback)
707-
return -EINVAL;
708-
cper_callback = callback;
709-
return 0;
710-
}
711-
EXPORT_SYMBOL_NS_GPL(cxl_cper_register_callback, CXL);
712-
713-
int cxl_cper_unregister_callback(cxl_cper_callback callback)
714-
{
715-
guard(rwsem_write)(&cxl_cper_rw_sem);
716-
if (callback != cper_callback)
717-
return -EINVAL;
718-
cper_callback = NULL;
719-
return 0;
720-
}
721-
EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_callback, CXL);
722-
723676
static bool ghes_do_proc(struct ghes *ghes,
724677
const struct acpi_hest_generic_status *estatus)
725678
{
@@ -754,22 +707,6 @@ static bool ghes_do_proc(struct ghes *ghes,
754707
}
755708
else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
756709
queued = ghes_handle_arm_hw_error(gdata, sev, sync);
757-
} else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) {
758-
struct cxl_cper_event_rec *rec =
759-
acpi_hest_get_payload(gdata);
760-
761-
cxl_cper_post_event(CXL_CPER_EVENT_GEN_MEDIA, rec);
762-
} else if (guid_equal(sec_type, &CPER_SEC_CXL_DRAM_GUID)) {
763-
struct cxl_cper_event_rec *rec =
764-
acpi_hest_get_payload(gdata);
765-
766-
cxl_cper_post_event(CXL_CPER_EVENT_DRAM, rec);
767-
} else if (guid_equal(sec_type,
768-
&CPER_SEC_CXL_MEM_MODULE_GUID)) {
769-
struct cxl_cper_event_rec *rec =
770-
acpi_hest_get_payload(gdata);
771-
772-
cxl_cper_post_event(CXL_CPER_EVENT_MEM_MODULE, rec);
773710
} else {
774711
void *err = acpi_hest_get_payload(gdata);
775712

drivers/cxl/pci.c

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -974,61 +974,6 @@ static struct pci_driver cxl_pci_driver = {
974974
},
975975
};
976976

977-
#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0)
978-
static void cxl_cper_event_call(enum cxl_event_type ev_type,
979-
struct cxl_cper_event_rec *rec)
980-
{
981-
struct cper_cxl_event_devid *device_id = &rec->hdr.device_id;
982-
struct pci_dev *pdev __free(pci_dev_put) = NULL;
983-
enum cxl_event_log_type log_type;
984-
struct cxl_dev_state *cxlds;
985-
unsigned int devfn;
986-
u32 hdr_flags;
987-
988-
devfn = PCI_DEVFN(device_id->device_num, device_id->func_num);
989-
pdev = pci_get_domain_bus_and_slot(device_id->segment_num,
990-
device_id->bus_num, devfn);
991-
if (!pdev)
992-
return;
993-
994-
guard(pci_dev)(pdev);
995-
if (pdev->driver != &cxl_pci_driver)
996-
return;
997-
998-
cxlds = pci_get_drvdata(pdev);
999-
if (!cxlds)
1000-
return;
1001-
1002-
/* Fabricate a log type */
1003-
hdr_flags = get_unaligned_le24(rec->event.generic.hdr.flags);
1004-
log_type = FIELD_GET(CXL_EVENT_HDR_FLAGS_REC_SEVERITY, hdr_flags);
1005-
1006-
cxl_event_trace_record(cxlds->cxlmd, log_type, ev_type,
1007-
&uuid_null, &rec->event);
1008-
}
1009-
1010-
static int __init cxl_pci_driver_init(void)
1011-
{
1012-
int rc;
1013-
1014-
rc = cxl_cper_register_callback(cxl_cper_event_call);
1015-
if (rc)
1016-
return rc;
1017-
1018-
rc = pci_register_driver(&cxl_pci_driver);
1019-
if (rc)
1020-
cxl_cper_unregister_callback(cxl_cper_event_call);
1021-
1022-
return rc;
1023-
}
1024-
1025-
static void __exit cxl_pci_driver_exit(void)
1026-
{
1027-
pci_unregister_driver(&cxl_pci_driver);
1028-
cxl_cper_unregister_callback(cxl_cper_event_call);
1029-
}
1030-
1031-
module_init(cxl_pci_driver_init);
1032-
module_exit(cxl_pci_driver_exit);
977+
module_pci_driver(cxl_pci_driver);
1033978
MODULE_LICENSE("GPL v2");
1034979
MODULE_IMPORT_NS(CXL);

include/linux/cxl-event.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,4 @@ struct cxl_cper_event_rec {
140140
union cxl_event event;
141141
} __packed;
142142

143-
typedef void (*cxl_cper_callback)(enum cxl_event_type type,
144-
struct cxl_cper_event_rec *rec);
145-
146-
#ifdef CONFIG_ACPI_APEI_GHES
147-
int cxl_cper_register_callback(cxl_cper_callback callback);
148-
int cxl_cper_unregister_callback(cxl_cper_callback callback);
149-
#else
150-
static inline int cxl_cper_register_callback(cxl_cper_callback callback)
151-
{
152-
return 0;
153-
}
154-
155-
static inline int cxl_cper_unregister_callback(cxl_cper_callback callback)
156-
{
157-
return 0;
158-
}
159-
#endif
160-
161143
#endif /* _LINUX_CXL_EVENT_H */

0 commit comments

Comments
 (0)