Skip to content

patch/sunxi-6.12: drop two Rockchip SPI patches (not applicable to sunxi)#9827

Merged
igorpecovnik merged 2 commits into
mainfrom
drop-irrelevant-rockchip-spi-patches-from-sunxi-6.12
May 15, 2026
Merged

patch/sunxi-6.12: drop two Rockchip SPI patches (not applicable to sunxi)#9827
igorpecovnik merged 2 commits into
mainfrom
drop-irrelevant-rockchip-spi-patches-from-sunxi-6.12

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented May 15, 2026

What broke

armbian/os nightly run 25864949324 failed on both kernel-sunxi-6.12 jobs:

Both fail identically:

Problem with ->patches.megous/spi-rockchip-Fix-runtime-PM-and-other-issues(:1) ... Failed to apply patch
Problem with ->patches.megous/spi-fixes(:1)                                 ... Failed to apply patch
Failed to apply 2 patches: ...
Summary: kernel patching: 458 total; 456 applied; 2 failed_apply
Exception: Failed to apply 2 patches.

Hunks #7, #8 of the first patch and #3, #4, #5 of the second fail at lines 933, 958, 937, 948, 964 of drivers/spi/spi-rockchip.c::rockchip_spi_probe() — the kernel's rockchip_spi_probe() shape has drifted since the patches were last refreshed.

Why dropping is the right fix (vs rebasing)

Both patches target drivers/spi/spi-rockchip.c — Rockchip-only driver code that's never executed on Allwinner (sunxi) SoCs. They're residue of megous' multi-platform patchset.

Three independent reasons:

  1. No functional value here. sunxi kernel runs on Allwinner hardware; the Rockchip SPI driver doesn't even probe at runtime. Improving its runtime-PM semantics is dead code on sunxi.
  2. Don't apply. Already broken — kernel sources drifted upstream.
  3. No duplicates elsewhere. find patch/kernel/archive -name 'spi-rockchip-Fix-runtime-PM-and-other-issues.patch' finds only the sunxi-6.12 copy. Removing here doesn't deprive Rockchip kernel trees (rk35xx-*, rockchip64-*) which don't carry these patches at all.

Rebasing them would only benefit Rockchip kernels — and they don't even include the patches.

Test plan

  • Rerun the failed cron pipeline on armbian/os after this merges — kernel-sunxi-legacy and kernel-sunxi64-legacy should reach the build phase.
  • Spot-check that the kernel still builds with the remaining patches (the 16 needs_rebase patches in the same patchset already apply with offsets, so the kernel produces; only these two hard-failed before).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed runtime power management and clock state handling for Rockchip SPI to prevent power-related failures.
    • Improved error handling during device initialization for more reliable cleanup on failure.
  • Performance

    • Optimized clock enable/disable sequencing for SPI devices, reducing power use and improving efficiency.
  • Chores

    • Cleaned up the applied patch series to remove outdated entries.

…nxi)

Both patches under patches.megous/ touch drivers/spi/spi-rockchip.c
— Rockchip-only code that's never executed on Allwinner SoCs. They
were carried into the sunxi patchset as residue of megous' multi-
platform series and don't apply to current 6.12 sources (kernel
rockchip_spi_probe() drifted, hunks fail at lines 933/958/937/948/964).

Build failure visible in armbian/os run 25864949324 across both jobs
that build linux-kernel-sunxi-6.12:
  - kernel-sunxi64-legacy (job 76027906041, arm64)
  - kernel-sunxi-legacy   (job 76027905949, armhf)
Both fail identically:
  Failed to apply 2 patches:
    ->patches.megous/spi-rockchip-Fix-runtime-PM-and-other-issues
    ->patches.megous/spi-fixes
  Summary: kernel patching: 458 total; 456 applied; 2 failed_apply

Dropping them is correct in three independent ways:
  - they target a Rockchip SoC driver that doesn't run on sunxi,
  - they don't apply to current sources (would need a rebase that
    would only benefit Rockchip kernels, not us),
  - the rk35xx-* kernel trees don't carry copies, so removing here
    doesn't deprive any downstream of them.

The other 16 'needs_rebase' patches in the same patchset still apply
with offsets, so the kernel still builds; only these two hard-fails.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 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: f5bb53e9-c9ef-4b4e-b252-f289ece93957

📥 Commits

Reviewing files that changed from the base of the PR and between 1bac94f and 4724606.

📒 Files selected for processing (2)
  • patch/kernel/archive/sunxi-6.12/series.conf
  • patch/kernel/archive/sunxi-6.12/series.megous
💤 Files with no reviewable changes (2)
  • patch/kernel/archive/sunxi-6.12/series.megous
  • patch/kernel/archive/sunxi-6.12/series.conf

