From 6c373d82a66930c7771273d74e5c4666b69a5a81 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Thu, 17 Sep 2026 01:52:36 +0300 Subject: [PATCH] meson64: require the PCIe port services on boards that have PCIe Five meson64 boards enable PCIe in their device tree: ODROID-HC4 (root port -> ASM1061 -> two SATA ports, all of the board's storage), Khadas VIM3 and VIM3L (M.2), Banana Pi M2S and CM4IO. Yet the family has built every branch with CONFIG_PCIEPORTBUS off, so on all of them the root port has no driver at all: nothing puts it into D3hot on the way to suspend, and AER goes unserviced even though the port advertises the capability. The option was not dropped on purpose. It was still =y (together with PCIEAER) until ddccaaf02 in 2018, a wholesale rewrite of the meson64 kernel config titled 'Odroid C2 and Meson64 NEXT configuration cleanup', where it fell out among 2686 changed lines. At that time meson64 meant C2 and Le Potato, SoCs without any PCIe, so nothing was lost. ODROID-HC4, the first meson64 board with a real PCIe, arrived in 2020 and the family kernel config was never revisited. So this turns the option on in both places. The family kernel configs get PCIEPORTBUS=y and PCIEAER=y, which is what actually builds today. The hook in meson64_common.inc is insurance against those files being rewritten wholesale again, as happens now and then: an option that only a few boards depend on is easy to lose in such a diff, and the hook puts it back on the next build. At family level it applies to every meson64 board, so the kernel package stays one for the whole family. Verified on ODROID-HC4: the root port now reports 'pcieport 0000:00:00.0: PME: Signaling with IRQ 24' and 'AER: enabled with IRQ 24', and hot-plugging SATA drives keeps working. The other four boards are not on hand; the change is the same option and the same reason, and it only takes effect where the device tree enables the controller. Co-Authored-By: Claude Opus 5 (1M context) --- config/kernel/linux-meson64-bleedingedge.config | 3 ++- config/kernel/linux-meson64-current.config | 3 ++- config/kernel/linux-meson64-edge.config | 3 ++- config/kernel/linux-meson64-oldlts.config | 3 ++- config/sources/families/include/meson64_common.inc | 10 ++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/kernel/linux-meson64-bleedingedge.config b/config/kernel/linux-meson64-bleedingedge.config index dc13902dd370..7f08b51e52ad 100644 --- a/config/kernel/linux-meson64-bleedingedge.config +++ b/config/kernel/linux-meson64-bleedingedge.config @@ -607,7 +607,8 @@ CONFIG_NFC_S3FWRN82_UART=m CONFIG_NFC_ST95HF=m CONFIG_PAGE_POOL_STATS=y CONFIG_PCI=y -# CONFIG_PCIEPORTBUS is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIEAER=y CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_PCI_HOST_THUNDER_PEM=y CONFIG_PCI_HOST_THUNDER_ECAM=y diff --git a/config/kernel/linux-meson64-current.config b/config/kernel/linux-meson64-current.config index 7bcc139f5285..15cb82f257d9 100644 --- a/config/kernel/linux-meson64-current.config +++ b/config/kernel/linux-meson64-current.config @@ -624,7 +624,8 @@ CONFIG_NFC_S3FWRN82_UART=m CONFIG_NFC_ST95HF=m CONFIG_PAGE_POOL_STATS=y CONFIG_PCI=y -# CONFIG_PCIEPORTBUS is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIEAER=y CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_PCI_HOST_THUNDER_PEM=y CONFIG_PCI_HOST_THUNDER_ECAM=y diff --git a/config/kernel/linux-meson64-edge.config b/config/kernel/linux-meson64-edge.config index e9cb3dbe04e6..755fadcaf2ef 100644 --- a/config/kernel/linux-meson64-edge.config +++ b/config/kernel/linux-meson64-edge.config @@ -607,7 +607,8 @@ CONFIG_NFC_S3FWRN82_UART=m CONFIG_NFC_ST95HF=m CONFIG_PAGE_POOL_STATS=y CONFIG_PCI=y -# CONFIG_PCIEPORTBUS is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIEAER=y CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_PCI_HOST_THUNDER_PEM=y CONFIG_PCI_HOST_THUNDER_ECAM=y diff --git a/config/kernel/linux-meson64-oldlts.config b/config/kernel/linux-meson64-oldlts.config index 27d6c36b7384..f97b81e506e0 100644 --- a/config/kernel/linux-meson64-oldlts.config +++ b/config/kernel/linux-meson64-oldlts.config @@ -636,7 +636,8 @@ CONFIG_NFC_S3FWRN82_UART=m CONFIG_NFC_ST95HF=m CONFIG_PAGE_POOL_STATS=y CONFIG_PCI=y -# CONFIG_PCIEPORTBUS is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIEAER=y CONFIG_HOTPLUG_PCI_ACPI=y CONFIG_PCI_HOST_THUNDER_PEM=y CONFIG_PCI_HOST_THUNDER_ECAM=y diff --git a/config/sources/families/include/meson64_common.inc b/config/sources/families/include/meson64_common.inc index 4251b5a2a208..4b8400b63466 100644 --- a/config/sources/families/include/meson64_common.inc +++ b/config/sources/families/include/meson64_common.inc @@ -56,6 +56,16 @@ function custom_kernel_config__enable_rtl88x2cs_driver() { opts_m+=("CONFIG_RTL8822CS") } +# ODROID-HC4, Khadas VIM3 and VIM3L, Banana Pi M2S and CM4IO enable PCIe in their +# device tree. Without the port services their root port has no driver: nothing +# moves it to D3hot for suspend, and AER stays unserviced. +function custom_kernel_config__meson64_pcie_port_services() { + opts_y+=( + CONFIG_PCIEPORTBUS + CONFIG_PCIEAER + ) +} + # this helper function includes postprocess for s400 and its variants. # $1 PATH for uboot blob repo # $2 dir name in uboot blob repo