Skip to content

Enable 1 GHz frequency for Panthor on mainline.#10035

Open
ginkage wants to merge 1 commit into
armbian:mainfrom
ginkage:main
Open

Enable 1 GHz frequency for Panthor on mainline.#10035
ginkage wants to merge 1 commit into
armbian:mainfrom
ginkage:main

Conversation

@ginkage

@ginkage ginkage commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This was long time coming, and Collabora isn't going to tackle this anytime soon, so we're just going to adopt @Kwiboo's patches (which were still in RFC state) from here: https://github.com/Kwiboo/linux-rockchip/commits/next-20250428-rk35xx-scmi-gpu-clk/ — but only for rk3588 for now, rebased and checked to compile and work.

Summary by CodeRabbit

  • New Features
    • Added support for an additional optional GPU bus clock on RK3588-based devices.
    • Added a new 200 MHz GPU operating point for improved low-frequency power scaling.
  • Bug Fixes
    • Improved GPU suspend/resume handling to correctly enable/disable the bus clock and apply required clock-rate changes during OPP transitions.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 608875c2-38b5-41ae-8033-43c2896ebc3d

📥 Commits

Reviewing files that changed from the base of the PR and between f9a4db4 and 088c400.

📒 Files selected for processing (2)
  • patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch
  • patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
🚧 Files skipped from review as they are similar to previous changes (2)
  • patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
  • patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch

📝 Walkthrough

Walkthrough

The patch updates RK3588 Panthor GPU bindings, adds 200 MHz OPP entries for RK3588 and RK3588J, wires devfreq clock-rate programming through an OPP callback, and adds optional bus-clock handling in Panthor resume and suspend paths.

Changes

RK3588 Panthor clock and OPP updates

Layer / File(s) Summary
GPU clock binding and node clocks
patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch, patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
The binding allows four clocks and the RK3588 GPU node adds a bus clock while changing assigned clock sources and rates.
200 MHz GPU OPP entries
patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch, patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
The RK3588 and RK3588J GPU OPP tables add a 200 MHz entry with opp-suspend and board-specific voltages.
OPP clock configuration callback
patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch, patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
Panthor devfreq registers a config_clks callback for OPP transitions and configures the OPP clock names to core.
Optional bus clock PM
patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch, patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch
Panthor device clock init, resume, and suspend now handle an optional bus clock, and the device clock struct stores it.

Sequence Diagram(s)

OPP transition clock programming

sequenceDiagram
  participant PanthorDevfreq
  participant PMOPP
  participant RuntimePM
  participant ClockFramework
  PanthorDevfreq->>PMOPP: devm_pm_opp_set_config(clk_names=["core"], config_clks)
  PMOPP->>PanthorDevfreq: call config_clks during OPP transition
  PanthorDevfreq->>RuntimePM: gate device while updating clocks
  PanthorDevfreq->>ClockFramework: clk_set_rate(core, target_rate)
  PanthorDevfreq->>RuntimePM: release gate after rate change
Loading

Optional bus clock resume and suspend

sequenceDiagram
  participant panthor_clk_init
  participant panthor_device_resume
  participant ClockFramework
  participant panthor_device_suspend
  panthor_clk_init->>ClockFramework: get optional bus clock
  panthor_device_resume->>ClockFramework: enable bus clock
  panthor_device_resume->>ClockFramework: enable core, stacks, and coregroup clocks
  ClockFramework-->>panthor_device_resume: report core enable failure
  panthor_device_resume->>ClockFramework: disable bus clock on unwind
  panthor_device_suspend->>ClockFramework: disable bus clock
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • amazingfate
  • igorpecovnik
  • rpardini
  • krachlatte

Poem

I hopped the clock lane, soft and light,
With bus clock purring through the night.
Two hundred MHz carrots gleam,
Panthor hums like a moonlit dream.
Thump, thump—GPU goes zoom! 🐇

🚥 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 matches the PR’s main goal of enabling Panthor 1 GHz support on mainline for RK3588.
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.

@github-actions github-actions Bot added 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jun 24, 2026
@ginkage ginkage force-pushed the main branch 2 times, most recently from ba0e5c3 to c8aaa60 Compare June 24, 2026 21:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch`:
- Around line 1-6: The patch header is using placeholder provenance, so update
the metadata in the archive patch header to reflect the real upstream
author/sign-off chain instead of John Doe. Replace the From/Date/Signed-off-by
fields with the correct upstream RFC provenance, and add a Link field if
available so the provenance is traceable. Make this change in the patch header
for rk3588-panthor-1GHz.patch, keeping the subject intact while fixing the
author/sign-off metadata.

In `@patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch`:
- Around line 1-6: The patch header still uses placeholder provenance, so update
the archive copy to match the real upstream author and signed-off-by chain
instead of John Doe. Edit the metadata in the Panthor 1 GHz patch header so the
From, Signed-off-by, and subject/provenance fields reflect the actual
upstream/RFC source, and make sure this 7.1 archive stays consistent with the
7.0 copy.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 46ea8296-a466-4b1b-88cf-5a5c9673a7dd

📥 Commits

Reviewing files that changed from the base of the PR and between 080b767 and c8aaa60.

📒 Files selected for processing (2)
  • patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch
  • patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch

Comment thread patch/kernel/archive/rockchip64-7.0/rk3588-panthor-1GHz.patch Outdated
Comment thread patch/kernel/archive/rockchip64-7.1/rk3588-panthor-1GHz.patch Outdated
@HeyMeco

HeyMeco commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks for raising this again

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Jun 24, 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 Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third 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