u32 timeout_us, u64 user_address,
u64 target_value, u16 interrupt_offset,
enum hl_cs_wait_status *status,
- bool take_timestamp, u64 *timestamp)
+ u64 *timestamp)
{
struct hl_user_pending_interrupt *pend;
struct hl_user_interrupt *interrupt;
hl_fence_init(&pend->fence, ULONG_MAX);
- pend->fence.take_timestamp = take_timestamp;
-
if (interrupt_offset == HL_COMMON_USER_INTERRUPT_ID)
interrupt = &hdev->common_user_interrupt;
else
goto remove_pending_user_interrupt;
}
- if (completion_value >= target_value)
+ if (completion_value >= target_value) {
*status = CS_WAIT_STATUS_COMPLETED;
- else
+ /* There was no interrupt, we assume the completion is now. */
+ pend->fence.timestamp = ktime_get();
+ } else
*status = CS_WAIT_STATUS_BUSY;
if (!timeout_us || (*status == CS_WAIT_STATUS_COMPLETED))
rc = _hl_interrupt_wait_ioctl(hdev, hpriv->ctx,
args->in.interrupt_timeout_us, args->in.addr,
args->in.target, interrupt_offset, &status,
- args->in.flags & HL_CS_FLAGS_TIMESTAMP,
×tamp);
if (rc) {
* masters QIDs that multi cs is waiting on
* @error: mark this fence with error
* @timestamp: timestamp upon completion
- * @take_timestamp: timestamp shall be taken upon completion
* @mcs_handling_done: indicates that corresponding command submission has
* finished msc handling, this does not mean it was part
* of the mcs
u32 stream_master_qid_map;
int error;
ktime_t timestamp;
- u8 take_timestamp;
u8 mcs_handling_done;
};
struct hl_user_interrupt *user_cq)
{
struct hl_user_pending_interrupt *pend;
+ ktime_t now = ktime_get();
spin_lock(&user_cq->wait_list_lock);
list_for_each_entry(pend, &user_cq->wait_list_head, wait_list_node) {
- if (pend->fence.take_timestamp)
- pend->fence.timestamp = ktime_get();
+ pend->fence.timestamp = now;
complete_all(&pend->fence.completion);
}
spin_unlock(&user_cq->wait_list_lock);