acpi_table: Fix IORT RC node

Even though the RC node has the correct size and the ID mappings
are written to the end of the node, the ID 'mapping offset' and
'mapping count' are not written in the IORT RC node header, thus it
looks like that the RC node has no ID mappings.
The Linux kernel doesn't complain about the invalid IORT RC node,
even though the spec says that each RC node must have an ID mapping.
The kernel will fail to use MSI IRQs and fall back to a legacy IRQ
mechanism that's not working either.
Finally it will show strange behaviour around PCI interrupts, making it
hard to trace back to an invalid IORT RC nodes.

Add the missing ID mapping count and mapping offset.

TEST: Fixes IRQ usage of PCI devices on qemu/sbsa-ref.
Fixes: bf5d37662d "acpi: acpi_table: Add IORT support"

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Patrick Rudolph 2025-03-16 09:32:52 +01:00 committed by Tom Rini
parent 885fd621a3
commit 92d448f4f1

View file

@ -646,6 +646,8 @@ int acpi_iort_add_rc(struct acpi_ctx *ctx,
node->type = ACPI_IORT_NODE_PCI_ROOT_COMPLEX;
node->revision = 2;
node->mapping_count = num_mappings;
node->mapping_offset = sizeof(struct acpi_iort_node) + sizeof(struct acpi_iort_rc);
node->length = sizeof(struct acpi_iort_node);
node->length += sizeof(struct acpi_iort_rc);