Skip to content

mvebu: edge → 6.18 LTS family-wide + restore 4 patches lost in #6135#9709

Open
iav wants to merge 3 commits intoarmbian:mainfrom
iav:mvebu/edge-kernel-6.18-family-9694
Open

mvebu: edge → 6.18 LTS family-wide + restore 4 patches lost in #6135#9709
iav wants to merge 3 commits intoarmbian:mainfrom
iav:mvebu/edge-kernel-6.18-family-9694

Conversation

@iav
Copy link
Copy Markdown
Contributor

@iav iav commented Apr 22, 2026

Followup to #9694.

This PR bumps the entire mvebu edge branch to 6.18 LTS family-wide.

Restored patches

When bumping the version (commit 1), I checked that the patches in mvebu-6.18/ matched what was previously in mvebu-6.6/. It turned out that in commit f852beca0 (PR #6135, "move to archive & cleanup", January 2024), when the mvebu-6.6/ directory was created, 4 clearfog-family patches were silently dropped:

File What it does Origin
0001-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch cpuidle return code fix mvebu-5.10 → … → mvebu-6.5
10-mvebu-clearfog-pcie-updates.patch AER/PME plumbing for the Marvell PCIe controller same
11-implement-slot-capabilities-SSPL.patch PCIe Slot Capabilities + SSPL emulation same
20-pcie-bridge-emul.patch extensions for pci_bridge_emul same

Neither the commit message, nor the PR #6135 description, nor any of its comments (issue + review) mention dropping these patches — they appear to have fallen out by oversight during a manual cleanup. Restoring them.

Edit applied to one of the patches (commit 2)

10-mvebu-clearfog-pcie-updates.patch by Russell King (Nov 2016) bundled together two distinct kinds of changes:

  1. Functional part (kept): mvebu_pcie_handle_irq_change() syncs the hardware PCIE_INT_UNMASK_OFF mask of the mvebu PCIe controller with the emulated PCI bridge config (AER bits + PME wake) on writes to PCI_COMMAND.SERR, BRIDGE_CTL.SERR, DEVCTL.{CERE,NFERE,FERE,URRE}, RTCTL.{SECEE,SENFEE,SEFEE,PMEIE}. Plus the Armada 370 erratum (clamping DEVCTL bits in RC mode) and a default bridge->conf.bridgectrl = PCI_BRIDGE_CTL_SERR in pci-bridge-emul.c.
  2. Debug part (removed): 8 lines of dev_info(...) calls in drivers/pci/pcie/aspm.c and drivers/pci/pcie/portdrv.c — bring-up traces from 2016 that just spam dmesg on every boot. The aspm.c hunk also no longer applies cleanly to 6.18 (function moved from line 617 to 814) — not worth fixing the offset just to keep that spam.

Without 10-mvebu-clearfog-pcie-updates.patch, on the mainline 6.18 pci-mvebu driver the hardware PCIe error/PME interrupt masks remain disabled — corrected/uncorrected PCIe errors and PME wake events on clearfog boards do not work. This is particularly important for NAS use cases (NVMe/SATA cards in the mPCIe slot). Mainline still hasn't closed this gap (Marek Behún's 2021 rewrite around pci-bridge-emul did not restore this functionality).

Affected boards

clearfogpro, helios4, clearfogbase (csc).

Verification

Configuration Result
./compile.sh kernel ARTIFACT_IGNORE_CACHE=yes BOARD=clearfogpro BRANCH=edge KERNEL_BTF=yes SHARE_LOG=yes USE_CCACHE=yes OK — 10:44 min, 6.18.23-mvebu
./compile.sh build BOARD=clearfogpro BRANCH=edge RELEASE=trixie BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=no KERNEL_BTF=yes USE_CCACHE=yes OK — 18:18 min, image built

Summary by CodeRabbit

  • New Features

    • PCIe slot capabilities exposed on mvebu boards for improved device compatibility.
  • Bug Fixes

    • More robust CPU idle handling to avoid incorrect deeper-sleep behavior.
    • PCIe interrupt masking/forwarding behavior refined to update only when relevant controls change.
  • Chores

    • Edge branch kernel default set to 6.18 for all mvebu boards.

iav added 2 commits April 22, 2026 05:38
armbian#9694 split mvebu edge into per-board kernel versions: helios4 on 6.18 LTS,
clearfogpro/clearfogbase on 6.15. Both share LINUXCONFIG=linux-mvebu-edge
and ARMBIAN_KERNEL_DEB_NAME=mvebu-edge, so building both produced
"Duplicate LINUXCONFIG's found!" — two source trees compete for the same
package name.

Per @igorpecovnik in armbian#9694: "kernel can't be per board". Bump the rest of
the mvebu (armhf) family to 6.18 too. mvebu64 and other families are
untouched.

