Lines Matching +full:lock +full:- +full:status
1 // SPDX-License-Identifier: GPL-2.0
28 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supported_in_se()
33 return aq->card->hwinfo.ep11 || aq->card->hwinfo.accel; in ap_q_supports_bind()
38 return aq->card->hwinfo.ep11; in ap_q_supports_assoc()
58 struct ap_queue_status status; in ap_queue_enable_irq() local
62 status = ap_aqic(aq->qid, qirqctrl, virt_to_phys(ind)); in ap_queue_enable_irq()
63 if (status.async) in ap_queue_enable_irq()
64 return -EPERM; in ap_queue_enable_irq()
65 switch (status.response_code) { in ap_queue_enable_irq()
74 AP_QID_CARD(aq->qid), in ap_queue_enable_irq()
75 AP_QID_QUEUE(aq->qid)); in ap_queue_enable_irq()
76 return -EOPNOTSUPP; in ap_queue_enable_irq()
80 return -EBUSY; in ap_queue_enable_irq()
92 * Returns AP queue status structure.
122 struct ap_queue_status status; in ap_sm_recv() local
137 status = ap_dqap(aq->qid, &aq->reply->psmid, in ap_sm_recv()
138 aq->reply->msg, aq->reply->bufsize, in ap_sm_recv()
139 &aq->reply->len, &reslen, &resgr0); in ap_sm_recv()
141 } while (status.response_code == 0xFF && resgr0 != 0); in ap_sm_recv()
143 switch (status.response_code) { in ap_sm_recv()
146 aq->reply->msg, aq->reply->len, false); in ap_sm_recv()
147 aq->queue_count = max_t(int, 0, aq->queue_count - 1); in ap_sm_recv()
148 if (!status.queue_empty && !aq->queue_count) in ap_sm_recv()
149 aq->queue_count++; in ap_sm_recv()
150 if (aq->queue_count > 0) in ap_sm_recv()
151 mod_timer(&aq->timeout, in ap_sm_recv()
152 jiffies + aq->request_timeout); in ap_sm_recv()
153 list_for_each_entry(ap_msg, &aq->pendingq, list) { in ap_sm_recv()
154 if (ap_msg->psmid != aq->reply->psmid) in ap_sm_recv()
156 list_del_init(&ap_msg->list); in ap_sm_recv()
157 aq->pendingq_count--; in ap_sm_recv()
159 ap_msg->rc = -EMSGSIZE; in ap_sm_recv()
160 ap_msg->receive(aq, ap_msg, NULL); in ap_sm_recv()
162 ap_msg->receive(aq, ap_msg, aq->reply); in ap_sm_recv()
169 __func__, aq->reply->psmid, in ap_sm_recv()
170 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_recv()
174 if (!status.queue_empty || aq->queue_count <= 0) in ap_sm_recv()
177 aq->queue_count = 0; in ap_sm_recv()
178 list_splice_init(&aq->pendingq, &aq->requestq); in ap_sm_recv()
179 aq->requestq_count += aq->pendingq_count; in ap_sm_recv()
181 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid), in ap_sm_recv()
182 aq->pendingq_count, aq->requestq_count); in ap_sm_recv()
183 aq->pendingq_count = 0; in ap_sm_recv()
188 return status; in ap_sm_recv()
199 struct ap_queue_status status; in ap_sm_read() local
201 if (!aq->reply) in ap_sm_read()
203 status = ap_sm_recv(aq); in ap_sm_read()
204 if (status.async) in ap_sm_read()
206 switch (status.response_code) { in ap_sm_read()
208 if (aq->queue_count > 0) { in ap_sm_read()
209 aq->sm_state = AP_SM_STATE_WORKING; in ap_sm_read()
212 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_read()
215 if (aq->queue_count > 0) in ap_sm_read()
216 return status.irq_enabled ? in ap_sm_read()
218 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_read()
221 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_read()
222 aq->last_err_rc = status.response_code; in ap_sm_read()
223 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_read()
224 __func__, status.response_code, in ap_sm_read()
225 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_read()
229 if (!status.irq_enabled && status.queue_empty) { in ap_sm_read()
233 aq->sm_state = AP_SM_STATE_SETIRQ_WAIT; in ap_sm_read()
248 struct ap_queue_status status; in ap_sm_write() local
250 ap_qid_t qid = aq->qid; in ap_sm_write()
252 if (aq->requestq_count <= 0) in ap_sm_write()
256 ap_msg = list_entry(aq->requestq.next, struct ap_message, list); in ap_sm_write()
258 ap_msg->msg, ap_msg->len, false); in ap_sm_write()
259 status = __ap_send(qid, ap_msg->psmid, in ap_sm_write()
260 ap_msg->msg, ap_msg->len, in ap_sm_write()
261 ap_msg->flags & AP_MSG_FLAG_SPECIAL); in ap_sm_write()
262 if (status.async) in ap_sm_write()
264 switch (status.response_code) { in ap_sm_write()
266 aq->queue_count = max_t(int, 1, aq->queue_count + 1); in ap_sm_write()
267 if (aq->queue_count == 1) in ap_sm_write()
268 mod_timer(&aq->timeout, jiffies + aq->request_timeout); in ap_sm_write()
269 list_move_tail(&ap_msg->list, &aq->pendingq); in ap_sm_write()
270 aq->requestq_count--; in ap_sm_write()
271 aq->pendingq_count++; in ap_sm_write()
272 if (aq->queue_count < aq->card->hwinfo.qd) { in ap_sm_write()
273 aq->sm_state = AP_SM_STATE_WORKING; in ap_sm_write()
278 aq->sm_state = AP_SM_STATE_QUEUE_FULL; in ap_sm_write()
279 return status.irq_enabled ? in ap_sm_write()
282 aq->sm_state = AP_SM_STATE_RESET_WAIT; in ap_sm_write()
289 list_del_init(&ap_msg->list); in ap_sm_write()
290 aq->requestq_count--; in ap_sm_write()
291 ap_msg->rc = -EINVAL; in ap_sm_write()
292 ap_msg->receive(aq, ap_msg, NULL); in ap_sm_write()
295 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_write()
296 aq->last_err_rc = status.response_code; in ap_sm_write()
297 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_write()
298 __func__, status.response_code, in ap_sm_write()
299 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_write()
323 struct ap_queue_status status; in ap_sm_reset() local
325 status = ap_rapq(aq->qid, aq->rapq_fbit); in ap_sm_reset()
326 if (status.async) in ap_sm_reset()
328 switch (status.response_code) { in ap_sm_reset()
331 aq->sm_state = AP_SM_STATE_RESET_WAIT; in ap_sm_reset()
332 aq->rapq_fbit = 0; in ap_sm_reset()
335 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_reset()
336 aq->last_err_rc = status.response_code; in ap_sm_reset()
337 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_reset()
338 __func__, status.response_code, in ap_sm_reset()
339 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset()
352 struct ap_queue_status status; in ap_sm_reset_wait() local
356 /* Get the status with TAPQ */ in ap_sm_reset_wait()
357 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_reset_wait()
359 switch (status.response_code) { in ap_sm_reset_wait()
361 aq->se_bstate = hwinfo.bs; in ap_sm_reset_wait()
364 aq->sm_state = AP_SM_STATE_SETIRQ_WAIT; in ap_sm_reset_wait()
366 aq->sm_state = (aq->queue_count > 0) ? in ap_sm_reset_wait()
376 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_reset_wait()
377 aq->last_err_rc = status.response_code; in ap_sm_reset_wait()
378 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_reset_wait()
379 __func__, status.response_code, in ap_sm_reset_wait()
380 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_reset_wait()
393 struct ap_queue_status status; in ap_sm_setirq_wait() local
395 if (aq->queue_count > 0 && aq->reply) in ap_sm_setirq_wait()
396 /* Try to read a completed message and get the status */ in ap_sm_setirq_wait()
397 status = ap_sm_recv(aq); in ap_sm_setirq_wait()
399 /* Get the status with TAPQ */ in ap_sm_setirq_wait()
400 status = ap_tapq(aq->qid, NULL); in ap_sm_setirq_wait()
402 if (status.irq_enabled == 1) { in ap_sm_setirq_wait()
404 aq->sm_state = (aq->queue_count > 0) ? in ap_sm_setirq_wait()
408 switch (status.response_code) { in ap_sm_setirq_wait()
410 if (aq->queue_count > 0) in ap_sm_setirq_wait()
416 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_setirq_wait()
417 aq->last_err_rc = status.response_code; in ap_sm_setirq_wait()
418 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_setirq_wait()
419 __func__, status.response_code, in ap_sm_setirq_wait()
420 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_setirq_wait()
432 struct ap_queue_status status; in ap_sm_assoc_wait() local
435 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_sm_assoc_wait()
437 if (status.async && status.response_code) { in ap_sm_assoc_wait()
438 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
439 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
440 AP_DBF_WARN("%s asynch RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
441 __func__, status.response_code, in ap_sm_assoc_wait()
442 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
445 if (status.response_code > AP_RESPONSE_BUSY) { in ap_sm_assoc_wait()
446 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
447 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
448 AP_DBF_WARN("%s RC 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
449 __func__, status.response_code, in ap_sm_assoc_wait()
450 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
455 aq->se_bstate = hwinfo.bs; in ap_sm_assoc_wait()
461 aq->sm_state = AP_SM_STATE_IDLE; in ap_sm_assoc_wait()
463 AP_QID_CARD(aq->qid), in ap_sm_assoc_wait()
464 AP_QID_QUEUE(aq->qid), aq->assoc_idx); in ap_sm_assoc_wait()
471 aq->assoc_idx = ASSOC_IDX_INVALID; in ap_sm_assoc_wait()
472 aq->dev_state = AP_DEV_STATE_ERROR; in ap_sm_assoc_wait()
473 aq->last_err_rc = status.response_code; in ap_sm_assoc_wait()
474 AP_DBF_WARN("%s bs 0x%02x on 0x%02x.%04x -> AP_DEV_STATE_ERROR\n", in ap_sm_assoc_wait()
476 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_sm_assoc_wait()
517 if (aq->config && !aq->chkstop && in ap_sm_event()
518 aq->dev_state > AP_DEV_STATE_UNINITIATED) in ap_sm_event()
519 return ap_jumptable[aq->sm_state][event](aq); in ap_sm_event()
544 spin_lock_bh(&aq->lock); in request_count_show()
545 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) { in request_count_show()
546 req_cnt = aq->total_request_count; in request_count_show()
549 spin_unlock_bh(&aq->lock); in request_count_show()
554 return sysfs_emit(buf, "-\n"); in request_count_show()
563 spin_lock_bh(&aq->lock); in request_count_store()
564 aq->total_request_count = 0; in request_count_store()
565 spin_unlock_bh(&aq->lock); in request_count_store()
578 spin_lock_bh(&aq->lock); in requestq_count_show()
579 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) in requestq_count_show()
580 reqq_cnt = aq->requestq_count; in requestq_count_show()
581 spin_unlock_bh(&aq->lock); in requestq_count_show()
593 spin_lock_bh(&aq->lock); in pendingq_count_show()
594 if (aq->dev_state > AP_DEV_STATE_UNINITIATED) in pendingq_count_show()
595 penq_cnt = aq->pendingq_count; in pendingq_count_show()
596 spin_unlock_bh(&aq->lock); in pendingq_count_show()
608 spin_lock_bh(&aq->lock); in reset_show()
609 switch (aq->sm_state) { in reset_show()
621 spin_unlock_bh(&aq->lock); in reset_show()
631 spin_lock_bh(&aq->lock); in reset_store()
633 aq->sm_state = AP_SM_STATE_RESET_START; in reset_store()
635 spin_unlock_bh(&aq->lock); in reset_store()
638 __func__, AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in reset_store()
649 struct ap_queue_status status; in interrupt_show() local
652 spin_lock_bh(&aq->lock); in interrupt_show()
653 if (aq->sm_state == AP_SM_STATE_SETIRQ_WAIT) { in interrupt_show()
656 status = ap_tapq(aq->qid, NULL); in interrupt_show()
657 if (status.irq_enabled) in interrupt_show()
662 spin_unlock_bh(&aq->lock); in interrupt_show()
675 spin_lock_bh(&aq->lock); in config_show()
676 rc = sysfs_emit(buf, "%d\n", aq->config ? 1 : 0); in config_show()
677 spin_unlock_bh(&aq->lock); in config_show()
689 spin_lock_bh(&aq->lock); in chkstop_show()
690 rc = sysfs_emit(buf, "%d\n", aq->chkstop ? 1 : 0); in chkstop_show()
691 spin_unlock_bh(&aq->lock); in chkstop_show()
701 struct ap_queue_status status; in ap_functions_show() local
704 status = ap_test_queue(aq->qid, 1, &hwinfo); in ap_functions_show()
705 if (status.response_code > AP_RESPONSE_BUSY) { in ap_functions_show()
707 status.response_code, in ap_functions_show()
708 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in ap_functions_show()
709 return -EIO; in ap_functions_show()
724 spin_lock_bh(&aq->lock); in states_show()
726 switch (aq->dev_state) { in states_show()
743 if (aq->dev_state) { in states_show()
744 switch (aq->sm_state) { in states_show()
770 spin_unlock_bh(&aq->lock); in states_show()
782 spin_lock_bh(&aq->lock); in last_err_rc_show()
783 rc = aq->last_err_rc; in last_err_rc_show()
784 spin_unlock_bh(&aq->lock); in last_err_rc_show()
854 struct ap_queue_status status; in se_bind_show() local
858 return sysfs_emit(buf, "-\n"); in se_bind_show()
860 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_show()
861 if (status.response_code > AP_RESPONSE_BUSY) { in se_bind_show()
863 status.response_code, in se_bind_show()
864 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_show()
865 return -EIO; in se_bind_show()
869 spin_lock_bh(&aq->lock); in se_bind_show()
870 aq->se_bstate = hwinfo.bs; in se_bind_show()
871 spin_unlock_bh(&aq->lock); in se_bind_show()
887 struct ap_queue_status status; in se_bind_store() local
893 return -EINVAL; in se_bind_store()
902 spin_lock_bh(&aq->lock); in se_bind_store()
904 aq->rapq_fbit = 1; in se_bind_store()
911 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_store()
912 if (status.response_code) { in se_bind_store()
914 __func__, status.response_code, in se_bind_store()
915 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
916 return -EIO; in se_bind_store()
920 spin_lock_bh(&aq->lock); in se_bind_store()
921 aq->se_bstate = hwinfo.bs; in se_bind_store()
925 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
926 rc = -EINVAL; in se_bind_store()
931 if (aq->sm_state < AP_SM_STATE_IDLE) { in se_bind_store()
932 rc = -EBUSY; in se_bind_store()
937 status = ap_bapq(aq->qid); in se_bind_store()
938 if (status.response_code) { in se_bind_store()
940 __func__, status.response_code, in se_bind_store()
941 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
942 rc = -EIO; in se_bind_store()
945 aq->assoc_idx = ASSOC_IDX_INVALID; in se_bind_store()
948 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_bind_store()
949 if (status.response_code) { in se_bind_store()
951 __func__, status.response_code, in se_bind_store()
952 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
953 rc = -EIO; in se_bind_store()
956 aq->se_bstate = hwinfo.bs; in se_bind_store()
961 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
962 rc = -EIO; in se_bind_store()
968 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_bind_store()
972 spin_unlock_bh(&aq->lock); in se_bind_store()
982 struct ap_queue_status status; in se_associate_show() local
986 return sysfs_emit(buf, "-\n"); in se_associate_show()
988 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_show()
989 if (status.response_code > AP_RESPONSE_BUSY) { in se_associate_show()
991 status.response_code, in se_associate_show()
992 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_show()
993 return -EIO; in se_associate_show()
997 spin_lock_bh(&aq->lock); in se_associate_show()
998 aq->se_bstate = hwinfo.bs; in se_associate_show()
999 spin_unlock_bh(&aq->lock); in se_associate_show()
1003 if (aq->assoc_idx == ASSOC_IDX_INVALID) { in se_associate_show()
1005 return -EIO; in se_associate_show()
1007 return sysfs_emit(buf, "associated %u\n", aq->assoc_idx); in se_associate_show()
1009 if (aq->assoc_idx != ASSOC_IDX_INVALID) in se_associate_show()
1022 struct ap_queue_status status; in se_associate_store() local
1028 return -EINVAL; in se_associate_store()
1035 return -EINVAL; in se_associate_store()
1038 status = ap_test_queue(aq->qid, 1, &hwinfo); in se_associate_store()
1039 if (status.response_code) { in se_associate_store()
1041 __func__, status.response_code, in se_associate_store()
1042 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1043 return -EIO; in se_associate_store()
1045 spin_lock_bh(&aq->lock); in se_associate_store()
1046 aq->se_bstate = hwinfo.bs; in se_associate_store()
1050 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1051 rc = -EINVAL; in se_associate_store()
1056 if (aq->sm_state != AP_SM_STATE_IDLE) { in se_associate_store()
1057 rc = -EBUSY; in se_associate_store()
1062 status = ap_aapq(aq->qid, value); in se_associate_store()
1063 switch (status.response_code) { in se_associate_store()
1066 aq->sm_state = AP_SM_STATE_ASSOC_WAIT; in se_associate_store()
1067 aq->assoc_idx = value; in se_associate_store()
1072 __func__, status.response_code, in se_associate_store()
1073 AP_QID_CARD(aq->qid), AP_QID_QUEUE(aq->qid)); in se_associate_store()
1074 rc = -EIO; in se_associate_store()
1081 spin_unlock_bh(&aq->lock); in se_associate_store()
1107 hash_del(&aq->hnode); in ap_queue_device_release()
1120 aq->card = ac; in ap_queue_create()
1121 aq->ap_dev.device.release = ap_queue_device_release; in ap_queue_create()
1122 aq->ap_dev.device.type = &ap_queue_type; in ap_queue_create()
1123 aq->ap_dev.device_type = ac->ap_dev.device_type; in ap_queue_create()
1126 aq->ap_dev.device.groups = ap_queue_dev_sb_attr_groups; in ap_queue_create()
1127 aq->qid = qid; in ap_queue_create()
1128 spin_lock_init(&aq->lock); in ap_queue_create()
1129 INIT_LIST_HEAD(&aq->pendingq); in ap_queue_create()
1130 INIT_LIST_HEAD(&aq->requestq); in ap_queue_create()
1131 timer_setup(&aq->timeout, ap_request_timeout, 0); in ap_queue_create()
1138 aq->reply = reply; in ap_queue_init_reply()
1140 spin_lock_bh(&aq->lock); in ap_queue_init_reply()
1142 spin_unlock_bh(&aq->lock); in ap_queue_init_reply()
1155 /* msg needs to have a valid receive-callback */ in ap_queue_message()
1156 BUG_ON(!ap_msg->receive); in ap_queue_message()
1158 spin_lock_bh(&aq->lock); in ap_queue_message()
1161 if (aq->dev_state == AP_DEV_STATE_OPERATING) { in ap_queue_message()
1162 list_add_tail(&ap_msg->list, &aq->requestq); in ap_queue_message()
1163 aq->requestq_count++; in ap_queue_message()
1164 aq->total_request_count++; in ap_queue_message()
1165 atomic64_inc(&aq->card->total_request_count); in ap_queue_message()
1167 rc = -ENODEV; in ap_queue_message()
1173 spin_unlock_bh(&aq->lock); in ap_queue_message()
1184 * ap_queue_message(). The perspective is very short-term as the
1191 spin_lock_bh(&aq->lock); in ap_queue_usable()
1194 if (!aq->config || aq->chkstop) { in ap_queue_usable()
1200 if (aq->dev_state != AP_DEV_STATE_OPERATING) { in ap_queue_usable()
1212 !(aq->se_bstate == AP_BS_Q_USABLE || in ap_queue_usable()
1213 aq->se_bstate == AP_BS_Q_USABLE_NO_SECURE_KEY)) in ap_queue_usable()
1218 spin_unlock_bh(&aq->lock); in ap_queue_usable()
1237 spin_lock_bh(&aq->lock); in ap_cancel_message()
1238 if (!list_empty(&ap_msg->list)) { in ap_cancel_message()
1239 list_for_each_entry(tmp, &aq->pendingq, list) in ap_cancel_message()
1240 if (tmp->psmid == ap_msg->psmid) { in ap_cancel_message()
1241 aq->pendingq_count--; in ap_cancel_message()
1244 aq->requestq_count--; in ap_cancel_message()
1246 list_del_init(&ap_msg->list); in ap_cancel_message()
1248 spin_unlock_bh(&aq->lock); in ap_cancel_message()
1262 list_for_each_entry_safe(ap_msg, next, &aq->pendingq, list) { in __ap_flush_queue()
1263 list_del_init(&ap_msg->list); in __ap_flush_queue()
1264 aq->pendingq_count--; in __ap_flush_queue()
1265 ap_msg->rc = -EAGAIN; in __ap_flush_queue()
1266 ap_msg->receive(aq, ap_msg, NULL); in __ap_flush_queue()
1268 list_for_each_entry_safe(ap_msg, next, &aq->requestq, list) { in __ap_flush_queue()
1269 list_del_init(&ap_msg->list); in __ap_flush_queue()
1270 aq->requestq_count--; in __ap_flush_queue()
1271 ap_msg->rc = -EAGAIN; in __ap_flush_queue()
1272 ap_msg->receive(aq, ap_msg, NULL); in __ap_flush_queue()
1274 aq->queue_count = 0; in __ap_flush_queue()
1279 spin_lock_bh(&aq->lock); in ap_flush_queue()
1281 spin_unlock_bh(&aq->lock); in ap_flush_queue()
1287 spin_lock_bh(&aq->lock); in ap_queue_prepare_remove()
1291 aq->dev_state = AP_DEV_STATE_SHUTDOWN; in ap_queue_prepare_remove()
1292 spin_unlock_bh(&aq->lock); in ap_queue_prepare_remove()
1293 timer_delete_sync(&aq->timeout); in ap_queue_prepare_remove()
1304 spin_lock_bh(&aq->lock); in ap_queue_remove()
1305 ap_zapq(aq->qid, 0); in ap_queue_remove()
1306 aq->dev_state = AP_DEV_STATE_UNINITIATED; in ap_queue_remove()
1307 spin_unlock_bh(&aq->lock); in ap_queue_remove()
1312 aq->dev_state = AP_DEV_STATE_OPERATING; in _ap_queue_init_state()
1313 aq->sm_state = AP_SM_STATE_RESET_START; in _ap_queue_init_state()
1314 aq->last_err_rc = 0; in _ap_queue_init_state()
1315 aq->assoc_idx = ASSOC_IDX_INVALID; in _ap_queue_init_state()
1321 spin_lock_bh(&aq->lock); in ap_queue_init_state()
1323 spin_unlock_bh(&aq->lock); in ap_queue_init_state()