sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * mark_cmd_complete() - Move a command to complete state
 *
 * Commands are marked complete in two ways
 *  1. Through polling of CUs or polling of MB status register
 *  2. Through interrupts from MB
 * In both cases, the completed commands are residing in the completed_cmds
 * list and the number of completed commands is reflected in num_completed.
 *
 * @xcmd: Command to mark complete
 *
 * The command is removed from the slot it occupies in the device command
 * queue. The slot is released so new commands can be submitted.  The host
 * is notified that some command has completed.
 */
Move a command to complete state
Commands are marked complete in two ways
1. Through polling of CUs or polling of MB status register
2. Through interrupts from MB
In both cases, the completed commands are residing in the completed_cmds
list and the number of completed commands is reflected in num_completed.

@xcmd: Command to mark complete

The command is removed from the slot it occupies in the device command
queue. The slot is released so new commands can be submitted.  The host
is notified that some command has completed.
Move a command to complete state Commands are marked complete in two ways 1 . Through polling of CUs or polling of MB status register 2 . Through interrupts from MB In both cases the completed commands are residing in the completed_cmds list and the number of completed commands is reflected in num_completed . @xcmd : Command to mark complete The command is removed from the slot it occupies in the device command queue . The slot is released so new commands can be submitted . The host is notified that some command has completed .
static void
mark_cmd_complete(struct xocl_cmd *xcmd)
{
	SCHED_DEBUGF("-> mark_cmd_complete(,%d)\n",xcmd->slot_idx);
	xcmd->xdev->exec.submitted_cmds[xcmd->slot_idx] = NULL;
	set_cmd_state(xcmd,ERT_CMD_STATE_COMPLETED);
	if (xcmd->xdev->exec.polling_mode)
		atomic_dec(&xcmd->xs->poll);
	release_slot_idx(xcmd->xdev,xcmd->slot_idx);
	notify_host(xcmd);
	SCHED_DEBUGF("<- mark_cmd_complete\n");
}
static void mark_cmd_complete ( struct xocl_cmd * xcmd ) { SCHED_DEBUGF ( " \n " , xcmd -> slot_idx ) ; xcmd -> xdev -> exec . submitted_cmds [ xcmd -> slot_idx ] = NULL ; set_cmd_state ( xcmd , ERT_CMD_STATE_COMPLETED ) ; if ( xcmd -> xdev -> exec . polling_mode ) atomic_dec ( & xcmd -> xs -> poll ) ; release_slot_idx ( xcmd -> xdev , xcmd -> slot_idx ) ; notify_host ( xcmd ) ; SCHED_DEBUGF ( " \n " ) ; }
mark_cmd_complete() - Move a command to complete state
 Commands are marked complete in two ways
  1.
mark_cmd_complete () - Move a command to complete state Commands are marked complete in two ways 1 .