Lines Matching refs:mcs_compl
567 struct multi_cs_completion *mcs_compl; in force_complete_multi_cs() local
569 mcs_compl = &hdev->multi_cs_completion[i]; in force_complete_multi_cs()
571 spin_lock(&mcs_compl->lock); in force_complete_multi_cs()
573 if (!mcs_compl->used) { in force_complete_multi_cs()
574 spin_unlock(&mcs_compl->lock); in force_complete_multi_cs()
586 complete_all(&mcs_compl->completion); in force_complete_multi_cs()
587 spin_unlock(&mcs_compl->lock); in force_complete_multi_cs()
616 struct multi_cs_completion *mcs_compl; in complete_multi_cs() local
618 mcs_compl = &hdev->multi_cs_completion[i]; in complete_multi_cs()
619 if (!mcs_compl->used) in complete_multi_cs()
622 spin_lock(&mcs_compl->lock); in complete_multi_cs()
630 if (mcs_compl->used && in complete_multi_cs()
632 mcs_compl->stream_master_qid_map)) { in complete_multi_cs()
634 if (!mcs_compl->timestamp) in complete_multi_cs()
635 mcs_compl->timestamp = ktime_to_ns(fence->timestamp); in complete_multi_cs()
637 complete_all(&mcs_compl->completion); in complete_multi_cs()
649 spin_unlock(&mcs_compl->lock); in complete_multi_cs()
2735 static int hl_cs_poll_fences(struct multi_cs_data *mcs_data, struct multi_cs_completion *mcs_compl) in hl_cs_poll_fences() argument
2758 reinit_completion(&mcs_compl->completion); in hl_cs_poll_fences()
2783 mcs_compl->stream_master_qid_map |= fence->stream_master_qid_map; in hl_cs_poll_fences()
2817 complete_all(&mcs_compl->completion); in hl_cs_poll_fences()
2909 struct multi_cs_completion *mcs_compl; in hl_wait_multi_cs_completion_init() local
2914 mcs_compl = &hdev->multi_cs_completion[i]; in hl_wait_multi_cs_completion_init()
2915 spin_lock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2916 if (!mcs_compl->used) { in hl_wait_multi_cs_completion_init()
2917 mcs_compl->used = 1; in hl_wait_multi_cs_completion_init()
2918 mcs_compl->timestamp = 0; in hl_wait_multi_cs_completion_init()
2923 mcs_compl->stream_master_qid_map = 0; in hl_wait_multi_cs_completion_init()
2924 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2927 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2934 return mcs_compl; in hl_wait_multi_cs_completion_init()
2944 struct multi_cs_completion *mcs_compl) in hl_wait_multi_cs_completion_fini() argument
2950 spin_lock(&mcs_compl->lock); in hl_wait_multi_cs_completion_fini()
2951 mcs_compl->used = 0; in hl_wait_multi_cs_completion_fini()
2952 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_fini()
2963 struct multi_cs_completion *mcs_compl) in hl_wait_multi_cs_completion() argument
2967 completion_rc = wait_for_completion_interruptible_timeout(&mcs_compl->completion, in hl_wait_multi_cs_completion()
2972 mcs_data->timestamp = mcs_compl->timestamp; in hl_wait_multi_cs_completion()
3009 struct multi_cs_completion *mcs_compl; in hl_multi_cs_wait_ioctl() local
3072 mcs_compl = hl_wait_multi_cs_completion_init(hdev); in hl_multi_cs_wait_ioctl()
3073 if (IS_ERR(mcs_compl)) { in hl_multi_cs_wait_ioctl()
3074 rc = PTR_ERR(mcs_compl); in hl_multi_cs_wait_ioctl()
3080 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3091 rc = hl_wait_multi_cs_completion(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3100 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3115 mcs_compl->timestamp = 0; in hl_multi_cs_wait_ioctl()
3119 hl_wait_multi_cs_completion_fini(mcs_compl); in hl_multi_cs_wait_ioctl()