Lines Matching refs:ars_state
201 struct ars_state { struct
205 } ars_state; member
521 static void post_ars_status(struct ars_state *ars_state, in post_ars_status() argument
530 ars_state->deadline = jiffies + 1*HZ; in post_ars_status()
531 ars_status = ars_state->ars_status; in post_ars_status()
561 struct ars_state *ars_state, in nfit_test_cmd_ars_start() argument
568 spin_lock(&ars_state->lock); in nfit_test_cmd_ars_start()
569 if (time_before(jiffies, ars_state->deadline)) { in nfit_test_cmd_ars_start()
575 post_ars_status(ars_state, &t->badrange, ars_start->address, in nfit_test_cmd_ars_start()
579 spin_unlock(&ars_state->lock); in nfit_test_cmd_ars_start()
584 static int nfit_test_cmd_ars_status(struct ars_state *ars_state, in nfit_test_cmd_ars_status() argument
588 if (buf_len < ars_state->ars_status->out_length) in nfit_test_cmd_ars_status()
591 spin_lock(&ars_state->lock); in nfit_test_cmd_ars_status()
592 if (time_before(jiffies, ars_state->deadline)) { in nfit_test_cmd_ars_status()
598 memcpy(ars_status, ars_state->ars_status, in nfit_test_cmd_ars_status()
599 ars_state->ars_status->out_length); in nfit_test_cmd_ars_status()
602 spin_unlock(&ars_state->lock); in nfit_test_cmd_ars_status()
1062 struct ars_state *ars_state = &t->ars_state; in nfit_test_ctl() local
1104 rc = nfit_test_cmd_ars_start(t, ars_state, buf, in nfit_test_ctl()
1108 rc = nfit_test_cmd_ars_status(ars_state, buf, buf_len, in nfit_test_ctl()
1210 static int ars_state_init(struct device *dev, struct ars_state *ars_state) in ars_state_init() argument
1213 ars_state->ars_status = devm_kzalloc(dev, in ars_state_init()
1215 if (!ars_state->ars_status) in ars_state_init()
1217 spin_lock_init(&ars_state->lock); in ars_state_init()
1425 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test0_alloc()
1458 return ars_state_init(&t->pdev.dev, &t->ars_state); in nfit_test1_alloc()
2170 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test0_setup()
2292 post_ars_status(&t->ars_state, &t->badrange, t->spa_set_dma[0], in nfit_test1_setup()