📝 Walkthrough

Walkthrough

Removes three patch entries from the series and applies two Rockchip SPI driver patches that refactor clock handling and runtime PM: introduce a tracked clk_enabled, centralize clock enable/disable, convert to devm-managed allocations and PM, simplify error paths, and update probe/remove and PM callbacks.

Changes

Rockchip SPI driver runtime-PM and clock refactor

Layer / File(s) Summary
Clock state and helper
patch/kernel/archive/sunxi-6.12/patches.megous/spi-rockchip-Fix-runtime-PM-and-other-issues.patch, patch/kernel/archive/sunxi-6.12/patches.megous/spi-fixes.patch
Adds/uses clk_enabled boolean and implements rockchip_spi_enable_clocks() to enable/disable apb_pclk and spiclk with idempotency and unified error handling.
Probe: managed allocations & PM enablement
.../spi-rockchip-Fix-runtime-PM-and-other-issues.patch
Switches allocations to devm (e.g., devm_spi_alloc_*), moves runtime PM enablement to a devm-managed call (devm_pm_runtime_enable()), and updates probe failure paths to return/PTR_ERR rather than manual unwind.
PM callbacks & remove path
.../spi-rockchip-Fix-runtime-PM-and-other-issues.patch, .../spi-fixes.patch
Updates runtime_suspend/runtime_resume and remove to call the centralized clock helper instead of direct clk_prepare_enable()/clk_disable_unprepare(); removes explicit pm_runtime get/sync and manual autosuspend handling relying on devm-managed runtime-PM.
Small cleanup & error-path adjustments
.../spi-rockchip-Fix-runtime-PM-and-other-issues.patch
Removes redundant autosuspend/disable calls where devm-managed PM is used and simplifies error handling around controller registration (calls pm_runtime_dont_use_autosuspend()/pm_runtime_disable() on failures).

Patch-series (metadata) update

Layer / File(s) Summary
Series removals
patch/kernel/archive/sunxi-6.12/series.conf, patch/kernel/archive/sunxi-6.12/series.megous
Removed three patch entries from the series: spi-rockchip-Fix-runtime-PM-and-other-issues.patch, spi-fixes.patch, and usb-gadget-Fix-dangling-pointer-in-netdev-private-data.patch, shifting subsequent entries upward.

Sequence Diagram

sequenceDiagram
  participant Driver as "SPI Driver" rect rgba(100,150,240,0.5)
  participant Clk as "Clock framework" rect rgba(120,200,100,0.5)
  participant PM as "Runtime PM core" rect rgba(240,160,80,0.5)
  participant Dev as "Device" rect rgba(200,120,180,0.5)

  Dev->>Driver: probe()
  Driver->>PM: devm_pm_runtime_enable()
  Driver->>Clk: rockchip_spi_enable_clocks(enable)
  Clk-->>Driver: ok / error
  PM->>Driver: runtime_resume()
  Driver->>Clk: rockchip_spi_enable_clocks(enable)
  Driver->>PM: runtime_suspend()
  Driver->>Clk: rockchip_spi_enable_clocks(disable)
  Dev->>Driver: remove()
  Driver->>Clk: rockchip_spi_enable_clocks(disable)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • chraac
  • teknoid
  • PanderMusubi

Poem

🐰
I nudge the clocks and tidy up the threads,
devm cradles wake and so the runtime treads.
A hop, a patch, fewer lines in sight —
the SPI hums softly through the night. 🥕✨

🚥 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 and concisely describes the main change: removing two Rockchip SPI patches from the sunxi-6.12 patchset. It clearly explains what is being done and why (not applicable to sunxi).
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
  • Commit unit tests in branch drop-irrelevant-rockchip-spi-patches-from-sunxi-6.12

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 size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels May 15, 2026
Companion to the previous commit. series.conf and series.megous
each listed the two .patch files we just removed; if anything ever
applied patches via the series.* path (instead of the directory
walk), it would hit 'patch file not found'. Strip the lines so both
code paths agree.
@igorpecovnik igorpecovnik added the Build Executing build train (permission needed) label May 15, 2026
@igorpecovnik igorpecovnik marked this pull request as draft May 15, 2026 05:56
@igorpecovnik igorpecovnik marked this pull request as ready for review May 15, 2026 05:56
Copy link
Copy Markdown
Member

@EvilOlaf EvilOlaf left a comment

Choose a reason for hiding this comment

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

yes, drop

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label May 15, 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 May 15, 2026
@igorpecovnik igorpecovnik merged commit 61ba67f into main May 15, 2026
14 checks passed
@igorpecovnik igorpecovnik deleted the drop-irrelevant-rockchip-spi-patches-from-sunxi-6.12 branch May 15, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Build Executing build train (permission needed) 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.

2 participants