Part Number: TDA4VM
Hi team,
Reading and writing issue of node_desc_obj->flags regarding the Lines 573 and 234 in the framework/VX_target.c file in tiovx:
Corresponds to two functions: tivxTargetNodeDescNodeMarkComplete and tivxTargetNodeDescCanNodeExecute
This code is implemented on line 573: tivxFlagBitSet(&node_obj_desc->flags, TIVX_NODE_FLAG_IS_EXECUTED)
The code near line 573 of VX_target.c (in tivxTargetNodeDescNodeMarkComplete) is as follows:
static void tivxTargetNodeDescNodeMarkComplete(tivx_obj_desc_node_t *node_obj_desc, uint16_t *blocked_node_id)
{
/* check if any node is blocked on this node to get unblocked and complete execution
* This will be a node from next pipeline instance
*/
*blocked_node_id = node_obj_desc->blocked_node_id;
node_obj_desc->blocked_node_id = (vx_enum)TIVX_OBJ_DESC_INVALID;
node_obj_desc->state = TIVX_NODE_OBJ_DESC_STATE_IDLE;
tivxFlagBitSet(&node_obj_desc->flags, TIVX_NODE_FLAG_IS_EXECUTED); //my confused code
}
This code is implemented on line 234: tivxFlagIsBitSet(prev_node_obj_desc->flags, TIVX_NODE_FLAG_IS_EXECUTED)
The code near line 234 of VX_target.c (in tivxTargetNodeDescCanNodeExecute) is as follows:
static vx_bool tivxTargetNodeDescCanNodeExecute(
const tivx_obj_desc_node_t *node_obj_desc)
{
tivx_obj_desc_node_t *prev_node_obj_desc;
uint16_t prev_node_obj_desc_id;
uint16_t i;
vx_bool can_execute = (vx_bool)vx_true_e;
for(i=0; i<node_obj_desc->num_in_nodes; i++)
{
prev_node_obj_desc_id = node_obj_desc->in_node_id[i];
prev_node_obj_desc = (tivx_obj_desc_node_t*)tivxObjDescGet(prev_node_obj_desc_id);
if( tivxObjDescIsValidType( (tivx_obj_desc_t*)prev_node_obj_desc, TIVX_OBJ_DESC_NODE) != 0)
{
if( tivxFlagIsBitSet(prev_node_obj_desc->flags,
TIVX_NODE_FLAG_IS_EXECUTED) == (vx_bool)vx_false_e) //my confused
{
can_execute = (vx_bool)vx_false_e;
}
}
}
return can_execute;
}
If NodeA and NodeB are present in DSP0 and DSP1 respectively, the following occurs:
Once NodeA is complete, it will need to set the node_desc_obj->flags to TIVX_NODE_FLAG_IS_EXECUTED. NodeB is checking node_desc_obj->flags for NodeA on DSP1, and this flag for NodeA should be read at this time.
However, the customer thinks that the two nodes are on different CPUs and that the read and write of the same target memory should be synchronized, such as mutexes with global spin_lock. But there's no mutex here.
Mutex is not required to be locked because node_desc_obj is all share_mem of uncache, is this the case?
Could you help check this case? Thanks.
Best Regards,
Cherry
