Re: [PATCH v2 2/4] cxl/memdev: Hold memdev lock during memdev poison injection/clear
From: Li Ming
Date: Thu Mar 19 2026 - 07:16:09 EST
在 2026/3/18 23:36, Dave Jiang 写道:
On 3/18/26 4:59 AM, Li Ming wrote:
在 2026/3/17 23:00, Dave Jiang 写道:No. Maybe I misunderstood the comment from Dan. So we should keep this patch?
On 3/14/26 12:06 AM, Li Ming wrote:Hi Dave,
CXL memdev poison injection/clearing debugfs interfaces are visibleHi Ming, I dropped this patch with Dan's comments [1] and updated cxl/next. Please check and make sure everything looks ok to you. Thanks!
before the CXL memdev endpoint initialization, If user accesses the
interfaces before cxlmd->endpoint updated, it is possible to access an
invalid endpoint in cxl_dpa_to_region().
Hold CXL memdev lock at the beginning of the interfaces, this blocks the
interfaces until CXL memdev probing completed.
The following patch will check the given endpoint validity in
cxl_dpa_to_region().
Suggested-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>
Signed-off-by: Li Ming <ming.li@xxxxxxxxxxxx>
[1]: https://lore.kernel.org/linux-cxl/69b8b81621e16_452b100e@dwillia2-mobl4.notmuch/
I think there is no change needed in this patch, just need a independent patch for holding memdev lock in cxl_region_debugfs_poison_inject/clear.
Or you want to review this patch again?
DJ
Yes, I think so.
Ming