Skip to content

Kernel intpool h2 test fix#22

Open
andreykarpenko-qc wants to merge 1 commit into
masterfrom
kernel_intpool_h2_test_fix
Open

Kernel intpool h2 test fix#22
andreykarpenko-qc wants to merge 1 commit into
masterfrom
kernel_intpool_h2_test_fix

Conversation

@andreykarpenko-qc
Copy link
Copy Markdown
Contributor

@andreykarpenko-qc andreykarpenko-qc commented May 12, 2026

intpool/test_h2: fix reliability and re-enable in testlists

  • Constrain interrupt range to INT_START..INT_START+NUM_INT (16 ints)
    and compute expected bitmask via calc_expected_mask() instead of
    hardcoding ~0, fixing spurious failures from out-of-range interrupts.
  • Mark stop_threads as volatile int and seen_0/seen_1 as volatile
    unsigned int to prevent the compiler from eliding cross-thread reads.
  • Add graceful shutdown: set stop_threads flag, re-enable intpool and
    raise INT_START twice to unblock worker threads, then pthread_join
    all three threads (timeout, worker0, worker1).
  • Timeout and worker threads check stop_threads and exit cleanly
    instead of spinning forever or calling FAIL().
  • Guard pthread_detach calls under USE_DETACHED_THREADS (disabled by
    default) to document the alternative threading model.
  • Use h2_atomic_swap32() for atomic seen = 0 assignments.
  • Re-enable kernel/event/intpool/test_h2 in testlist.v61 and testlist.v81.

Signed-off-by: Andrey Karpenko andreyk@qti.qualcomm.com

@andreykarpenko-qc andreykarpenko-qc force-pushed the kernel_intpool_h2_test_fix branch 3 times, most recently from c1ff3d0 to 96c6567 Compare May 14, 2026 09:50
  - Constrain interrupt range to INT_START..INT_START+NUM_INT (16 ints)
    and compute expected bitmask via calc_expected_mask() instead of
    hardcoding ~0, fixing spurious failures from out-of-range interrupts.
  - Mark stop_threads as volatile int and seen_0/seen_1 as volatile
    unsigned int to prevent the compiler from eliding cross-thread reads.
  - Add graceful shutdown: set stop_threads flag, re-enable intpool and
    raise INT_START twice to unblock worker threads, then pthread_join
    all three threads (timeout, worker0, worker1).
  - Timeout and worker threads check stop_threads and exit cleanly
    instead of spinning forever or calling FAIL().
  - Guard pthread_detach calls under USE_DETACHED_THREADS (disabled by
    default) to document the alternative threading model.
  - Use h2_atomic_swap32() for atomic seen = 0 assignments.
  - Re-enable kernel/event/intpool/test_h2 in testlist.v61 and testlist.v81.

  Signed-off-by: Andrey Karpenko <andreyk@qti.qualcomm.com>
@andreykarpenko-qc andreykarpenko-qc force-pushed the kernel_intpool_h2_test_fix branch from 96c6567 to 1a941fd Compare May 14, 2026 10:00
@andreykarpenko-qc andreykarpenko-qc marked this pull request as ready for review May 14, 2026 10:10
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