Skip to content

pmdomain: apple: pmp-report: initialize the report lock - #56

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:aurora-wipfrom
oliverlukschander:fix/pmp-report-lock-init
Sep 29, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:aurora-wipfrom
oliverlukschander:fix/pmp-report-lock-init

Conversation

@oliverlukschander

Copy link
Copy Markdown
Contributor

apple_pmp_report_probe() never initializes rep->lock. The first apple_pmp_report_set_state() from an entry's probe takes the uninitialized spinlock. With PROVE_LOCKING, lockdep reports a non-static key and switches itself off for the rest of the boot.

One line: spin_lock_init(&rep->lock) before of_platform_populate() creates the entries.

Found while running a lockdep kernel for #8 on j416s (M2 Pro). With the fix, the report is gone and lockdep stays enabled. Builds with W=1; checkpatch only flags the trailer form.

🤖 Generated with Claude Code

apple_pmp_report_probe() allocates the report with devm_kzalloc() but
never initializes rep->lock. The first apple_pmp_report_set_state() from
a child entry's probe then takes an uninitialized spinlock; with lockdep
this is reported as a non-static key and lockdep turns itself off for the
rest of the boot:

  INFO: trying to register non-static key.
  ...
   _raw_spin_lock_irqsave
   apple_pmp_report_set_state
   apple_pmp_report_entry_probe

Initialize the lock before of_platform_populate() creates the entries.

Tested on j416s (M2 Pro) with PROVE_LOCKING: the report is gone and
lockdep stays enabled.

Fixes: e5f8c27 ("pmdomain: apple: Add PMP reporting interface")
Signed-off-by: Oliver Lukschander <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@DjDeveloperr DjDeveloperr 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.

LGTM, thanks!

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.

2 participants