Skip to content

soc: apple: clpc: name the vote reasons and share the sample work - #1555

Merged
DjDeveloperr merged 3 commits into
integration/aurorafrom
djdev/clpc-reason-names
Nov 11, 2026
Merged

DjDeveloperr merged 3 commits into
integration/aurorafrom
djdev/clpc-reason-names

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

No functional change: naming and one shared function, to make the CLPC easier to read.

  • The reasons the CLPC records for its last vote (shown in debugfs as reason_bits) get names instead of bare 1, 2, 4, 8, 16 and 32. The debugfs output is unchanged.
  • apple_clpc_work() and apple_clpc_idle_work() were identical except for the work item they start from. Both now call one locked apple_clpc_run().

Validation (J714sAP, 2026-11-11)

🤖 Generated with Claude Code

No functional change: the reasons debugfs reports for the last vote get
names instead of bare bit values, and the two work functions, identical
but for the work item they start from, call one locked sample.

Signed-off-by: Diljit Singh <[email protected]>
The CLPC demand tests build apple_clpc_sample() from clpc.c over their
own prelude, which has no APPLE_CLPC_REASON_* names now that the sample
uses them, so the host test no longer compiled. Take the names from
clpc.c as the test does APPLE_CLPC_GPU_DENSE_SAMPLES, and give the
prelude BIT(). The reason values are unchanged.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Host tests failed on code, not the outage: tools/asahi/clpc-gpu-demand-tests.py builds apple_clpc_sample() from clpc.c over its own prelude, which didn't have the new APPLE_CLPC_REASON_* names ("'APPLE_CLPC_REASON_CPU' undeclared"). I pushed 4699f56, which takes the names from clpc.c the same way the test takes APPLE_CLPC_GPU_DENSE_SAMPLES and adds BIT() to the prelude. The reason values are unchanged. This PR and #1556 merge into integration/aurora without conflicts in either order.

The sample now passes reason & APPLE_CLPC_REASON_ANE to
apple_clpc_ane_cluster(); the omit-ane-cluster mutation still looked for
reason & 32 and would no longer change the code, which the test rejects
as a stale mutation.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr merged commit 1d1b953 into integration/aurora Nov 11, 2026
4 checks passed
@RyanTheTide
RyanTheTide deleted the djdev/clpc-reason-names branch November 16, 2026 05:02
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.

1 participant