git: 143dff0f9ce9 - main - pci: Only claim to support PCI ASPM on x86

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Fri, 03 Jan 2025 16:27:23 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=143dff0f9ce9a6f03ae5701368c7144b30e2dc39

commit 143dff0f9ce9a6f03ae5701368c7144b30e2dc39
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2025-01-03 15:50:38 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2025-01-03 16:10:41 +0000

    pci: Only claim to support PCI ASPM on x86
    
    We claim to support Active State Power Management, but don't appear to
    do anything different in the kernel when it's enabled other than tell
    the firmware we do.
    
    This breaks VMware Fusion on Apple Silicon when it's enabled as it
    expects the kernel to enable the ports. As it is reported to be needed
    on some x86 servers keep it enabled there, but disable on non-x86
    architectures.
    
    Reported by:    kp, tuexen
    Reviewed by:    tuexen, mav, imp, jhb
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D48303
---
 sys/dev/pci/pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 251680590747..cf01115581e1 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -407,7 +407,15 @@ static int pci_enable_ari = 1;
 SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari,
     0, "Enable support for PCIe Alternative RID Interpretation");
 
+/*
+ * Some x86 firmware only enables PCIe hotplug if we claim to support aspm,
+ * however enabling it breaks some arm64 firmware as it powers off devices.
+ */
+#if defined(__i386__) || defined(__amd64__)
 int pci_enable_aspm = 1;
+#else
+int pci_enable_aspm = 0;
+#endif
 SYSCTL_INT(_hw_pci, OID_AUTO, enable_aspm, CTLFLAG_RDTUN, &pci_enable_aspm,
     0, "Enable support for PCIe Active State Power Management");