Skip to content

Interrupts: replace fixed sleep with reusable counter polling#488

Merged
vnarapar merged 2 commits into
qualcomm-linux:mainfrom
smuppand:kernel
Jun 10, 2026
Merged

Interrupts: replace fixed sleep with reusable counter polling#488
vnarapar merged 2 commits into
qualcomm-linux:mainfrom
smuppand:kernel

Conversation

@smuppand

Copy link
Copy Markdown
Contributor

Replace the hardcoded 120-second wait in the Interrupts test with a reusable poll-until-progress flow.

The test still validates the same functional goal: arch_timer interrupt counters must increment on all CPUs. Instead of always sleeping for 120 seconds, it now polls the per-CPU interrupt counters and completes as soon as all counters advance.

Why the changes required?

The previous test always waited 120 seconds before comparing timer counters. This is time-consuming in LAVA jobs, especially because the counters usually increment within a few seconds.

The new polling approach reduces LAVA runtime while keeping a safe timeout for real failures.

Validation results with the patch
https://lava.infra.foundries.io/scheduler/job/255924

smuppand added 2 commits June 10, 2026 13:47
Move generic interrupt counter validation into functestlib.sh so tests can
reuse common /proc/interrupts parsing and polling logic.

Add helpers to:
- compare per-CPU interrupt counters between two interrupt lines
- poll a named interrupt until all CPU counters increment
- expose initial/final interrupt lines and parsed counter values to callers
  for test-specific reporting

This supports replacing fixed sleeps in interrupt-based tests with a
poll-until-progress flow, reducing LAVA runtime while still failing safely
when counters do not advance within the configured timeout.

Also add local ShellCheck SC2034 suppressions for intentionally exported
helper result variables consumed by caller scripts.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
The Interrupts test waits for a hardcoded 120 seconds before comparing
arch_timer interrupt counters. This is unnecessarily expensive in LAVA,
especially when the counters usually increment within a few seconds.

Replace the fixed sleep with a poll-until-progress loop. The test now
records the initial arch_timer counters and polls until all per-CPU
counters increment, with configurable timeout and poll interval.

Defaults:
- INTERRUPTS_WAIT_TIMEOUT_S=30
- INTERRUPTS_POLL_INTERVAL_S=2

This keeps the same validation goal while reducing LAVA runtime and still
failing safely when timer counters do not progress.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@smuppand smuppand requested review from bhargav0610 and vnarapar June 10, 2026 08:33
@vnarapar vnarapar merged commit c10a2ce into qualcomm-linux:main Jun 10, 2026
12 checks passed
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