[RFC PATCH 7/8] acpi: srat: cxl: Skip zero length CXL fixed memory windows.

Jonathan Cameron Jonathan.Cameron at huawei.com
Wed May 29 10:12:35 PDT 2024


One reported platform uses this nonsensical entry to represent
a disable CFWMS. The acpi_cxl driver already correctly errors
out on seeing this, but that leaves an additional confusing node
in /sys/devices/system/nodes/possible plus wastes some space.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron at huawei.com>
---
 drivers/acpi/numa/srat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index e3f26e71637a..28c963d5c51f 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -329,6 +329,11 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header,
 	int node;
 
 	cfmws = (struct acpi_cedt_cfmws *)header;
+
+	/* At least one firmware reports disabled entries with size 0 */
+	if (cfmws->window_size == 0)
+		return 0;
+
 	start = cfmws->base_hpa;
 	end = cfmws->base_hpa + cfmws->window_size;
 
-- 
2.39.2




More information about the linux-arm-kernel mailing list