summaryrefslogtreecommitdiff
path: root/lib/acpi
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2025-03-16 09:32:52 +0100
committerTom Rini <[email protected]>2025-04-03 11:38:14 -0600
commit92d448f4f1ed80dfaa2327eeea9a741717dc3847 (patch)
treeaefff260f9243dc04758b0e9b5a39569ed13f1db /lib/acpi
parent885fd621a309a2c3f8e8d41bdc8ff893221dc478 (diff)
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: bf5d37662da5 "acpi: acpi_table: Add IORT support" Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'lib/acpi')
-rw-r--r--lib/acpi/acpi_table.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index c0ed24984af..0e0a7cc498f 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -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);