Lines Matching refs:state

338 	struct hash_irq_test_state *state =  in hash_irq_test_timer_func()  local
339 container_of(timer, typeof(*state), timer); in hash_irq_test_timer_func()
342 state->hardirq_func_calls++; in hash_irq_test_timer_func()
344 if (!state->func(state->test_specific_state)) in hash_irq_test_timer_func()
345 state->hardirq_func_reported_failure = true; in hash_irq_test_timer_func()
347 hrtimer_forward_now(&state->timer, IRQ_TEST_HRTIMER_INTERVAL); in hash_irq_test_timer_func()
348 queue_work(system_bh_wq, &state->bh_work); in hash_irq_test_timer_func()
354 struct hash_irq_test_state *state = in hash_irq_test_bh_work_func() local
355 container_of(work, typeof(*state), bh_work); in hash_irq_test_bh_work_func()
358 state->softirq_func_calls++; in hash_irq_test_bh_work_func()
360 if (!state->func(state->test_specific_state)) in hash_irq_test_bh_work_func()
361 state->softirq_func_reported_failure = true; in hash_irq_test_bh_work_func()
389 struct hash_irq_test_state state = { in run_irq_test() local
399 hrtimer_setup_on_stack(&state.timer, hash_irq_test_timer_func, in run_irq_test()
401 INIT_WORK_ONSTACK(&state.bh_work, hash_irq_test_bh_work_func); in run_irq_test()
405 hrtimer_start(&state.timer, IRQ_TEST_HRTIMER_INTERVAL, in run_irq_test()
410 state.task_func_reported_failure = true; in run_irq_test()
414 hrtimer_cancel(&state.timer); in run_irq_test()
415 flush_work(&state.bh_work); in run_irq_test()
418 KUNIT_EXPECT_GT_MSG(test, state.hardirq_func_calls, 0, in run_irq_test()
420 KUNIT_EXPECT_GT_MSG(test, state.softirq_func_calls, 0, in run_irq_test()
425 test, state.task_func_reported_failure, in run_irq_test()
428 test, state.hardirq_func_reported_failure, in run_irq_test()
431 test, state.softirq_func_reported_failure, in run_irq_test()
450 struct hash_irq_test1_state *state = state_; in hash_irq_test1_func() local
451 u32 i = (u32)atomic_inc_return(&state->seqno) % IRQ_TEST_NUM_BUFFERS; in hash_irq_test1_func()
455 return memcmp(actual_hash, state->expected_hashes[i], HASH_SIZE) == 0; in hash_irq_test1_func()
464 struct hash_irq_test1_state state = {}; in test_hash_interrupt_context_1() local
470 state.expected_hashes[i]); in test_hash_interrupt_context_1()
472 run_irq_test(test, hash_irq_test1_func, 100000, &state); in test_hash_interrupt_context_1()
491 struct hash_irq_test2_state *state = state_; in hash_irq_test2_func() local
495 for (ctx = &state->ctxs[0]; ctx < &state->ctxs[ARRAY_SIZE(state->ctxs)]; in hash_irq_test2_func()
500 if (WARN_ON_ONCE(ctx == &state->ctxs[ARRAY_SIZE(state->ctxs)])) { in hash_irq_test2_func()
513 } else if (ctx->step < state->num_steps - 1) { in hash_irq_test2_func()
516 state->update_lens[ctx->step - 1]); in hash_irq_test2_func()
517 ctx->offset += state->update_lens[ctx->step - 1]; in hash_irq_test2_func()
526 if (memcmp(actual_hash, state->expected_hash, HASH_SIZE) != 0) in hash_irq_test2_func()
544 struct hash_irq_test2_state *state; in test_hash_interrupt_context_2() local
547 state = kunit_kzalloc(test, sizeof(*state), GFP_KERNEL); in test_hash_interrupt_context_2()
548 KUNIT_ASSERT_NOT_NULL(test, state); in test_hash_interrupt_context_2()
551 HASH(test_buf, TEST_BUF_LEN, state->expected_hash); in test_hash_interrupt_context_2()
558 for (state->num_steps = 0; in test_hash_interrupt_context_2()
559 state->num_steps < ARRAY_SIZE(state->update_lens) - 1 && remaining; in test_hash_interrupt_context_2()
560 state->num_steps++) { in test_hash_interrupt_context_2()
561 state->update_lens[state->num_steps] = in test_hash_interrupt_context_2()
563 remaining -= state->update_lens[state->num_steps]; in test_hash_interrupt_context_2()
566 state->update_lens[state->num_steps++] = remaining; in test_hash_interrupt_context_2()
567 state->num_steps += 2; /* for init and final */ in test_hash_interrupt_context_2()
569 run_irq_test(test, hash_irq_test2_func, 250000, state); in test_hash_interrupt_context_2()