struct gsi_trans_pool cmd_pool; /* command payload DMA pool */
spinlock_t spinlock; /* protects updates to the lists */
- struct list_head alloc; /* allocated, not committed */
struct list_head committed; /* committed, awaiting doorbell */
struct list_head pending; /* pending, awaiting completion */
struct list_head complete; /* completed, awaiting poll */
return &trans_info->trans[trans_id %= channel->tre_count];
}
-/* Move a transaction from the allocated list to the committed list */
+/* Move a transaction from allocated to committed state */
static void gsi_trans_move_committed(struct gsi_trans *trans)
{
struct gsi_channel *channel = &trans->gsi->channel[trans->channel_id];
spin_lock_bh(&trans_info->spinlock);
- list_move_tail(&trans->links, &trans_info->committed);
+ list_add_tail(&trans->links, &trans_info->committed);
spin_unlock_bh(&trans_info->spinlock);
memset(trans, 0, sizeof(*trans));
/* Initialize non-zero fields in the transaction */
+ INIT_LIST_HEAD(&trans->links);
trans->gsi = gsi;
trans->channel_id = channel_id;
trans->rsvd_count = tre_count;
/* This free transaction will now be allocated */
trans_info->free_id++;
- spin_lock_bh(&trans_info->spinlock);
-
- list_add_tail(&trans->links, &trans_info->alloc);
-
- spin_unlock_bh(&trans_info->spinlock);
-
return trans;
}
goto err_map_free;
spin_lock_init(&trans_info->spinlock);
- INIT_LIST_HEAD(&trans_info->alloc);
INIT_LIST_HEAD(&trans_info->committed);
INIT_LIST_HEAD(&trans_info->pending);
INIT_LIST_HEAD(&trans_info->complete);