Skip to content

Conversation

@androm3da
Copy link
Contributor

@androm3da androm3da commented Oct 29, 2025

This new test case improves upon existing tests by making stricter assertions. The test runs concurrent HW threads trying to access the lock and each recording the time stamps from when it was held, then compares the threads' results to make sure there's no intersection.

@androm3da androm3da force-pushed the bcain/lock_timer_test branch from b3eb49f to 452c5ef Compare November 1, 2025 15:01
@androm3da androm3da force-pushed the bcain/lock_timer_test branch from 452c5ef to 1c3a9f2 Compare November 3, 2025 22:08
*qtmr_cntp_ctl = 1;
}

void add_translation(void *va, void *pa, int cacheability);

Choose a reason for hiding this comment

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

Isn't this defined in hexagon_standalone.h?

Comment on lines 326 to 327
// Verify total interrupt counts are reasonable (greater than 10)
if (total_ints_by_tid <= 1) {

Choose a reason for hiding this comment

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

Should this be 10 instead of 1?

Comment on lines 333 to 334
if (total_ints_by_irq <= 1) {
printf("ERROR: Total interrupts by IRQ (%d) should be greater than 10\n",

Choose a reason for hiding this comment

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

Same here.

Comment on lines +292 to +290
printf("SWI instructions issued: %d\n", swi_issued_count);
printf("Expected total interrupts: %d\n", total_expected_interrupts);

Choose a reason for hiding this comment

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

Should we assert here?

return 0;
}

static bool verify_no_overlaps(void) {

Choose a reason for hiding this comment

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

Very nice! :)

static bool verify_no_overlaps(void) {
int total_records = global_round_counter;

assert(total_records > 100);

Choose a reason for hiding this comment

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

Nitpick: this will aways be > N_THREADS * 400, no? Is this assertion necessary?

This new test case improves upon existing tests by making stricter
assertions.  The test runs concurrent HW threads trying to access the lock
and each recording the time stamps from when it was held, then compares the
threads' results to make sure there's no intersection.

Signed-off-by: Brian Cain <[email protected]>
@androm3da androm3da force-pushed the bcain/lock_timer_test branch from b1d0466 to de7ace2 Compare November 5, 2025 14:32
@androm3da androm3da merged commit c47a427 into qualcomm:main Nov 5, 2025
7 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