aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-02-08 21:43:25 +0000
committerWarner Losh <imp@FreeBSD.org>2021-02-11 05:15:08 +0000
commita7c68340584c942792188ad50593d4ef15cc8982 (patch)
tree502eb5f4a58ab706fe3fe14721c65a028f0e2812
parent40c1f835412d3e00901a146db6c317d654e65980 (diff)
downloadsrc-a7c68340584c942792188ad50593d4ef15cc8982.tar.gz
src-a7c68340584c942792188ad50593d4ef15cc8982.zip
acpi: limit the AMDI0020/AMDI0010 workaround to an option
It appears that production versions of EPYC firmware get the _STA method right for these nodes. In fact, this workaround breaks on production hardware by including too many uart nodes. This work around was for pre-release hardware that wound up not having a large deployment. Move this work around to a kernel option since the machines that needed it have been powered off and are difficult to resurrect. Should there be a more significant deployment than is understood, we can restrict it based on smbios strings. Discussed with: mmacy@, seanc@, jhb@ MFC After: 3 days (cherry picked from commit 35af933173d516101f4c44af328fbe2d6e587869)
-rw-r--r--sys/conf/options1
-rw-r--r--sys/dev/acpica/acpi.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/conf/options b/sys/conf/options
index 0644fb6e597e..561e2574b964 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -730,6 +730,7 @@ ACPI_MAX_TASKS opt_acpi.h
ACPI_MAX_THREADS opt_acpi.h
ACPI_DMAR opt_acpi.h
DEV_ACPI opt_acpi.h
+ACPI_EARLY_EPYC_WAR opt_acpi.h
# ISA support
DEV_ISA opt_isa.h
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 6d7ed154c463..bcccd23c8c58 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2254,6 +2254,8 @@ acpi_DeviceIsPresent(device_t dev)
h = acpi_get_handle(dev);
if (h == NULL)
return (FALSE);
+
+#ifdef ACPI_EARLY_EPYC_WAR
/*
* Onboard serial ports on certain AMD motherboards have an invalid _STA
* method that always returns 0. Force them to always be treated as present.
@@ -2262,6 +2264,7 @@ acpi_DeviceIsPresent(device_t dev)
*/
if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010"))
return (TRUE);
+#endif
status = acpi_GetInteger(h, "_STA", &s);