Lines Matching full: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()
49 /* Remove runtime-pm vote now that response was received for TID txn */ in slim_msg_response()
56 * slim_alloc_txn_tid() - Allocate a tid to txn
59 * @txn: transaction to be allocated with tid.
61 * Return: zero on success with valid txn->tid and error code on failures.
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()
82 * slim_free_txn_tid() - Free tid of txn
85 * @txn: transaction whose tid should be freed
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()
101 * @txn: Transaction to be sent over SLIMbus
110 int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) in slim_do_transfer() argument
122 (txn->mt == SLIM_MSG_MT_CORE && in slim_do_transfer()
123 txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && in slim_do_transfer()
124 txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) in slim_do_transfer()
136 txn->tid = 0; in slim_do_transfer()
137 need_tid = slim_tid_txn(txn->mt, txn->mc); in slim_do_transfer()
140 ret = slim_alloc_txn_tid(ctrl, txn); in slim_do_transfer()
144 if (!txn->msg->comp) in slim_do_transfer()
145 txn->comp = &done; in slim_do_transfer()
147 txn->comp = txn->comp; in slim_do_transfer()
150 ret = ctrl->xfer_msg(ctrl, txn); in slim_do_transfer()
152 if (!ret && need_tid && !txn->msg->comp) { in slim_do_transfer()
153 unsigned long ms = txn->rl + HZ; in slim_do_transfer()
155 time_left = wait_for_completion_timeout(txn->comp, in slim_do_transfer()
159 slim_free_txn_tid(ctrl, txn); in slim_do_transfer()
165 txn->mt, txn->mc, txn->la, ret); in slim_do_transfer()
168 if (!clk_pause_msg && (txn->tid == 0 || ret == -ETIMEDOUT)) { in slim_do_transfer()
238 struct slim_msg_txn *txn = &txn_stack; in slim_xfer_msg() local
255 txn->ec = ((sl | (1 << 3)) | ((msg->start_offset & 0xFFF) << 4)); in slim_xfer_msg()
262 txn->rl += msg->num_bytes; in slim_xfer_msg()
268 if (slim_tid_txn(txn->mt, txn->mc)) in slim_xfer_msg()
269 txn->rl++; in slim_xfer_msg()
271 return slim_do_transfer(ctrl, txn); in slim_xfer_msg()