Lines Matching refs:ars_state
208 struct ars_state { struct
212 } ars_state; member
532 static void post_ars_status(struct ars_state *ars_state, in post_ars_status() argument
541 ars_state->deadline = jiffies + 1*HZ; in post_ars_status()
542 ars_status = ars_state->ars_status; in post_ars_status()
572 struct ars_state *ars_state, in nfit_test_cmd_ars_start() argument
579 spin_lock(&ars_state->lock); in nfit_test_cmd_ars_start()
580 if (time_before(jiffies, ars_state->deadline)) { in nfit_test_cmd_ars_start()
586 post_ars_status(ars_state, &t->badrange, ars_start->address, in nfit_test_cmd_ars_start()
590 spin_unlock(&ars_state->lock); in nfit_test_cmd_ars_start()
595 static int nfit_test_cmd_ars_status(struct ars_state *ars_state, in nfit_test_cmd_ars_status() argument
599 if (buf_len < ars_state->ars_status->out_length) in nfit_test_cmd_ars_status()
602 spin_lock(&ars_state->lock); in nfit_test_cmd_ars_status()
603 if (time_before(jiffies, ars_state->deadline)) { in nfit_test_cmd_ars_status()
609 memcpy(ars_status, ars_state->ars_status, in nfit_test_cmd_ars_status()
610 ars_state->ars_status->out_length); in nfit_test_cmd_ars_status()
613 spin_unlock(&ars_state->lock); in nfit_test_cmd_ars_status()
1518 struct ars_state *ars_state = &t->ars_state; in nfit_test_ctl() local
1579 rc = nfit_test_cmd_ars_start(t, ars_state, buf, in nfit_test_ctl()
1583 rc = nfit_test_cmd_ars_status(ars_state, buf, buf_len, in nfit_test_ctl()
1697 static int ars_state_init(struct device *dev, struct ars_state *ars_state) in ars_state_init() argument
1700 ars_state->ars_status = devm_kzalloc(dev, in ars_state_init()
1702 if (!ars_state->ars_status) in ars_state_init()
1704 spin_lock_init(&ars_state->lock); in ars_state_init()
1936 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test0_alloc()
1969 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test1_alloc()
2682 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test0_setup()
2824 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test1_setup()