Lines Matching refs:req_mgr_h
88 struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle; in cc_req_mgr_fini() local
91 if (!req_mgr_h) in cc_req_mgr_fini()
94 if (req_mgr_h->dummy_comp_buff_dma) { in cc_req_mgr_fini()
95 dma_free_coherent(dev, sizeof(u32), req_mgr_h->dummy_comp_buff, in cc_req_mgr_fini()
96 req_mgr_h->dummy_comp_buff_dma); in cc_req_mgr_fini()
99 dev_dbg(dev, "max_used_hw_slots=%d\n", (req_mgr_h->hw_queue_size - in cc_req_mgr_fini()
100 req_mgr_h->min_free_hw_slots)); in cc_req_mgr_fini()
101 dev_dbg(dev, "max_used_sw_slots=%d\n", req_mgr_h->max_used_sw_slots); in cc_req_mgr_fini()
104 destroy_workqueue(req_mgr_h->workq); in cc_req_mgr_fini()
107 tasklet_kill(&req_mgr_h->comptask); in cc_req_mgr_fini()
109 kfree_sensitive(req_mgr_h); in cc_req_mgr_fini()
115 struct cc_req_mgr_handle *req_mgr_h; in cc_req_mgr_init() local
119 req_mgr_h = kzalloc(sizeof(*req_mgr_h), GFP_KERNEL); in cc_req_mgr_init()
120 if (!req_mgr_h) { in cc_req_mgr_init()
125 drvdata->request_mgr_handle = req_mgr_h; in cc_req_mgr_init()
127 spin_lock_init(&req_mgr_h->hw_lock); in cc_req_mgr_init()
128 spin_lock_init(&req_mgr_h->bl_lock); in cc_req_mgr_init()
129 INIT_LIST_HEAD(&req_mgr_h->backlog); in cc_req_mgr_init()
133 req_mgr_h->workq = create_singlethread_workqueue("ccree"); in cc_req_mgr_init()
134 if (!req_mgr_h->workq) { in cc_req_mgr_init()
139 INIT_DELAYED_WORK(&req_mgr_h->compwork, comp_work_handler); in cc_req_mgr_init()
142 tasklet_init(&req_mgr_h->comptask, comp_handler, in cc_req_mgr_init()
145 req_mgr_h->hw_queue_size = cc_ioread(drvdata, in cc_req_mgr_init()
147 dev_dbg(dev, "hw_queue_size=0x%08X\n", req_mgr_h->hw_queue_size); in cc_req_mgr_init()
148 if (req_mgr_h->hw_queue_size < MIN_HW_QUEUE_SIZE) { in cc_req_mgr_init()
150 req_mgr_h->hw_queue_size, MIN_HW_QUEUE_SIZE); in cc_req_mgr_init()
154 req_mgr_h->min_free_hw_slots = req_mgr_h->hw_queue_size; in cc_req_mgr_init()
155 req_mgr_h->max_used_sw_slots = 0; in cc_req_mgr_init()
158 req_mgr_h->dummy_comp_buff = in cc_req_mgr_init()
160 &req_mgr_h->dummy_comp_buff_dma, in cc_req_mgr_init()
162 if (!req_mgr_h->dummy_comp_buff) { in cc_req_mgr_init()
170 hw_desc_init(&req_mgr_h->compl_desc); in cc_req_mgr_init()
171 set_din_const(&req_mgr_h->compl_desc, 0, sizeof(u32)); in cc_req_mgr_init()
172 set_dout_dlli(&req_mgr_h->compl_desc, req_mgr_h->dummy_comp_buff_dma, in cc_req_mgr_init()
174 set_flow_mode(&req_mgr_h->compl_desc, BYPASS); in cc_req_mgr_init()
175 set_queue_last_ind(drvdata, &req_mgr_h->compl_desc); in cc_req_mgr_init()
225 struct cc_req_mgr_handle *req_mgr_h, in cc_queues_status() argument
235 if (((req_mgr_h->req_queue_head + 1) & (MAX_REQUEST_QUEUE_SIZE - 1)) == in cc_queues_status()
236 req_mgr_h->req_queue_tail) { in cc_queues_status()
238 req_mgr_h->req_queue_head, MAX_REQUEST_QUEUE_SIZE); in cc_queues_status()
242 if (req_mgr_h->q_free_slots >= total_seq_len) in cc_queues_status()
247 req_mgr_h->q_free_slots = in cc_queues_status()
249 if (req_mgr_h->q_free_slots < req_mgr_h->min_free_hw_slots) in cc_queues_status()
250 req_mgr_h->min_free_hw_slots = req_mgr_h->q_free_slots; in cc_queues_status()
252 if (req_mgr_h->q_free_slots >= total_seq_len) { in cc_queues_status()
258 req_mgr_h->q_free_slots, total_seq_len); in cc_queues_status()
262 req_mgr_h->req_queue_head, MAX_REQUEST_QUEUE_SIZE, in cc_queues_status()
263 req_mgr_h->q_free_slots, total_seq_len); in cc_queues_status()
283 struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle; in cc_do_send_request() local
288 used_sw_slots = ((req_mgr_h->req_queue_head - in cc_do_send_request()
289 req_mgr_h->req_queue_tail) & in cc_do_send_request()
291 if (used_sw_slots > req_mgr_h->max_used_sw_slots) in cc_do_send_request()
292 req_mgr_h->max_used_sw_slots = used_sw_slots; in cc_do_send_request()
295 req_mgr_h->req_queue[req_mgr_h->req_queue_head] = *cc_req; in cc_do_send_request()
296 req_mgr_h->req_queue_head = (req_mgr_h->req_queue_head + 1) & in cc_do_send_request()
299 dev_dbg(dev, "Enqueue request head=%u\n", req_mgr_h->req_queue_head); in cc_do_send_request()
313 enqueue_seq(drvdata, &req_mgr_h->compl_desc, 1); in cc_do_send_request()
317 if (req_mgr_h->q_free_slots < total_seq_len) { in cc_do_send_request()
323 req_mgr_h->q_free_slots = 0; in cc_do_send_request()
326 req_mgr_h->q_free_slots -= total_seq_len; in cc_do_send_request()
504 struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle; in send_request_init() local
510 rc = cc_queues_status(drvdata, req_mgr_h, total_seq_len); in send_request_init()
525 req_mgr_h->q_free_slots = in send_request_init()