Lines Matching +full:lock +full:- +full:status
1 // SPDX-License-Identifier: GPL-2.0
27 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supported_in_se()
32 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supports_bind()
37 return aq->card->hwinfo.ep11; in ap_q_supports_assoc()
57 struct ap_queue_status status; in ap_queue_enable_irq() local
61 status = ap_aqic(aq->qid, qirqctrl, virt_to_phys(ind)); in ap_queue_enable_irq()
62 if (status.async) in ap_queue_enable_irq()
63 return -EPERM; in ap_queue_enable_irq()
64 switch (status.response_code) { 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()
75 return -EOPNOTSUPP; in ap_queue_enable_irq()
79 return -EBUSY; in ap_queue_enable_irq()
91 * Returns AP queue status structure.
121 struct ap_queue_status status; in ap_sm_recv() local
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()
140 } while (status.response_code == 0xFF && resgr0 != 0); in ap_sm_recv()
142 switch (status.response_code) { 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()
155 list_del_init(&ap_msg->list); in ap_sm_recv()
156 aq->pendingq_count--; in ap_sm_recv()
158 ap_msg->rc = -EMSGSIZE; 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()
187 return status; in ap_sm_recv()
198 struct ap_queue_status status; in ap_sm_read() local
200 if (!aq->reply) in ap_sm_read()
202 status = ap_sm_recv(aq); in ap_sm_read()
203 if (status.async) in ap_sm_read()
205 switch (status.response_code) { 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()
215 return status.irq_enabled ? 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()
222 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_read()
223 __func__, status.response_code, in ap_sm_read()
224 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_read()
228 if (!status.irq_enabled && status.queue_empty) { in ap_sm_read()
232 aq->sm_state = AP_SM_STATE_SETIRQ_WAIT; in ap_sm_read()
247 struct ap_queue_status status; in ap_sm_write() local
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()
257 ap_msg->msg, ap_msg->len, false); in ap_sm_write()
258 status = __ap_send(qid, ap_msg->psmid, in ap_sm_write()
259 ap_msg->msg, ap_msg->len, in ap_sm_write()
260 ap_msg->flags & AP_MSG_FLAG_SPECIAL); in ap_sm_write()
261 if (status.async) in ap_sm_write()
263 switch (status.response_code) { 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()
278 return status.irq_enabled ? in ap_sm_write()
281 aq->sm_state = AP_SM_STATE_RESET_WAIT; in ap_sm_write()
288 list_del_init(&ap_msg->list); in ap_sm_write()
289 aq->requestq_count--; in ap_sm_write()
290 ap_msg->rc = -EINVAL; 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()
296 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_write()
297 __func__, status.response_code, in ap_sm_write()
298 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_write()
322 struct ap_queue_status status; in ap_sm_reset() local
324 status = ap_rapq(aq->qid, aq->rapq_fbit); in ap_sm_reset()
325 if (status.async) in ap_sm_reset()
327 switch (status.response_code) { 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()
336 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_reset()
337 __func__, status.response_code, in ap_sm_reset()
338 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset()
351 struct ap_queue_status status; in ap_sm_reset_wait() local
355 /* Get the status with TAPQ */ in ap_sm_reset_wait()
356 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_reset_wait()
358 switch (status.response_code) { in ap_sm_reset_wait()
360 aq->se_bstate = hwinfo.bs; 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()
377 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_reset_wait()
378 __func__, status.response_code, in ap_sm_reset_wait()
379 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset_wait()
392 struct ap_queue_status status; in ap_sm_setirq_wait() local
394 if (aq->queue_count > 0 && aq->reply) in ap_sm_setirq_wait()
395 /* Try to read a completed message and get the status */ in ap_sm_setirq_wait()
396 status = ap_sm_recv(aq); in ap_sm_setirq_wait()
398 /* Get the status with TAPQ */ in ap_sm_setirq_wait()
399 status = ap_tapq(aq->qid, NULL); in ap_sm_setirq_wait()
401 if (status.irq_enabled == 1) { in ap_sm_setirq_wait()
403 aq->sm_state = (aq->queue_count > 0) ? in ap_sm_setirq_wait()
407 switch (status.response_code) { 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()
417 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_setirq_wait()
418 __func__, status.response_code, in ap_sm_setirq_wait()
419 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_setirq_wait()
431 struct ap_queue_status status; in ap_sm_assoc_wait() local
434 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_assoc_wait()
436 if (status.async && status.response_code) { 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()
439 AP_DBF_WARN("%s asynch RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
440 __func__, status.response_code, in ap_sm_assoc_wait()
441 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
444 if (status.response_code > AP_RESPONSE_BUSY) { 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()
447 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
448 __func__, 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()
473 AP_DBF_WARN("%s bs 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
475 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
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()
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()
553 return sysfs_emit(buf, "-\n"); in request_count_show()
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()
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()
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()
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()
630 spin_lock_bh(&aq->lock); in reset_store()
632 aq->sm_state = AP_SM_STATE_RESET_START; 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()
648 struct ap_queue_status status; 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()
656 if (status.irq_enabled) in interrupt_show()
661 spin_unlock_bh(&aq->lock); in interrupt_show()
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()
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()
700 struct ap_queue_status status; in ap_functions_show() local
703 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_functions_show()
704 if (status.response_code > AP_RESPONSE_BUSY) { in ap_functions_show()
706 status.response_code, in ap_functions_show()
707 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_functions_show()
708 return -EIO; in ap_functions_show()
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()
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()
853 struct ap_queue_status status; in se_bind_show() local
857 return sysfs_emit(buf, "-\n"); in se_bind_show()
859 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_show()
860 if (status.response_code > AP_RESPONSE_BUSY) { in se_bind_show()
862 status.response_code, in se_bind_show()
863 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_show()
864 return -EIO; 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()
886 struct ap_queue_status status; in se_bind_store() local
892 return -EINVAL; in se_bind_store()
901 spin_lock_bh(&aq->lock); in se_bind_store()
903 aq->rapq_fbit = 1; in se_bind_store()
910 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_store()
911 if (status.response_code) { in se_bind_store()
913 __func__, status.response_code, in se_bind_store()
914 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
915 return -EIO; 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()
925 rc = -EINVAL; in se_bind_store()
930 if (aq->sm_state < AP_SM_STATE_IDLE) { in se_bind_store()
931 rc = -EBUSY; in se_bind_store()
936 status = ap_bapq(aq->qid); in se_bind_store()
937 if (status.response_code) { in se_bind_store()
939 __func__, status.response_code, in se_bind_store()
940 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
941 rc = -EIO; 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()
948 if (status.response_code) { in se_bind_store()
950 __func__, status.response_code, in se_bind_store()
951 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
952 rc = -EIO; 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()
961 rc = -EIO; 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()
981 struct ap_queue_status status; in se_associate_show() local
985 return sysfs_emit(buf, "-\n"); in se_associate_show()
987 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_show()
988 if (status.response_code > AP_RESPONSE_BUSY) { in se_associate_show()
990 status.response_code, in se_associate_show()
991 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_show()
992 return -EIO; 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()
1004 return -EIO; 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()
1021 struct ap_queue_status status; in se_associate_store() local
1027 return -EINVAL; in se_associate_store()
1034 return -EINVAL; in se_associate_store()
1037 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_store()
1038 if (status.response_code) { in se_associate_store()
1040 __func__, status.response_code, in se_associate_store()
1041 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1042 return -EIO; 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()
1050 rc = -EINVAL; in se_associate_store()
1055 if (aq->sm_state != AP_SM_STATE_IDLE) { in se_associate_store()
1056 rc = -EBUSY; in se_associate_store()
1061 status = ap_aapq(aq->qid, value); in se_associate_store()
1062 switch (status.response_code) { 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()
1071 __func__, status.response_code, in se_associate_store()
1072 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1073 rc = -EIO; in se_associate_store()
1080 spin_unlock_bh(&aq->lock); in se_associate_store()
1106 hash_del(&aq->hnode); in ap_queue_device_release()
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()
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()
1137 aq->reply = reply; in ap_queue_init_reply()
1139 spin_lock_bh(&aq->lock); in ap_queue_init_reply()
1141 spin_unlock_bh(&aq->lock); in ap_queue_init_reply()
1154 /* msg needs to have a valid receive-callback */ in ap_queue_message()
1155 BUG_ON(!ap_msg->receive); in ap_queue_message()
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()
1166 rc = -ENODEV; in ap_queue_message()
1172 spin_unlock_bh(&aq->lock); in ap_queue_message()
1183 * ap_queue_message(). The perspective is very short-term as the
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()
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()
1236 spin_lock_bh(&aq->lock); in ap_cancel_message()
1237 if (!list_empty(&ap_msg->list)) { in ap_cancel_message()
1238 list_for_each_entry(tmp, &aq->pendingq, list) in ap_cancel_message()
1239 if (tmp->psmid == ap_msg->psmid) { in ap_cancel_message()
1240 aq->pendingq_count--; in ap_cancel_message()
1243 aq->requestq_count--; in ap_cancel_message()
1245 list_del_init(&ap_msg->list); in ap_cancel_message()
1247 spin_unlock_bh(&aq->lock); in ap_cancel_message()
1261 list_for_each_entry_safe(ap_msg, next, &aq->pendingq, list) { in __ap_flush_queue()
1262 list_del_init(&ap_msg->list); in __ap_flush_queue()
1263 aq->pendingq_count--; in __ap_flush_queue()
1264 ap_msg->rc = -EAGAIN; 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()
1268 list_del_init(&ap_msg->list); in __ap_flush_queue()
1269 aq->requestq_count--; in __ap_flush_queue()
1270 ap_msg->rc = -EAGAIN; 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()
1278 spin_lock_bh(&aq->lock); in ap_flush_queue()
1280 spin_unlock_bh(&aq->lock); in ap_flush_queue()
1286 spin_lock_bh(&aq->lock); 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 del_timer_sync(&aq->timeout); in ap_queue_prepare_remove()
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()
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()
1320 spin_lock_bh(&aq->lock); in ap_queue_init_state()
1322 spin_unlock_bh(&aq->lock); in ap_queue_init_state()