Commit c78bff95 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Carles Cufi
Browse files

drivers: intc_ioapic: Fix get ioapic_id



Information about IOAPIC can be located not in the first
DMAR Hardware Unit Definition subtable. Iterate them all.

Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
parent 28ac2133
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -127,9 +127,6 @@ static uint16_t ioapic_id;

static bool get_vtd(void)
{
	union acpi_dmar_id dmar_id;
	int inst_cnt;

	if (!device_is_ready(vtd)) {
		return false;
	}
@@ -138,14 +135,7 @@ static bool get_vtd(void)
		return true;
	}

	/* Assume only one PCH in system (say client platform). */
	if (!acpi_drhd_get(ACPI_DMAR_SCOPE_TYPE_IOAPIC, NULL, &dmar_id, &inst_cnt, 1u)) {
		return false;
	}

	ioapic_id = dmar_id.raw;

	return true;
	return acpi_dmar_ioapic_get(&ioapic_id) == 0;
}
#endif /* CONFIG_INTEL_VTD_ICTL && !INTEL_VTD_ICTL_XAPIC_PASSTHROUGH */