Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa697079 authored by David Woodhouse's avatar David Woodhouse
Browse files

dmar: Fix build failure without NUMA, warn on bogus RHSA tables and don't abort

parent 4c923d47
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -348,6 +348,7 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev)
}
#endif

#ifdef CONFIG_ACPI_NUMA
static int __init
dmar_parse_one_rhsa(struct acpi_dmar_header *header)
{
@@ -355,7 +356,7 @@ dmar_parse_one_rhsa(struct acpi_dmar_header *header)
	struct dmar_drhd_unit *drhd;

	rhsa = (struct acpi_dmar_rhsa *)header;
	for_each_drhd_unit(drhd)
	for_each_drhd_unit(drhd) {
		if (drhd->reg_base_addr == rhsa->base_address) {
			int node = acpi_map_pxm_to_node(rhsa->proximity_domain);

@@ -364,9 +365,17 @@ dmar_parse_one_rhsa(struct acpi_dmar_header *header)
			drhd->iommu->node = node;
			return 0;
		}
	}
	WARN(1, "Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n"
	     "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
	     drhd->reg_base_addr,
	     dmi_get_system_info(DMI_BIOS_VENDOR),
	     dmi_get_system_info(DMI_BIOS_VERSION),
	     dmi_get_system_info(DMI_PRODUCT_VERSION));

	return -ENODEV;
	return 0;
}
#endif

static void __init
dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
@@ -487,7 +496,9 @@ parse_dmar_table(void)
#endif
			break;
		case ACPI_DMAR_HARDWARE_AFFINITY:
#ifdef CONFIG_ACPI_NUMA
			ret = dmar_parse_one_rhsa(entry_header);
#endif
			break;
		default:
			printk(KERN_WARNING PREFIX