Skip to content

mali-bifrost: unify to r54p2-01eac0, add MGLRU and PM clock fix#2409

Closed
aenertia wants to merge 1 commit intoROCKNIX:nextfrom
aenertia:nert-next/mali-kbase-unified
Closed

mali-bifrost: unify to r54p2-01eac0, add MGLRU and PM clock fix#2409
aenertia wants to merge 1 commit intoROCKNIX:nextfrom
aenertia:nert-next/mali-kbase-unified

Conversation

@aenertia
Copy link
Copy Markdown
Contributor

Unify all 10 device targets to the rocknix/mali_kbase r54p2-01eac0 source (b1405e8). RK3326 previously used r52p0 with device-specific patches for single-regulator and power-init — r54p2 handles both natively via dynamic regulator/clock discovery.

Changes:

  • Remove RK3326 r52p0 case and 6.12-LTS build patch (superseded)
  • Remove RK3326 001-single-regulator and 003-power-init patches
  • Add 001-fix-runtime-pm-clock-refcount.patch: fix race between genpd pm_clk framework and mali_kbase clock management. The original code used __clk_is_enabled() guards that race with pm_clk, corrupting ref-counts. Use ref-counted calls instead.
  • Add 002-mglru-madvise-native-gpu-buffers.patch: strip VM_IO and VM_PFNMAP from native GPU buffer CPU mappings so madvise and MGLRU page reclaim work correctly on memory-constrained devices.

Needs testing on more RK3326 and S992X to ensure it works 100% - clean on 6.18.13 and 6.12.61 LTS - RK3566 was primary target for testing.

@aenertia aenertia force-pushed the nert-next/mali-kbase-unified branch from c0ac4ff to c62989d Compare March 12, 2026 05:18
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 12, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
@aenertia
Copy link
Copy Markdown
Contributor Author

@porschemad911
Copy link
Copy Markdown
Contributor

porschemad911 commented Mar 12, 2026

Unify all 10 device targets ...

I'm a little confused. What 10 targets? Isn't it only RK3326, RK3566 and S922X that use the mali-bifrost package?

@aenertia
Copy link
Copy Markdown
Contributor Author

Unify all 10 device targets ...

I'm a little confused. What 10 targets? Isn't it only RK3326, RK3566 and S922X that use the mali-bifrost package?

Unify all 10 device targets ...

I'm a little confused. What 10 targets? Isn't it only RK3326, RK3566 and S922X that use the mali-bifrost package?

Bad LLM, it's counting all the permutations of the test target builds and kernel versions I ran the build and integration tests over.

Unify RK3326, RK3566, and S922X to the rocknix/mali_kbase r54p2-01eac0
source (b1405e8). RK3326 previously used r52p0 with device-specific
patches for single-regulator and power-init -- r54p2 handles both
natively via dynamic regulator/clock discovery.

Changes:
- Remove RK3326 r52p0 case and 6.12-LTS build patch (superseded)
- Remove RK3326 001-single-regulator and 003-power-init patches
- Add 001-fix-runtime-pm-clock-refcount.patch: fix race between
  genpd pm_clk framework and mali_kbase clock management. The
  original code used __clk_is_enabled() guards that race with
  pm_clk, corrupting ref-counts. Use ref-counted calls instead.
- Add 002-mglru-madvise-native-gpu-buffers.patch: strip VM_IO and
  VM_PFNMAP from native GPU buffer CPU mappings so madvise and
  MGLRU page reclaim work correctly on memory-constrained devices.
- Add 003-fix-mm_get_unmapped_area.patch: forward compat for
  mm_get_unmapped_area() signature change where mm_struct parameter
  was removed. r54p2 compat header only handles up to 6.10.

Build verified: RK3566 (6.18.13), S922X (6.18.13), RK3326 (6.12.61).
@aenertia aenertia force-pushed the nert-next/mali-kbase-unified branch from c62989d to 5557e33 Compare March 12, 2026 20:49
@aenertia
Copy link
Copy Markdown
Contributor Author

Cleaned up the commit message : "all 10 device targets" was wrong, mali-bifrost only applies to RK3326, RK3566, and S922X. Build verified on all three (6.12.61, 6.18.13, 6.18.13 respectively).

aenertia added a commit to aenertia/distribution that referenced this pull request Mar 13, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 15, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 15, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 15, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 18, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 18, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
aenertia added a commit to aenertia/distribution that referenced this pull request Mar 29, 2026
Move RK3566 from kernel 6.18.13 to 6.19.5.

Depends on: ROCKNIX#2409 (mali-bifrost unified + compat patches)
The mm_get_unmapped_area() signature changed in 6.19 — mali_kbase
will not compile without the compat patch from PR ROCKNIX#2409.
@sydarn
Copy link
Copy Markdown
Contributor

sydarn commented Mar 29, 2026

Thanks, I put these patches into the mali_kbase repo. Closing.

@sydarn sydarn closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants