• Home
  • Raw
  • Download

Lines Matching refs:trans_info

238 	channel->trans_info.map[index % channel->tre_ring.count] = trans;  in gsi_channel_trans_map()
246 return channel->trans_info.map[index % channel->tre_ring.count]; in gsi_channel_trans_mapped()
252 return list_first_entry_or_null(&channel->trans_info.complete, in gsi_channel_trans_complete()
260 struct gsi_trans_info *trans_info = &channel->trans_info; in gsi_trans_move_pending() local
262 spin_lock_bh(&trans_info->spinlock); in gsi_trans_move_pending()
264 list_move_tail(&trans->links, &trans_info->pending); in gsi_trans_move_pending()
266 spin_unlock_bh(&trans_info->spinlock); in gsi_trans_move_pending()
275 struct gsi_trans_info *trans_info = &channel->trans_info; in gsi_trans_move_complete() local
278 spin_lock_bh(&trans_info->spinlock); in gsi_trans_move_complete()
281 list_cut_position(&list, &trans_info->pending, &trans->links); in gsi_trans_move_complete()
282 list_splice_tail(&list, &trans_info->complete); in gsi_trans_move_complete()
284 spin_unlock_bh(&trans_info->spinlock); in gsi_trans_move_complete()
291 struct gsi_trans_info *trans_info = &channel->trans_info; in gsi_trans_move_polled() local
293 spin_lock_bh(&trans_info->spinlock); in gsi_trans_move_polled()
295 list_move_tail(&trans->links, &trans_info->polled); in gsi_trans_move_polled()
297 spin_unlock_bh(&trans_info->spinlock); in gsi_trans_move_polled()
302 gsi_trans_tre_reserve(struct gsi_trans_info *trans_info, u32 tre_count) in gsi_trans_tre_reserve() argument
304 int avail = atomic_read(&trans_info->tre_avail); in gsi_trans_tre_reserve()
311 } while (!atomic_try_cmpxchg(&trans_info->tre_avail, &avail, new)); in gsi_trans_tre_reserve()
318 gsi_trans_tre_release(struct gsi_trans_info *trans_info, u32 tre_count) in gsi_trans_tre_release() argument
320 atomic_add(tre_count, &trans_info->tre_avail); in gsi_trans_tre_release()
329 struct gsi_trans_info *trans_info; in gsi_channel_trans_alloc() local
335 trans_info = &channel->trans_info; in gsi_channel_trans_alloc()
340 if (!gsi_trans_tre_reserve(trans_info, tre_count)) in gsi_channel_trans_alloc()
344 trans = gsi_trans_pool_alloc(&trans_info->pool, 1); in gsi_channel_trans_alloc()
351 trans->sgl = gsi_trans_pool_alloc(&trans_info->sg_pool, tre_count); in gsi_channel_trans_alloc()
356 spin_lock_bh(&trans_info->spinlock); in gsi_channel_trans_alloc()
358 list_add_tail(&trans->links, &trans_info->alloc); in gsi_channel_trans_alloc()
360 spin_unlock_bh(&trans_info->spinlock); in gsi_channel_trans_alloc()
371 struct gsi_trans_info *trans_info; in gsi_trans_free() local
378 trans_info = &trans->gsi->channel[trans->channel_id].trans_info; in gsi_trans_free()
380 spin_lock_bh(&trans_info->spinlock); in gsi_trans_free()
387 spin_unlock_bh(&trans_info->spinlock); in gsi_trans_free()
397 gsi_trans_tre_release(trans_info, trans->tre_count); in gsi_trans_free()
596 if (ring_db || !atomic_read(&channel->trans_info.tre_avail)) { in __gsi_trans_commit()
669 struct gsi_trans_info *trans_info = &channel->trans_info; in gsi_channel_trans_cancel_pending() local
674 spin_lock_bh(&trans_info->spinlock); in gsi_channel_trans_cancel_pending()
676 cancelled = !list_empty(&trans_info->pending); in gsi_channel_trans_cancel_pending()
677 list_for_each_entry(trans, &trans_info->pending, links) in gsi_channel_trans_cancel_pending()
680 list_splice_tail_init(&trans_info->pending, &trans_info->complete); in gsi_channel_trans_cancel_pending()
682 spin_unlock_bh(&trans_info->spinlock); in gsi_channel_trans_cancel_pending()
694 struct gsi_trans_info *trans_info; in gsi_trans_read_byte() local
697 trans_info = &channel->trans_info; in gsi_trans_read_byte()
700 if (!gsi_trans_tre_reserve(trans_info, 1)) in gsi_trans_read_byte()
719 gsi_trans_tre_release(&channel->trans_info, 1); in gsi_trans_read_byte_done()
726 struct gsi_trans_info *trans_info; in gsi_channel_trans_init() local
737 trans_info = &channel->trans_info; in gsi_channel_trans_init()
738 trans_info->map = kcalloc(channel->tre_count, sizeof(*trans_info->map), in gsi_channel_trans_init()
740 if (!trans_info->map) in gsi_channel_trans_init()
753 ret = gsi_trans_pool_init(&trans_info->pool, sizeof(struct gsi_trans), in gsi_channel_trans_init()
768 ret = gsi_trans_pool_init(&trans_info->sg_pool, in gsi_channel_trans_init()
781 atomic_set(&trans_info->tre_avail, tre_max); in gsi_channel_trans_init()
783 spin_lock_init(&trans_info->spinlock); in gsi_channel_trans_init()
784 INIT_LIST_HEAD(&trans_info->alloc); in gsi_channel_trans_init()
785 INIT_LIST_HEAD(&trans_info->pending); in gsi_channel_trans_init()
786 INIT_LIST_HEAD(&trans_info->complete); in gsi_channel_trans_init()
787 INIT_LIST_HEAD(&trans_info->polled); in gsi_channel_trans_init()
792 gsi_trans_pool_exit(&trans_info->pool); in gsi_channel_trans_init()
794 kfree(trans_info->map); in gsi_channel_trans_init()
805 struct gsi_trans_info *trans_info = &channel->trans_info; in gsi_channel_trans_exit() local
807 gsi_trans_pool_exit(&trans_info->sg_pool); in gsi_channel_trans_exit()
808 gsi_trans_pool_exit(&trans_info->pool); in gsi_channel_trans_exit()
809 kfree(trans_info->map); in gsi_channel_trans_exit()