Lines Matching refs:mcs_compl
549 struct multi_cs_completion *mcs_compl; in force_complete_multi_cs() local
551 mcs_compl = &hdev->multi_cs_completion[i]; in force_complete_multi_cs()
553 spin_lock(&mcs_compl->lock); in force_complete_multi_cs()
555 if (!mcs_compl->used) { in force_complete_multi_cs()
556 spin_unlock(&mcs_compl->lock); in force_complete_multi_cs()
568 complete_all(&mcs_compl->completion); in force_complete_multi_cs()
569 spin_unlock(&mcs_compl->lock); in force_complete_multi_cs()
598 struct multi_cs_completion *mcs_compl; in complete_multi_cs() local
600 mcs_compl = &hdev->multi_cs_completion[i]; in complete_multi_cs()
601 if (!mcs_compl->used) in complete_multi_cs()
604 spin_lock(&mcs_compl->lock); in complete_multi_cs()
612 if (mcs_compl->used && in complete_multi_cs()
614 mcs_compl->stream_master_qid_map)) { in complete_multi_cs()
616 if (!mcs_compl->timestamp) in complete_multi_cs()
617 mcs_compl->timestamp = ktime_to_ns(fence->timestamp); in complete_multi_cs()
619 complete_all(&mcs_compl->completion); in complete_multi_cs()
631 spin_unlock(&mcs_compl->lock); in complete_multi_cs()
2719 static int hl_cs_poll_fences(struct multi_cs_data *mcs_data, struct multi_cs_completion *mcs_compl) in hl_cs_poll_fences() argument
2742 reinit_completion(&mcs_compl->completion); in hl_cs_poll_fences()
2767 mcs_compl->stream_master_qid_map |= fence->stream_master_qid_map; in hl_cs_poll_fences()
2801 complete_all(&mcs_compl->completion); in hl_cs_poll_fences()
2893 struct multi_cs_completion *mcs_compl; in hl_wait_multi_cs_completion_init() local
2898 mcs_compl = &hdev->multi_cs_completion[i]; in hl_wait_multi_cs_completion_init()
2899 spin_lock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2900 if (!mcs_compl->used) { in hl_wait_multi_cs_completion_init()
2901 mcs_compl->used = 1; in hl_wait_multi_cs_completion_init()
2902 mcs_compl->timestamp = 0; in hl_wait_multi_cs_completion_init()
2907 mcs_compl->stream_master_qid_map = 0; in hl_wait_multi_cs_completion_init()
2908 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2911 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_init()
2918 return mcs_compl; in hl_wait_multi_cs_completion_init()
2928 struct multi_cs_completion *mcs_compl) in hl_wait_multi_cs_completion_fini() argument
2934 spin_lock(&mcs_compl->lock); in hl_wait_multi_cs_completion_fini()
2935 mcs_compl->used = 0; in hl_wait_multi_cs_completion_fini()
2936 spin_unlock(&mcs_compl->lock); in hl_wait_multi_cs_completion_fini()
2947 struct multi_cs_completion *mcs_compl) in hl_wait_multi_cs_completion() argument
2951 completion_rc = wait_for_completion_interruptible_timeout(&mcs_compl->completion, in hl_wait_multi_cs_completion()
2956 mcs_data->timestamp = mcs_compl->timestamp; in hl_wait_multi_cs_completion()
2993 struct multi_cs_completion *mcs_compl; in hl_multi_cs_wait_ioctl() local
3056 mcs_compl = hl_wait_multi_cs_completion_init(hdev); in hl_multi_cs_wait_ioctl()
3057 if (IS_ERR(mcs_compl)) { in hl_multi_cs_wait_ioctl()
3058 rc = PTR_ERR(mcs_compl); in hl_multi_cs_wait_ioctl()
3064 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3075 rc = hl_wait_multi_cs_completion(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3084 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3099 mcs_compl->timestamp = 0; in hl_multi_cs_wait_ioctl()
3103 hl_wait_multi_cs_completion_fini(mcs_compl); in hl_multi_cs_wait_ioctl()