From d79ad1f177ef098ce9a14c2ccbc802eb23df3dc0 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Wed, 22 Apr 2026 05:38:38 +0300 Subject: [PATCH] =?UTF-8?q?mvebu:=20clearfog=20PCIe=20patch=20=E2=80=94=20?= =?UTF-8?q?drop=202016=20debug=20hunks=20(aspm.c,=20portdrv.c)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch 10-mvebu-clearfog-pcie-updates.patch (Russell King, Nov 2016) was restored from mvebu-6.6/ to mvebu-6.18/ alongside three other lost patches. It bundled together two distinct kinds of changes: 1. Functional AER/PME plumbing for the mvebu PCIe controller: - mvebu_pcie_handle_irq_change() in pci-mvebu.c, which syncs the hardware PCIE_INT_UNMASK_OFF mask (BIT 8/9/10/16/17/18) with the emulated bridge config space whenever AER-related bits in PCI_COMMAND.SERR, BRIDGE_CTL.SERR, DEVCTL.{CERE,NFERE,FERE,URRE} or RTCTL.{SECEE,SENFEE,SEFEE,PMEIE} change - Armada 370 erratum: clamp DEVCTL.{URRE,FERE,NFERE,CERE} to 0 in Root Complex mode - pci-bridge-emul.c: default bridge->conf.bridgectrl to PCI_BRIDGE_CTL_SERR (precondition for AER reporting) 2. Two debug hunks: dev_info() probes added during clearfog bring-up: - drivers/pci/pcie/aspm.c (6 lines): print upstream/downstream ASPM LNKCAP/LNKCTL on every pcie_aspm_cap_init() call - drivers/pci/pcie/portdrv.c (2 lines): print PCIe capabilities and init_service_irqs() return on every port device register Drop the debug hunks. They were ad-hoc bring-up traces from 2016, never useful in production, and just noise in dmesg on every boot. The aspm.c hunk also no longer applies cleanly to 6.18 (function moved from line 617 to 814) — fixing the offset just to keep dev_info() spam is not worthwhile. Functional hunks (pci-mvebu.c, pci-bridge-emul.c) keep the original intent: without them mvebu's hardware AER/PME interrupt masks stay off, so corrected/uncorrected PCIe errors and PME wake events go undetected on clearfog boards (NAS use case with NVMe/SATA cards in mPCIe slots). Mainline still does not have this plumbing — Marek Behún's 2021 rewrite around pci-bridge-emul did not close this gap. Assisted-by: Claude:claude-opus-4-7 --- .../10-mvebu-clearfog-pcie-updates.patch | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch b/patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch index 946a8211ee..483307bc56 100644 --- a/patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch +++ b/patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch @@ -7,9 +7,7 @@ Signed-off-by: Russell King --- drivers/pci/controller/pci-mvebu.c | 76 ++++++++++ drivers/pci/pci-bridge-emul.c | 2 + - drivers/pci/pcie/aspm.c | 6 + - drivers/pci/pcie/portdrv.c | 2 + - 4 files changed, 86 insertions(+) + 2 files changed, 78 insertions(+) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 111111111111..222222222222 100644 @@ -154,43 +152,6 @@ index 111111111111..222222222222 100644 bridge->pci_regs_behavior = kmemdup(pci_regs_behavior, sizeof(pci_regs_behavior), GFP_KERNEL); -diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c -index 111111111111..222222222222 100644 ---- a/drivers/pci/pcie/aspm.c -+++ b/drivers/pci/pcie/aspm.c -@@ -617,6 +617,12 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) - pcie_capability_read_dword(child, PCI_EXP_LNKCAP, &child_lnkcap); - pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &parent_lnkctl); - pcie_capability_read_word(child, PCI_EXP_LNKCTL, &child_lnkctl); -+dev_info(&parent->dev, "up support %x enabled %x\n", -+ (parent_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10, -+ !!(parent_lnkctl & PCI_EXP_LNKCTL_ASPMC)); -+dev_info(&parent->dev, "dn support %x enabled %x\n", -+ (child_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10, -+ !!(child_lnkctl & PCI_EXP_LNKCTL_ASPMC)); - - /* - * Setup L0s state -diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c -index 111111111111..222222222222 100644 ---- a/drivers/pci/pcie/portdrv.c -+++ b/drivers/pci/pcie/portdrv.c -@@ -335,6 +335,7 @@ static int pcie_port_device_register(struct pci_dev *dev) - - /* Get and check PCI Express port services */ - capabilities = get_port_device_capability(dev); -+dev_info(&dev->dev, "PCIe capabilities: 0x%x\n", capabilities); - if (!capabilities) - return 0; - -@@ -347,6 +348,7 @@ static int pcie_port_device_register(struct pci_dev *dev) - * if that is to be used. - */ - status = pcie_init_service_irqs(dev, irqs, capabilities); -+dev_info(&dev->dev, "init_service_irqs: %d\n", status); - if (status) { - capabilities &= PCIE_PORT_SERVICE_HP; - if (!capabilities) -- Armbian