Thread (48 messages) 48 messages, 5 authors, 9h ago

Re: [PATCH v18 03/13] cxl: Tighten CPER kfifo registration API and symbol visibility

From: Jonathan Cameron <jic23@kernel.org>
Date: 2026-07-20 21:59:52
Also in: linux-acpi, linux-cxl, linux-doc, linux-pci, lkml

On Fri, 17 Jul 2026 17:26:56 -0500
Terry Bowman [off-list ref] wrote:
From: Dan Williams <djbw@kernel.org>
Hi Terry, Dan,

There are a few different things in here. Having them all together
may make it a little harder to keep track of the different changes.
Tighten the CPER protocol error kfifo registration API and symbol
visibility.

Use EXPORT_SYMBOL_FOR_MODULES() instead of EXPORT_SYMBOL_NS_GPL() for
the CPER kfifo registration symbols. This names the consuming module
explicitly and gives compile-time enforcement.
To me this is one patch.
Drop the work_struct argument from the unregister path. Change the
WARN_ONCE condition to a NULL check since there is no caller pointer
to compare against anymore.
This is one.
Change register/unregister return types to void. Flag double registration
with WARN_ONCE() inside the lock instead of returning an error.
Another change.

That covers why for the register, for unregister maybe mention it was
unchecked anyway.
Change cxl_ras_init() to void because there is one consumer and one producer
so the error return was unnecessary. Remove the now-dead error check in
cxl_core_init().
This is change
Add a diagnostic log when the driver is not bound in
cxl_cper_handle_prot_err().
Unrelated really to all the rest. 

All nice changes and maybe a few of them can be combined but to me this
is too many in one.  Anyhow I might be letting perfect be enemy of
good and all that so if others think it should go in as one then
I'm fine with that.

Trivial thing inline todo with formatting consistency.
quoted hunk ↗ jump to hunk
Co-developed-by: Terry Bowman <redacted>
Signed-off-by: Terry Bowman <redacted>
Signed-off-by: Dan Williams <djbw@kernel.org>

---

Changes in v17 -> v18:
- New patch.
---
 drivers/acpi/apei/ghes.c | 32 +++++++++++++++-----------------
 drivers/cxl/core/core.h  |  7 ++-----
 drivers/cxl/core/port.c  |  6 +-----
 drivers/cxl/core/ras.c   | 12 +++++++-----
 include/cxl/event.h      | 17 ++++++-----------
 5 files changed, 31 insertions(+), 43 deletions(-)
diff --git a/include/cxl/event.h b/include/cxl/event.h
index ff97fea718d2c..3471d4f75c025 100644
--- a/include/cxl/event.h
+++ b/include/cxl/event.h
@@ -287,10 +287,10 @@ struct cxl_cper_prot_err_work_data {
-static inline int cxl_cper_register_prot_err_work(struct work_struct *work)
+static inline void cxl_cper_register_prot_err_work(struct work_struct *work)
 {
-	return 0;
 }
I'd go a bit long and move { } up.  Compact stubs are always nice!

-static inline int cxl_cper_unregister_prot_err_work(struct work_struct *work)
+static inline void cxl_cper_unregister_prot_err_work(void)
This one is shorter than the one you did it for above!
 {
-	return 0;
 }
 static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd)
 {
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help