File Index
Files and directories
Sign in
FILE

ghes_helpers.c

File preview with syntax highlighting.

linux-6.19.14/drivers/acpi/apei/ghes_helpers.c C
 1// SPDX-License-Identifier: GPL-2.0-only
 2// Copyright(c) 2025 Intel Corporation. All rights reserved
 3
 4#include <linux/printk.h>
 5#include <cxl/event.h>
 6
 7int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err)
 8{
 9	if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) {
10		pr_err_ratelimited("CXL CPER invalid agent type\n");
11		return -EINVAL;
12	}
13
14	if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) {
15		pr_err_ratelimited("CXL CPER invalid protocol error log\n");
16		return -EINVAL;
17	}
18
19	if (prot_err->err_len != sizeof(struct cxl_ras_capability_regs)) {
20		pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n",
21				   prot_err->err_len);
22		return -EINVAL;
23	}
24
25	if ((prot_err->agent_type == RCD || prot_err->agent_type == DEVICE ||
26	     prot_err->agent_type == LD || prot_err->agent_type == FMLD) &&
27	    !(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER))
28		pr_warn_ratelimited(FW_WARN
29				    "CXL CPER no device serial number\n");
30
31	return 0;
32}
33EXPORT_SYMBOL_GPL(cxl_cper_sec_prot_err_valid);
~/ Read-only file preview.