Lines Matching refs:aq
19 static void __ap_flush_queue(struct ap_queue *aq);
25 static inline bool ap_q_supported_in_se(struct ap_queue *aq) in ap_q_supported_in_se() argument
27 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supported_in_se()
30 static inline bool ap_q_supports_bind(struct ap_queue *aq) in ap_q_supports_bind() argument
32 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supports_bind()
35 static inline bool ap_q_supports_assoc(struct ap_queue *aq) in ap_q_supports_assoc() argument
37 return aq->card->hwinfo.ep11; in ap_q_supports_assoc()
40 static inline bool ap_q_needs_bind(struct ap_queue *aq) in ap_q_needs_bind() argument
42 return ap_q_supports_bind(aq) && ap_sb_available(); in ap_q_needs_bind()
54 static int ap_queue_enable_irq(struct ap_queue *aq, void *ind) in ap_queue_enable_irq() argument
61 status = ap_aqic(aq->qid, qirqctrl, virt_to_phys(ind)); in ap_queue_enable_irq()
73 AP_QID_CARD(aq->qid), in ap_queue_enable_irq()
74 AP_QID_QUEUE(aq->qid)); in ap_queue_enable_irq()
107 static enum ap_sm_wait ap_sm_nop(struct ap_queue *aq) in ap_sm_nop() argument
119 static struct ap_queue_status ap_sm_recv(struct ap_queue *aq) in ap_sm_recv() argument
136 status = ap_dqap(aq->qid, &aq->reply->psmid, in ap_sm_recv()
137 aq->reply->msg, aq->reply->bufsize, in ap_sm_recv()
138 &aq->reply->len, &reslen, &resgr0); in ap_sm_recv()
145 aq->reply->msg, aq->reply->len, false); in ap_sm_recv()
146 aq->queue_count = max_t(int, 0, aq->queue_count - 1); in ap_sm_recv()
147 if (!status.queue_empty && !aq->queue_count) in ap_sm_recv()
148 aq->queue_count++; in ap_sm_recv()
149 if (aq->queue_count > 0) in ap_sm_recv()
150 mod_timer(&aq->timeout, in ap_sm_recv()
151 jiffies + aq->request_timeout); in ap_sm_recv()
152 list_for_each_entry(ap_msg, &aq->pendingq, list) { in ap_sm_recv()
153 if (ap_msg->psmid != aq->reply->psmid) in ap_sm_recv()
156 aq->pendingq_count--; in ap_sm_recv()
159 ap_msg->receive(aq, ap_msg, NULL); in ap_sm_recv()
161 ap_msg->receive(aq, ap_msg, aq->reply); in ap_sm_recv()
168 __func__, aq->reply->psmid, in ap_sm_recv()
169 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_recv()
173 if (!status.queue_empty || aq->queue_count <= 0) in ap_sm_recv()
176 aq->queue_count = 0; in ap_sm_recv()
177 list_splice_init(&aq->pendingq, &aq->requestq); in ap_sm_recv()
178 aq->requestq_count += aq->pendingq_count; in ap_sm_recv()
180 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid), in ap_sm_recv()
181 aq->pendingq_count, aq->requestq_count); in ap_sm_recv()
182 aq->pendingq_count = 0; in ap_sm_recv()
196 static enum ap_sm_wait ap_sm_read(struct ap_queue *aq) in ap_sm_read() argument
200 if (!aq->reply) in ap_sm_read()
202 status = ap_sm_recv(aq); in ap_sm_read()
207 if (aq->queue_count > 0) { in ap_sm_read()
208 aq->sm_state = AP_SM_STATE_WORKING; in ap_sm_read()
211 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_read()
214 if (aq->queue_count > 0) in ap_sm_read()
217 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_read()
220 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_read()
221 aq->last_err_rc = status.response_code; in ap_sm_read()
224 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_read()
231 if (lsi_ptr && ap_queue_enable_irq(aq, lsi_ptr) == 0) { in ap_sm_read()
232 aq->sm_state = AP_SM_STATE_SETIRQ_WAIT; in ap_sm_read()
245 static enum ap_sm_wait ap_sm_write(struct ap_queue *aq) in ap_sm_write() argument
249 ap_qid_t qid = aq->qid; in ap_sm_write()
251 if (aq->requestq_count <= 0) in ap_sm_write()
255 ap_msg = list_entry(aq->requestq.next, struct ap_message, list); in ap_sm_write()
265 aq->queue_count = max_t(int, 1, aq->queue_count + 1); in ap_sm_write()
266 if (aq->queue_count == 1) in ap_sm_write()
267 mod_timer(&aq->timeout, jiffies + aq->request_timeout); in ap_sm_write()
268 list_move_tail(&ap_msg->list, &aq->pendingq); in ap_sm_write()
269 aq->requestq_count--; in ap_sm_write()
270 aq->pendingq_count++; in ap_sm_write()
271 if (aq->queue_count < aq->card->hwinfo.qd) { in ap_sm_write()
272 aq->sm_state = AP_SM_STATE_WORKING; in ap_sm_write()
277 aq->sm_state = AP_SM_STATE_QUEUE_FULL; in ap_sm_write()
281 aq->sm_state = AP_SM_STATE_RESET_WAIT; in ap_sm_write()
289 aq->requestq_count--; in ap_sm_write()
291 ap_msg->receive(aq, ap_msg, NULL); in ap_sm_write()
294 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_write()
295 aq->last_err_rc = status.response_code; in ap_sm_write()
298 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_write()
309 static enum ap_sm_wait ap_sm_read_write(struct ap_queue *aq) in ap_sm_read_write() argument
311 return min(ap_sm_read(aq), ap_sm_write(aq)); in ap_sm_read_write()
320 static enum ap_sm_wait ap_sm_reset(struct ap_queue *aq) in ap_sm_reset() argument
324 status = ap_rapq(aq->qid, aq->rapq_fbit); in ap_sm_reset()
330 aq->sm_state = AP_SM_STATE_RESET_WAIT; in ap_sm_reset()
331 aq->rapq_fbit = 0; in ap_sm_reset()
334 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_reset()
335 aq->last_err_rc = status.response_code; in ap_sm_reset()
338 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset()
349 static enum ap_sm_wait ap_sm_reset_wait(struct ap_queue *aq) in ap_sm_reset_wait() argument
356 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_reset_wait()
360 aq->se_bstate = hwinfo.bs; in ap_sm_reset_wait()
362 if (lsi_ptr && ap_queue_enable_irq(aq, lsi_ptr) == 0) in ap_sm_reset_wait()
363 aq->sm_state = AP_SM_STATE_SETIRQ_WAIT; in ap_sm_reset_wait()
365 aq->sm_state = (aq->queue_count > 0) ? in ap_sm_reset_wait()
375 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_reset_wait()
376 aq->last_err_rc = status.response_code; in ap_sm_reset_wait()
379 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset_wait()
390 static enum ap_sm_wait ap_sm_setirq_wait(struct ap_queue *aq) in ap_sm_setirq_wait() argument
394 if (aq->queue_count > 0 && aq->reply) in ap_sm_setirq_wait()
396 status = ap_sm_recv(aq); in ap_sm_setirq_wait()
399 status = ap_tapq(aq->qid, NULL); in ap_sm_setirq_wait()
403 aq->sm_state = (aq->queue_count > 0) ? in ap_sm_setirq_wait()
409 if (aq->queue_count > 0) in ap_sm_setirq_wait()
415 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_setirq_wait()
416 aq->last_err_rc = status.response_code; in ap_sm_setirq_wait()
419 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_setirq_wait()
429 static enum ap_sm_wait ap_sm_assoc_wait(struct ap_queue *aq) in ap_sm_assoc_wait() argument
434 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_assoc_wait()
437 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
438 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
441 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
445 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
446 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
449 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
454 aq->se_bstate = hwinfo.bs; in ap_sm_assoc_wait()
460 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_assoc_wait()
462 AP_QID_CARD(aq->qid), in ap_sm_assoc_wait()
463 AP_QID_QUEUE(aq->qid), aq->assoc_idx); in ap_sm_assoc_wait()
470 aq->assoc_idx = ASSOC_IDX_INVALID; in ap_sm_assoc_wait()
471 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
472 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
475 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
514 enum ap_sm_wait ap_sm_event(struct ap_queue *aq, enum ap_sm_event event) in ap_sm_event() argument
516 if (aq->config && !aq->chkstop && in ap_sm_event()
517 aq->dev_state > AP_DEV_STATE_UNINITIATED) in ap_sm_event()
518 return ap_jumptable[aq->sm_state][event](aq); in ap_sm_event()
523 enum ap_sm_wait ap_sm_event_loop(struct ap_queue *aq, enum ap_sm_event event) in ap_sm_event_loop() argument
527 while ((wait = ap_sm_event(aq, event)) == AP_SM_WAIT_AGAIN) in ap_sm_event_loop()
539 struct ap_queue *aq = to_ap_queue(dev); in request_count_show() local
543 spin_lock_bh(&aq->lock); in request_count_show()
544 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) { in request_count_show()
545 req_cnt = aq->total_request_count; in request_count_show()
548 spin_unlock_bh(&aq->lock); in request_count_show()
560 struct ap_queue *aq = to_ap_queue(dev); in request_count_store() local
562 spin_lock_bh(&aq->lock); in request_count_store()
563 aq->total_request_count = 0; in request_count_store()
564 spin_unlock_bh(&aq->lock); in request_count_store()
574 struct ap_queue *aq = to_ap_queue(dev); in requestq_count_show() local
577 spin_lock_bh(&aq->lock); in requestq_count_show()
578 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) in requestq_count_show()
579 reqq_cnt = aq->requestq_count; in requestq_count_show()
580 spin_unlock_bh(&aq->lock); in requestq_count_show()
589 struct ap_queue *aq = to_ap_queue(dev); in pendingq_count_show() local
592 spin_lock_bh(&aq->lock); in pendingq_count_show()
593 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) in pendingq_count_show()
594 penq_cnt = aq->pendingq_count; in pendingq_count_show()
595 spin_unlock_bh(&aq->lock); in pendingq_count_show()
604 struct ap_queue *aq = to_ap_queue(dev); in reset_show() local
607 spin_lock_bh(&aq->lock); in reset_show()
608 switch (aq->sm_state) { in reset_show()
620 spin_unlock_bh(&aq->lock); in reset_show()
628 struct ap_queue *aq = to_ap_queue(dev); in reset_store() local
630 spin_lock_bh(&aq->lock); in reset_store()
631 __ap_flush_queue(aq); in reset_store()
632 aq->sm_state = AP_SM_STATE_RESET_START; in reset_store()
633 ap_wait(ap_sm_event(aq, AP_SM_EVENT_POLL)); in reset_store()
634 spin_unlock_bh(&aq->lock); in reset_store()
637 __func__, AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in reset_store()
647 struct ap_queue *aq = to_ap_queue(dev); in interrupt_show() local
651 spin_lock_bh(&aq->lock); in interrupt_show()
652 if (aq->sm_state == AP_SM_STATE_SETIRQ_WAIT) { in interrupt_show()
655 status = ap_tapq(aq->qid, NULL); in interrupt_show()
661 spin_unlock_bh(&aq->lock); in interrupt_show()
671 struct ap_queue *aq = to_ap_queue(dev); in config_show() local
674 spin_lock_bh(&aq->lock); in config_show()
675 rc = sysfs_emit(buf, "%d\n", aq->config ? 1 : 0); in config_show()
676 spin_unlock_bh(&aq->lock); in config_show()
685 struct ap_queue *aq = to_ap_queue(dev); in chkstop_show() local
688 spin_lock_bh(&aq->lock); in chkstop_show()
689 rc = sysfs_emit(buf, "%d\n", aq->chkstop ? 1 : 0); in chkstop_show()
690 spin_unlock_bh(&aq->lock); in chkstop_show()
699 struct ap_queue *aq = to_ap_queue(dev); in ap_functions_show() local
703 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_functions_show()
707 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_functions_show()
720 struct ap_queue *aq = to_ap_queue(dev); in states_show() local
723 spin_lock_bh(&aq->lock); in states_show()
725 switch (aq->dev_state) { in states_show()
742 if (aq->dev_state) { in states_show()
743 switch (aq->sm_state) { in states_show()
769 spin_unlock_bh(&aq->lock); in states_show()
778 struct ap_queue *aq = to_ap_queue(dev); in last_err_rc_show() local
781 spin_lock_bh(&aq->lock); in last_err_rc_show()
782 rc = aq->last_err_rc; in last_err_rc_show()
783 spin_unlock_bh(&aq->lock); in last_err_rc_show()
852 struct ap_queue *aq = to_ap_queue(dev); in se_bind_show() local
856 if (!ap_q_supports_bind(aq)) in se_bind_show()
859 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_show()
863 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_show()
868 spin_lock_bh(&aq->lock); in se_bind_show()
869 aq->se_bstate = hwinfo.bs; in se_bind_show()
870 spin_unlock_bh(&aq->lock); in se_bind_show()
885 struct ap_queue *aq = to_ap_queue(dev); in se_bind_store() local
891 if (!ap_q_supports_bind(aq)) in se_bind_store()
901 spin_lock_bh(&aq->lock); in se_bind_store()
902 __ap_flush_queue(aq); in se_bind_store()
903 aq->rapq_fbit = 1; in se_bind_store()
904 _ap_queue_init_state(aq); in se_bind_store()
910 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_store()
914 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
919 spin_lock_bh(&aq->lock); in se_bind_store()
920 aq->se_bstate = hwinfo.bs; in se_bind_store()
924 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
930 if (aq->sm_state < AP_SM_STATE_IDLE) { in se_bind_store()
936 status = ap_bapq(aq->qid); in se_bind_store()
940 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
944 aq->assoc_idx = ASSOC_IDX_INVALID; in se_bind_store()
947 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_store()
951 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
955 aq->se_bstate = hwinfo.bs; in se_bind_store()
960 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
967 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
971 spin_unlock_bh(&aq->lock); in se_bind_store()
980 struct ap_queue *aq = to_ap_queue(dev); in se_associate_show() local
984 if (!ap_q_supports_assoc(aq)) in se_associate_show()
987 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_show()
991 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_show()
996 spin_lock_bh(&aq->lock); in se_associate_show()
997 aq->se_bstate = hwinfo.bs; in se_associate_show()
998 spin_unlock_bh(&aq->lock); in se_associate_show()
1002 if (aq->assoc_idx == ASSOC_IDX_INVALID) { in se_associate_show()
1006 return sysfs_emit(buf, "associated %u\n", aq->assoc_idx); in se_associate_show()
1008 if (aq->assoc_idx != ASSOC_IDX_INVALID) in se_associate_show()
1020 struct ap_queue *aq = to_ap_queue(dev); in se_associate_store() local
1026 if (!ap_q_supports_assoc(aq)) in se_associate_store()
1037 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_store()
1041 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1044 spin_lock_bh(&aq->lock); in se_associate_store()
1045 aq->se_bstate = hwinfo.bs; in se_associate_store()
1049 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1055 if (aq->sm_state != AP_SM_STATE_IDLE) { in se_associate_store()
1061 status = ap_aapq(aq->qid, value); in se_associate_store()
1065 aq->sm_state = AP_SM_STATE_ASSOC_WAIT; in se_associate_store()
1066 aq->assoc_idx = value; in se_associate_store()
1067 ap_wait(ap_sm_event(aq, AP_SM_EVENT_POLL)); in se_associate_store()
1072 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1080 spin_unlock_bh(&aq->lock); in se_associate_store()
1103 struct ap_queue *aq = to_ap_queue(dev); in ap_queue_device_release() local
1106 hash_del(&aq->hnode); in ap_queue_device_release()
1109 kfree(aq); in ap_queue_device_release()
1114 struct ap_queue *aq; in ap_queue_create() local
1116 aq = kzalloc(sizeof(*aq), GFP_KERNEL); in ap_queue_create()
1117 if (!aq) in ap_queue_create()
1119 aq->card = ac; in ap_queue_create()
1120 aq->ap_dev.device.release = ap_queue_device_release; in ap_queue_create()
1121 aq->ap_dev.device.type = &ap_queue_type; in ap_queue_create()
1122 aq->ap_dev.device_type = ac->ap_dev.device_type; in ap_queue_create()
1124 if (ap_is_se_guest() && ap_q_supported_in_se(aq)) in ap_queue_create()
1125 aq->ap_dev.device.groups = ap_queue_dev_sb_attr_groups; in ap_queue_create()
1126 aq->qid = qid; in ap_queue_create()
1127 spin_lock_init(&aq->lock); in ap_queue_create()
1128 INIT_LIST_HEAD(&aq->pendingq); in ap_queue_create()
1129 INIT_LIST_HEAD(&aq->requestq); in ap_queue_create()
1130 timer_setup(&aq->timeout, ap_request_timeout, 0); in ap_queue_create()
1132 return aq; in ap_queue_create()
1135 void ap_queue_init_reply(struct ap_queue *aq, struct ap_message *reply) in ap_queue_init_reply() argument
1137 aq->reply = reply; in ap_queue_init_reply()
1139 spin_lock_bh(&aq->lock); in ap_queue_init_reply()
1140 ap_wait(ap_sm_event(aq, AP_SM_EVENT_POLL)); in ap_queue_init_reply()
1141 spin_unlock_bh(&aq->lock); in ap_queue_init_reply()
1150 int ap_queue_message(struct ap_queue *aq, struct ap_message *ap_msg) in ap_queue_message() argument
1157 spin_lock_bh(&aq->lock); in ap_queue_message()
1160 if (aq->dev_state == AP_DEV_STATE_OPERATING) { in ap_queue_message()
1161 list_add_tail(&ap_msg->list, &aq->requestq); in ap_queue_message()
1162 aq->requestq_count++; in ap_queue_message()
1163 aq->total_request_count++; in ap_queue_message()
1164 atomic64_inc(&aq->card->total_request_count); in ap_queue_message()
1170 ap_wait(ap_sm_event_loop(aq, AP_SM_EVENT_POLL)); in ap_queue_message()
1172 spin_unlock_bh(&aq->lock); in ap_queue_message()
1186 bool ap_queue_usable(struct ap_queue *aq) in ap_queue_usable() argument
1190 spin_lock_bh(&aq->lock); in ap_queue_usable()
1193 if (!aq->config || aq->chkstop) { in ap_queue_usable()
1199 if (aq->dev_state != AP_DEV_STATE_OPERATING) { in ap_queue_usable()
1206 if (!ap_q_supported_in_se(aq)) { in ap_queue_usable()
1210 if (ap_q_needs_bind(aq) && in ap_queue_usable()
1211 !(aq->se_bstate == AP_BS_Q_USABLE || in ap_queue_usable()
1212 aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY)) in ap_queue_usable()
1217 spin_unlock_bh(&aq->lock); in ap_queue_usable()
1232 void ap_cancel_message(struct ap_queue *aq, struct ap_message *ap_msg) in ap_cancel_message() argument
1236 spin_lock_bh(&aq->lock); in ap_cancel_message()
1238 list_for_each_entry(tmp, &aq->pendingq, list) in ap_cancel_message()
1240 aq->pendingq_count--; in ap_cancel_message()
1243 aq->requestq_count--; in ap_cancel_message()
1247 spin_unlock_bh(&aq->lock); in ap_cancel_message()
1257 static void __ap_flush_queue(struct ap_queue *aq) in __ap_flush_queue() argument
1261 list_for_each_entry_safe(ap_msg, next, &aq->pendingq, list) { in __ap_flush_queue()
1263 aq->pendingq_count--; in __ap_flush_queue()
1265 ap_msg->receive(aq, ap_msg, NULL); in __ap_flush_queue()
1267 list_for_each_entry_safe(ap_msg, next, &aq->requestq, list) { in __ap_flush_queue()
1269 aq->requestq_count--; in __ap_flush_queue()
1271 ap_msg->receive(aq, ap_msg, NULL); in __ap_flush_queue()
1273 aq->queue_count = 0; in __ap_flush_queue()
1276 void ap_flush_queue(struct ap_queue *aq) in ap_flush_queue() argument
1278 spin_lock_bh(&aq->lock); in ap_flush_queue()
1279 __ap_flush_queue(aq); in ap_flush_queue()
1280 spin_unlock_bh(&aq->lock); in ap_flush_queue()
1284 void ap_queue_prepare_remove(struct ap_queue *aq) in ap_queue_prepare_remove() argument
1286 spin_lock_bh(&aq->lock); in ap_queue_prepare_remove()
1288 __ap_flush_queue(aq); in ap_queue_prepare_remove()
1290 aq->dev_state = AP_DEV_STATE_SHUTDOWN; in ap_queue_prepare_remove()
1291 spin_unlock_bh(&aq->lock); in ap_queue_prepare_remove()
1292 timer_delete_sync(&aq->timeout); in ap_queue_prepare_remove()
1295 void ap_queue_remove(struct ap_queue *aq) in ap_queue_remove() argument
1303 spin_lock_bh(&aq->lock); in ap_queue_remove()
1304 ap_zapq(aq->qid, 0); in ap_queue_remove()
1305 aq->dev_state = AP_DEV_STATE_UNINITIATED; in ap_queue_remove()
1306 spin_unlock_bh(&aq->lock); in ap_queue_remove()
1309 void _ap_queue_init_state(struct ap_queue *aq) in _ap_queue_init_state() argument
1311 aq->dev_state = AP_DEV_STATE_OPERATING; in _ap_queue_init_state()
1312 aq->sm_state = AP_SM_STATE_RESET_START; in _ap_queue_init_state()
1313 aq->last_err_rc = 0; in _ap_queue_init_state()
1314 aq->assoc_idx = ASSOC_IDX_INVALID; in _ap_queue_init_state()
1315 ap_wait(ap_sm_event(aq, AP_SM_EVENT_POLL)); in _ap_queue_init_state()
1318 void ap_queue_init_state(struct ap_queue *aq) in ap_queue_init_state() argument
1320 spin_lock_bh(&aq->lock); in ap_queue_init_state()
1321 _ap_queue_init_state(aq); in ap_queue_init_state()
1322 spin_unlock_bh(&aq->lock); in ap_queue_init_state()