]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/events: Add extra validity checks for corrected memory error count in General...
authorShiju Jose <shiju.jose@huawei.com>
Thu, 17 Jul 2025 10:18:15 +0000 (11:18 +0100)
committerDave Jiang <dave.jiang@intel.com>
Fri, 18 Jul 2025 15:19:56 +0000 (08:19 -0700)
commitcd3b36cfc659306456d3cf3714c8856307693c01
treeb62d9b1903d51ced486c8361613da85c46973244
parent1f4f8166110f037f15a89c2203ff887b98a8393a
cxl/events: Add extra validity checks for corrected memory error count in General Media Event Record

According to the CXL Specification Revision 3.2, Section 8.2.10.2.1.1,
Table 8-57 (General Media Event Record), the Corrected Memory Error Count
field is valid under the following conditions:
1. The Threshold Event bit is set in the Memory Event Descriptor field,
and
2. The Corrected Memory Error Count must be greater than 0 for events
where the Advanced Programmable Threshold Counter has expired.

Additionally, if the Advanced Programmable Corrected Memory Error Counter
Expire bit in the Memory Event Type field is set, then the Threshold Event
bit in the Memory Event Descriptor field shall also be set.

Add validity checks for the above conditions while reporting the event to
the userspace.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Link: https://patch.msgid.link/20250717101817.2104-3-shiju.jose@huawei.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/mbox.c
drivers/cxl/core/trace.h