Skip to content

iommu: apple-dart: Drain runtime PM before injecting test errors - #333

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
fix/apple-dart-test-gated-irq-race
Oct 16, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
fix/apple-dart-test-gated-irq-race

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

apple_dart_test_gated_irq failed intermittently: 4 of 32 isolated runs on 2 CPUs. The failure is a race in the test, not in the driver.

Cause

  • The test injects a runtime-PM error straight after a successful IRQ.
  • That IRQ's pm_runtime_put() queues asynchronous idle work.
  • A pending PM callback can then overwrite runtime_error after the injection, so the next IRQ runs its handler and the test's final expectation fails.
  • Holding power.lock during the injection does not drain a callback that has already dropped the lock.

Fix

Call pm_runtime_barrier(dart->dev) before injecting the error, so the failed-resume case reliably exercises the error path. The IRQ, register and usage-count assertions are unchanged.

This is test-only, with no runtime change: drivers/iommu/apple-dart-test.c, +3 lines.

Testing

🤖 Generated with Claude Code

The gated-IRQ test injects a runtime-PM error after a successful IRQ,
whose pm_runtime_put() queues asynchronous idle work. A pending PM
callback can overwrite runtime_error after the injection, allowing the
next IRQ to run its handler and making the test fail intermittently.
Holding power.lock during injection does not wait for that callback.

Drain runtime-PM work before injecting the error so that the failed-resume
case reliably exercises the error path. Keep the IRQ, register and usage
count assertions.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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