From 0df754bdb03982c64cdd78bbeec102bfe9a7a297 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Sat, 29 Jul 2023 01:49:15 +0200 Subject: [PATCH] soc/amd/common/data_fabric/domain: skip reserved resources for ACPI The non-PCI resources added to the domain device are resource consumers, so they mustn't be reported as resource producers. To make sure that this is the case, skip all resources that have the IORESOURCE_RESERVE flag set in amd_pci_domain_fill_ssdt. Commit 7a5dd781d147 ("soc/amd/common/data_fabric/domain: provide amd_pci_domain_fill_ssdt") that introduced amd_pci_domain_fill_ssdt already contained the bug, but since no MMIO range consumers were added back then, the bug only became visible when commit 32169720bb67 ("soc/amd/common/data_fabric/domain: report non-PCI MMIO resources") added the reserved non-PCI MMIO resources to the domain device's resources resulting in MMIO producer objects being generated for MMIO consumers. Those producers that should have been consumers then overlapped with the actual MMIO resource producers which caused Windows to BSOD with an ACPI_BIOS_ERROR. TEST=The non-PCI MMIO resources are no longer added as resource producers and Windows boots again on google/frostflow. Signed-off-by: Felix Held Signed-off-by: Arthur Heymans Tested-by: Matt DeVillier Change-Id: Ib099675bc5bea93bf7c2a80f741bef067fd37a58 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76818 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/soc/amd/common/block/data_fabric/domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/soc/amd/common/block/data_fabric/domain.c b/src/soc/amd/common/block/data_fabric/domain.c index fdc31b2f35..1b33f3181e 100644 --- a/src/soc/amd/common/block/data_fabric/domain.c +++ b/src/soc/amd/common/block/data_fabric/domain.c @@ -225,6 +225,10 @@ void amd_pci_domain_fill_ssdt(const struct device *domain) for (res = domain->resource_list; res != NULL; res = res->next) { if (!(res->flags & IORESOURCE_ASSIGNED)) continue; + /* Don't add MMIO producer ranges for reserved MMIO regions from non-PCI + devices */ + if ((res->flags & IORESOURCE_RESERVE)) + continue; switch (res->flags & IORESOURCE_TYPE_MASK) { case IORESOURCE_IO: write_ssdt_domain_io_producer_range(acpi_device_name(domain),