qcacmn: Use REO block resource only if required

HAL REO flush cache command should use block resource only if cache
blocking is requested.

Change-Id: Ie52634cdb9908e4dfa12495dfc3d87a9d5d54c0b
CRs-Fixed: 2057946
This commit is contained in:
Karunakar Dasineni
2017-05-31 22:39:39 -07:00
committed by snandini
parent 6b0d2a800c
commit 4f886f3aa9
2 changed files with 20 additions and 16 deletions

View File

@@ -149,9 +149,9 @@ inline int hal_reo_cmd_flush_queue(void *reo_ring, struct hal_soc *soc,
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_QUEUE_2, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_QUEUE_2,
BLOCK_DESC_ADDR_USAGE_AFTER_FLUSH, BLOCK_DESC_ADDR_USAGE_AFTER_FLUSH,
cmd->u.fl_queue_params.use_after_flush); cmd->u.fl_queue_params.block_use_after_flush);
if (cmd->u.fl_queue_params.use_after_flush) { if (cmd->u.fl_queue_params.block_use_after_flush) {
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_QUEUE_2, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_QUEUE_2,
BLOCK_RESOURCE_INDEX, cmd->u.fl_queue_params.index); BLOCK_RESOURCE_INDEX, cmd->u.fl_queue_params.index);
} }
@@ -167,23 +167,25 @@ inline int hal_reo_cmd_flush_cache(void *reo_ring, struct hal_soc *soc,
{ {
uint32_t *reo_desc, val; uint32_t *reo_desc, val;
struct hal_reo_cmd_flush_cache_params *cp; struct hal_reo_cmd_flush_cache_params *cp;
uint8_t index; uint8_t index = 0;
cp = &cmd->u.fl_cache_params; cp = &cmd->u.fl_cache_params;
hal_srng_access_start(soc, reo_ring); hal_srng_access_start(soc, reo_ring);
index = hal_find_zero_bit(soc->reo_res_bitmap);
/* We need a cache block resource for this operation, and REO HW has /* We need a cache block resource for this operation, and REO HW has
* only 4 such blocking resources. These resources are managed using * only 4 such blocking resources. These resources are managed using
* reo_res_bitmap, and we return failure if none is available. * reo_res_bitmap, and we return failure if none is available.
*/ */
if (index > 3) { if (cp->block_use_after_flush) {
qdf_print("%s, No blocking resource available!\n", __func__); index = hal_find_zero_bit(soc->reo_res_bitmap);
hal_srng_access_end(soc, reo_ring); if (index > 3) {
return -EBUSY; qdf_print("%s, No blocking resource available!\n", __func__);
hal_srng_access_end(soc, reo_ring);
return -EBUSY;
}
soc->index = index;
} }
soc->index = index;
reo_desc = hal_srng_src_get_next(soc, reo_ring); reo_desc = hal_srng_src_get_next(soc, reo_ring);
if (!reo_desc) { if (!reo_desc) {
@@ -215,14 +217,16 @@ inline int hal_reo_cmd_flush_cache(void *reo_ring, struct hal_soc *soc,
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2,
RELEASE_CACHE_BLOCK_INDEX, cp->rel_block_index); RELEASE_CACHE_BLOCK_INDEX, cp->rel_block_index);
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, if (cp->block_use_after_flush) {
CACHE_BLOCK_RESOURCE_INDEX, index); HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2,
CACHE_BLOCK_RESOURCE_INDEX, index);
}
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2,
FLUSH_WITHOUT_INVALIDATE, cp->flush_no_inval); FLUSH_WITHOUT_INVALIDATE, cp->flush_no_inval);
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2,
BLOCK_CACHE_USAGE_AFTER_FLUSH, cp->use_after_flush); BLOCK_CACHE_USAGE_AFTER_FLUSH, cp->block_use_after_flush);
HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, FLUSH_ENTIRE_CACHE, HAL_DESC_SET_FIELD(reo_desc, REO_FLUSH_CACHE_2, FLUSH_ENTIRE_CACHE,
cp->flush_all); cp->flush_all);
@@ -276,8 +280,8 @@ inline int hal_reo_cmd_unblock_cache(void *reo_ring, struct hal_soc *soc,
if (cmd->u.unblk_cache_params.type == UNBLOCK_RES_INDEX) { if (cmd->u.unblk_cache_params.type == UNBLOCK_RES_INDEX) {
HAL_DESC_SET_FIELD(reo_desc, REO_UNBLOCK_CACHE_1, HAL_DESC_SET_FIELD(reo_desc, REO_UNBLOCK_CACHE_1,
CACHE_BLOCK_RESOURCE_INDEX, index); CACHE_BLOCK_RESOURCE_INDEX,
soc->index = index; cmd->u.unblk_cache_params.index);
} }
hal_srng_access_end(soc, reo_ring); hal_srng_access_end(soc, reo_ring);

View File

@@ -186,7 +186,7 @@ struct hal_reo_cmd_get_queue_stats_params {
* @index: Blocking resource to be used * @index: Blocking resource to be used
*/ */
struct hal_reo_cmd_flush_queue_params { struct hal_reo_cmd_flush_queue_params {
bool use_after_flush; bool block_use_after_flush;
uint8_t index; uint8_t index;
}; };
@@ -204,7 +204,7 @@ struct hal_reo_cmd_flush_cache_params {
bool rel_block_index; bool rel_block_index;
uint8_t cache_block_res_index; uint8_t cache_block_res_index;
bool flush_no_inval; bool flush_no_inval;
bool use_after_flush; bool block_use_after_flush;
bool flush_all; bool flush_all;
}; };