struct list_head reqs_completed_list;
struct list_head reqs_aborted_list;
struct list_head reqs_free_list;
- int reqs_free_count;
};
/* ====== Command helper routines ===== */
spin_lock_irqsave(&sba->reqs_lock, flags);
req = list_first_entry_or_null(&sba->reqs_free_list,
struct sba_request, node);
- if (req) {
+ if (req)
list_move_tail(&req->node, &sba->reqs_alloc_list);
- sba->reqs_free_count--;
- }
spin_unlock_irqrestore(&sba->reqs_lock, flags);
if (!req)
return NULL;
list_move_tail(&req->node, &sba->reqs_free_list);
if (list_empty(&sba->reqs_active_list))
sba->reqs_fence = false;
- sba->reqs_free_count++;
}
static void sba_received_request(struct sba_request *req)
list_add_tail(&req->node, &sba->reqs_free_list);
}
- sba->reqs_free_count = sba->max_req;
-
return 0;
fail_free_cmds_pool: