Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] cxl/mem: handle_dcd_chain_event() queues work on deprecated system_wq --
commit ffea09425b5b7122c1c8acbc05e99f66a63015a7 Author: Anisa Su <[email protected]> cxl/mem: Add 20 second timeout for stalled DC event chains This commit adds a 20-second delayed-work watchdog to abort Dynamic Capacity event chains when a device opens a chain with CXL_DCD_EVENT_MORE set but never sends the closing record. On timeout, an add capacity chain is refused with an empty response while a release capacity chain is cleared for retry. > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > index 3acf5ace48dbc..fea910e6c5108 100644 > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c [ ... ] > @@ -1279,9 +1343,22 @@ static int handle_dcd_chain_event(struct > cxl_memdev_state *mds, > > if (event->flags & CXL_DCD_EVENT_MORE) { > dev_dbg(dev, "more bit set; delay processing of extent\n"); > + /* The deadline is fixed when the chain opens, not per record */ > + if (!chain->armed) { > + queue_delayed_work(system_wq, &chain->timeout_work, > + CXL_DC_CHAIN_TIMEOUT); > + chain->armed = true; > + } [Severity: Low] When a Dynamic Capacity event record arrives with CXL_DCD_EVENT_MORE set, handle_dcd_chain_event() queues chain->timeout_work onto system_wq. In include/linux/workqueue.h, system_wq is marked deprecated in favor of system_percpu_wq: extern struct workqueue_struct *system_wq; /* use system_percpu_wq, this will be removed */ extern struct workqueue_struct *system_percpu_wq; Because system_wq is allocated with __WQ_DEPRECATED, when the 20-second timer expires and delayed_work_timer_fn() dispatches the work via __queue_work(), it triggers a runtime deprecation warning: if (unlikely(wq->flags & __WQ_DEPRECATED)) pr_warn_once("workqueue: work func %ps enqueued on deprecated workqueue. " "Use system_{percpu|dfl}_wq instead.\n", work->func); Should handle_dcd_chain_event() use schedule_delayed_work() or system_percpu_wq instead of system_wq? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=5