The mvebu-6.18 patch directory is already in the tree from armbian#9694, so the
remaining boards (clearfogpro, clearfogbase) get the same patch set.
Affected boards: clearfogpro, helios4, clearfogbase (csc). espressobin
and macchiatobin (eos) are mvebu64, not affected.

I do not have non-helios4 mvebu hardware; build verified, runtime not.

Assisted-by: Claude:claude-opus-4-7
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
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27f1bae7-c6e2-4229-82f0-90cdba85aabd

📥 Commits

Reviewing files that changed from the base of the PR and between 70fc78c and 3226da0.

📒 Files selected for processing (1)
  • patch/kernel/archive/mvebu-6.18/11-mvebu-pcie-aer-fixes.patch

📝 Walkthrough

Walkthrough

This PR unconditionally sets KERNEL_MAJOR_MINOR="6.18" for all mvebu boards on the edge branch and adds multiple mvebu kernel patches: cpuidle return handling, ClearFog PCIe IRQ masking/forwarding, PCIe Slot Capabilities (SSPL) support, and PCIe bridge emulation dispatch adjustments.

Changes

Cohort / File(s) Summary
Configuration
config/sources/families/mvebu.conf
Remove BOARD-specific branch logic and set KERNEL_MAJOR_MINOR="6.18" unconditionally for edge.
Kernel patch: cpuidle
patch/kernel/archive/mvebu-6.18/0001-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
Treat failed entry into deeper cpuidle state as non-error by returning 0 after cpu_pm_exit() when ret is non-zero.
Kernel patches: PCIe controller & AER
patch/kernel/archive/mvebu-6.18/10-mvebu-clearfog-pcie-updates.patch, patch/kernel/archive/mvebu-6.18/11-mvebu-pcie-aer-fixes.patch
Add mvebu_pcie_handle_irq_change() to recalc/write PCIe interrupt mask; wire recalculation into various PCI config write paths; restrict AER-triggered recalcs to relevant DEVCTL/PMEIE changes.
Kernel patch: Slot Capabilities (SSPL)
patch/kernel/archive/mvebu-6.18/11-implement-slot-capabilities-SSPL.patch
Map PCI_EXP_SLTCAP reads/writes to underlying SSPL hardware register and introduce PCIE_SSPL_MSGEN handling.
Kernel patch: bridge emulation
patch/kernel/archive/mvebu-6.18/20-pcie-bridge-emul.patch, drivers/pci/pci-bridge-emul.c (changes)
Reorder/confine PCIe capability handling: early-exit when !bridge->has_pcie, separate PCIe capability range checks, and initialize bridgectrl to PCI_BRIDGE_CTL_SERR in emulation setup.

Sequence Diagram(s)

sequenceDiagram
    participant Guest as PCI config writer
    participant BridgeEmul as pci-bridge-emul
    participant PCIeCtrl as mvebu PCIe controller
    participant HW as PCIe hardware regs

    Guest->>BridgeEmul: PCI config write (DEVCTL/RTCTL/SLTCAP/BRIDGECtl)
    BridgeEmul->>PCIeCtrl: forward relevant PCIe writes (if has_pcie)
    PCIeCtrl->>PCIeCtrl: compute new DEVCTL/RTCTL/SLTCAP values
    PCIeCtrl->>PCIeCtrl: determine aer_changed / pme change
    alt AER/PME change relevant
        PCIeCtrl->>HW: update interrupt unmask registers via mvebu_pcie_handle_irq_change()
    end
    PCIeCtrl->>HW: write SSPL register on SLTCAP writes
    PCIeCtrl-->>BridgeEmul: return success
    BridgeEmul-->>Guest: config write acknowledged
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • igorpecovnik
  • Heisath
  • prahal
  • aprayoga
  • EvilOlaf

Poem

🐰 A kernel hop to 6.18 we go,
Masks and slots now ebb and flow—
When deep-sleep stumbles, wake with grace,
Emulated bridges find their place. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: bumping mvebu edge branch to kernel 6.18 LTS and restoring four lost patches from PR #6135.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more labels Apr 22, 2026
Compute the relevant PCI_EXP_DEVCTL change mask before clearing the
RC-mode forbidden bits from the local write value. Otherwise a change in
DEVCTL.{CERE,NFERE,FERE} may be missed and the corresponding IRQ mask
update deferred until some later config-space write.

Also restrict the PCI_EXP_RTCTL-triggered IRQ mask update to PMEIE.
mvebu_pcie_handle_irq_change() only uses rootctl.PMEIE, so reacting to
SECEE/SENFEE/SEFEE changes only reruns the helper without affecting the
hardware interrupt mask.

Assisted-by: Claude:claude-opus-4-7
@Heisath
Copy link
Copy Markdown
Member

Heisath commented Apr 22, 2026

Thanks for bumping all of edge. If I find the time, I will build and test the clearfog stuff on actual HW.
But if it builds it is probably good enough for edge and given the age of the boards (and active support)

Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say we merge. @Heisath check when you can.

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot removed the Needs review Seeking for review label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

3 participants