Lines Matching refs:rb_mgr
27 struct ring_buf_manager *rb_mgr = &tee->rb_mgr; in tee_alloc_ring() local
41 rb_mgr->ring_start = start_addr; in tee_alloc_ring()
42 rb_mgr->ring_size = ring_size; in tee_alloc_ring()
43 rb_mgr->ring_pa = __psp_pa(start_addr); in tee_alloc_ring()
44 mutex_init(&rb_mgr->mutex); in tee_alloc_ring()
51 struct ring_buf_manager *rb_mgr = &tee->rb_mgr; in tee_free_ring() local
53 if (!rb_mgr->ring_start) in tee_free_ring()
56 free_pages((unsigned long)rb_mgr->ring_start, in tee_free_ring()
57 get_order(rb_mgr->ring_size)); in tee_free_ring()
59 rb_mgr->ring_start = NULL; in tee_free_ring()
60 rb_mgr->ring_size = 0; in tee_free_ring()
61 rb_mgr->ring_pa = 0; in tee_free_ring()
62 mutex_destroy(&rb_mgr->mutex); in tee_free_ring()
94 cmd->hi_addr = upper_32_bits(tee->rb_mgr.ring_pa); in tee_alloc_cmd_buffer()
95 cmd->low_addr = lower_32_bits(tee->rb_mgr.ring_pa); in tee_alloc_cmd_buffer()
96 cmd->size = tee->rb_mgr.ring_size; in tee_alloc_cmd_buffer()
125 tee->rb_mgr.wptr = 0; in tee_init_ring()
171 if (!tee->rb_mgr.ring_start) in tee_destroy_ring()
254 mutex_lock(&tee->rb_mgr.mutex); in tee_submit_cmd()
260 (tee->rb_mgr.ring_start + tee->rb_mgr.wptr); in tee_submit_cmd()
267 if (!(tee->rb_mgr.wptr + sizeof(struct tee_ring_cmd) == rptr || in tee_submit_cmd()
272 rptr, tee->rb_mgr.wptr); in tee_submit_cmd()
275 mutex_unlock(&tee->rb_mgr.mutex); in tee_submit_cmd()
277 mutex_lock(&tee->rb_mgr.mutex); in tee_submit_cmd()
282 (tee->rb_mgr.wptr + sizeof(struct tee_ring_cmd) == rptr || in tee_submit_cmd()
285 rptr, tee->rb_mgr.wptr, cmd->flag); in tee_submit_cmd()
308 tee->rb_mgr.wptr += sizeof(struct tee_ring_cmd); in tee_submit_cmd()
309 if (tee->rb_mgr.wptr >= tee->rb_mgr.ring_size) in tee_submit_cmd()
310 tee->rb_mgr.wptr = 0; in tee_submit_cmd()
313 iowrite32(tee->rb_mgr.wptr, tee->io_regs + tee->vdata->ring_wptr_reg); in tee_submit_cmd()
321 mutex_unlock(&tee->rb_mgr.mutex); in tee_submit_cmd()