Skip to content

Kernel intpool h2 test fix#22

Open
andreykarpenko-qc wants to merge 3 commits into
masterfrom
kernel_intpool_h2_test_fix
Open

Kernel intpool h2 test fix#22
andreykarpenko-qc wants to merge 3 commits 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 4 times, most recently 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
  - 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 1a941fd to bb36e64 Compare May 18, 2026 12:12
  - 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>
…gon-hypervisor into kernel_intpool_h2_test_fix

Signed-off-by: Andrey Karpenko <andreyk@qti.qualcomm.com>
@andreykarpenko-qc andreykarpenko-qc force-pushed the kernel_intpool_h2_test_fix branch from 9dd42f8 to 4da3727 Compare May 19, 2026 06:23
Copy link
Copy Markdown
Contributor

@bryanb-h2 bryanb-h2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

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