Lines Matching refs:txn
26 struct slim_msg_txn *txn; in slim_msg_response() local
31 txn = idr_find(&ctrl->tid_idr, tid); in slim_msg_response()
34 if (txn == NULL) in slim_msg_response()
37 msg = txn->msg; in slim_msg_response()
44 slim_free_txn_tid(ctrl, txn); in slim_msg_response()
46 if (txn->comp) in slim_msg_response()
47 complete(txn->comp); in slim_msg_response()
63 int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_alloc_txn_tid() argument
69 ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 1, in slim_alloc_txn_tid()
75 txn->tid = ret; in slim_alloc_txn_tid()
87 void slim_free_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_free_txn_tid() argument
92 idr_remove(&ctrl->tid_idr, txn->tid); in slim_free_txn_tid()
110 int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_do_transfer() argument
121 (txn->mt == SLIM_MSG_MT_CORE && in slim_do_transfer()
122 txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && in slim_do_transfer()
123 txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) in slim_do_transfer()
135 txn->tid = 0; in slim_do_transfer()
136 need_tid = slim_tid_txn(txn->mt, txn->mc); in slim_do_transfer()
139 ret = slim_alloc_txn_tid(ctrl, txn); in slim_do_transfer()
143 if (!txn->msg->comp) in slim_do_transfer()
144 txn->comp = &done; in slim_do_transfer()
146 txn->comp = txn->comp; in slim_do_transfer()
149 ret = ctrl->xfer_msg(ctrl, txn); in slim_do_transfer()
151 if (!ret && need_tid && !txn->msg->comp) { in slim_do_transfer()
152 unsigned long ms = txn->rl + HZ; in slim_do_transfer()
154 timeout = wait_for_completion_timeout(txn->comp, in slim_do_transfer()
158 slim_free_txn_tid(ctrl, txn); in slim_do_transfer()
164 txn->mt, txn->mc, txn->la, ret); in slim_do_transfer()
167 if (!clk_pause_msg && (txn->tid == 0 || ret == -ETIMEDOUT)) { in slim_do_transfer()
237 struct slim_msg_txn *txn = &txn_stack; in slim_xfer_msg() local
254 txn->ec = ((sl | (1 << 3)) | ((msg->start_offset & 0xFFF) << 4)); in slim_xfer_msg()
261 txn->rl += msg->num_bytes; in slim_xfer_msg()
267 if (slim_tid_txn(txn->mt, txn->mc)) in slim_xfer_msg()
268 txn->rl++; in slim_xfer_msg()
270 return slim_do_transfer(ctrl, txn); in slim_xfer_msg()