Skip to content

Commit d79ad1f

Browse files
iavigorpecovnik
authored andcommitted
mvebu: clearfog PCIe patch — drop 2016 debug hunks (aspm.c, portdrv.c)
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
1 parent aa67b62 commit d79ad1f

1 file changed

Lines changed: 1 addition & 40 deletions

File tree

patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
77
---
88
drivers/pci/controller/pci-mvebu.c | 76 ++++++++++
99
drivers/pci/pci-bridge-emul.c | 2 +
10-
drivers/pci/pcie/aspm.c | 6 +
11-
drivers/pci/pcie/portdrv.c | 2 +
12-
4 files changed, 86 insertions(+)
10+
2 files changed, 78 insertions(+)
1311

1412
diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c
1513
index 111111111111..222222222222 100644
@@ -154,43 +152,6 @@ index 111111111111..222222222222 100644
154152
bridge->pci_regs_behavior = kmemdup(pci_regs_behavior,
155153
sizeof(pci_regs_behavior),
156154
GFP_KERNEL);
157-
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
158-
index 111111111111..222222222222 100644
159-
--- a/drivers/pci/pcie/aspm.c
160-
+++ b/drivers/pci/pcie/aspm.c
161-
@@ -617,6 +617,12 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
162-
pcie_capability_read_dword(child, PCI_EXP_LNKCAP, &child_lnkcap);
163-
pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &parent_lnkctl);
164-
pcie_capability_read_word(child, PCI_EXP_LNKCTL, &child_lnkctl);
165-
+dev_info(&parent->dev, "up support %x enabled %x\n",
166-
+ (parent_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10,
167-
+ !!(parent_lnkctl & PCI_EXP_LNKCTL_ASPMC));
168-
+dev_info(&parent->dev, "dn support %x enabled %x\n",
169-
+ (child_lnkcap & PCI_EXP_LNKCAP_ASPMS) >> 10,
170-
+ !!(child_lnkctl & PCI_EXP_LNKCTL_ASPMC));
171-
172-
/*
173-
* Setup L0s state
174-
diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c
175-
index 111111111111..222222222222 100644
176-
--- a/drivers/pci/pcie/portdrv.c
177-
+++ b/drivers/pci/pcie/portdrv.c
178-
@@ -335,6 +335,7 @@ static int pcie_port_device_register(struct pci_dev *dev)
179-
180-
/* Get and check PCI Express port services */
181-
capabilities = get_port_device_capability(dev);
182-
+dev_info(&dev->dev, "PCIe capabilities: 0x%x\n", capabilities);
183-
if (!capabilities)
184-
return 0;
185-
186-
@@ -347,6 +348,7 @@ static int pcie_port_device_register(struct pci_dev *dev)
187-
* if that is to be used.
188-
*/
189-
status = pcie_init_service_irqs(dev, irqs, capabilities);
190-
+dev_info(&dev->dev, "init_service_irqs: %d\n", status);
191-
if (status) {
192-
capabilities &= PCIE_PORT_SERVICE_HP;
193-
if (!capabilities)
194155
--
195156
Armbian
196157

0 commit comments

Comments
 (0)