Lines Matching refs:hif_ext_group

228 	struct hif_exec_context *hif_ext_group;  in hif_print_napi_latency_stats()  local
249 if (hif_state->hif_ext_group[i]) { in hif_print_napi_latency_stats()
250 hif_ext_group = hif_state->hif_ext_group[i]; in hif_print_napi_latency_stats()
254 i, hif_ext_group->tstamp); in hif_print_napi_latency_stats()
260 if (hif_ext_group->sched_latency_stats[j]) in hif_print_napi_latency_stats()
265 hif_ext_group-> in hif_print_napi_latency_stats()
286 struct hif_exec_context *hif_ext_group; in hif_clear_napi_stats() local
290 hif_ext_group = hif_state->hif_ext_group[i]; in hif_clear_napi_stats()
292 if (!hif_ext_group) in hif_clear_napi_stats()
295 qdf_mem_set(hif_ext_group->sched_latency_stats, in hif_clear_napi_stats()
296 sizeof(hif_ext_group->sched_latency_stats), in hif_clear_napi_stats()
326 struct hif_exec_context *hif_ext_group; in hif_print_napi_stats() local
341 (i < hif_state->hif_num_extgroup && hif_state->hif_ext_group[i]); in hif_print_napi_stats()
343 hif_ext_group = hif_state->hif_ext_group[i]; in hif_print_napi_stats()
345 napi_stats = &hif_ext_group->stats[j]; in hif_print_napi_stats()
381 struct hif_exec_context *hif_ext_group; in hif_print_napi_stats() local
389 if (hif_state->hif_ext_group[i]) { in hif_print_napi_stats()
390 hif_ext_group = hif_state->hif_ext_group[i]; in hif_print_napi_stats()
392 napi_stats = &(hif_ext_group->stats[j]); in hif_print_napi_stats()
424 void hif_exec_fill_poll_time_histogram(struct hif_exec_context *hif_ext_group) in hif_exec_fill_poll_time_histogram() argument
433 poll_time_ns = qdf_time_sched_clock() - hif_ext_group->poll_start_time; in hif_exec_fill_poll_time_histogram()
436 napi_stat = &hif_ext_group->stats[cpu_id]; in hif_exec_fill_poll_time_histogram()
437 if (poll_time_ns > hif_ext_group->stats[cpu_id].napi_max_poll_time) in hif_exec_fill_poll_time_histogram()
438 hif_ext_group->stats[cpu_id].napi_max_poll_time = poll_time_ns; in hif_exec_fill_poll_time_histogram()
452 static bool hif_exec_poll_should_yield(struct hif_exec_context *hif_ext_group) in hif_exec_poll_should_yield() argument
457 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_poll_should_yield()
460 poll_time_ns = qdf_time_sched_clock() - hif_ext_group->poll_start_time; in hif_exec_poll_should_yield()
465 hif_ext_group->stats[cpu_id].time_limit_reached++; in hif_exec_poll_should_yield()
466 hif_ext_group->force_break = true; in hif_exec_poll_should_yield()
476 struct hif_exec_context *hif_ext_group; in hif_exec_should_yield() local
483 hif_ext_group = hif_state->hif_ext_group[grp_id]; in hif_exec_should_yield()
485 if (hif_ext_group->type == HIF_EXEC_NAPI_TYPE) in hif_exec_should_yield()
486 ret_val = hif_exec_poll_should_yield(hif_ext_group); in hif_exec_should_yield()
501 void hif_exec_update_service_start_time(struct hif_exec_context *hif_ext_group) in hif_exec_update_service_start_time() argument
503 hif_ext_group->poll_start_time = qdf_time_sched_clock(); in hif_exec_update_service_start_time()
508 void hif_exec_update_service_start_time(struct hif_exec_context *hif_ext_group) in hif_exec_update_service_start_time() argument
513 void hif_exec_fill_poll_time_histogram(struct hif_exec_context *hif_ext_group) in hif_exec_fill_poll_time_histogram() argument
533 struct hif_exec_context *hif_ext_group = in hif_exec_tasklet_fn() local
535 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_tasklet_fn()
540 hif_ext_group->handler(hif_ext_group->context, HIF_MAX_BUDGET, in hif_exec_tasklet_fn()
543 if (hif_ext_group->work_complete(hif_ext_group, work_done)) { in hif_exec_tasklet_fn()
545 hif_ext_group->irq_enable(hif_ext_group); in hif_exec_tasklet_fn()
547 hif_exec_tasklet_schedule(hif_ext_group); in hif_exec_tasklet_fn()
558 static void hif_latency_profile_measure(struct hif_exec_context *hif_ext_group) in hif_latency_profile_measure() argument
565 if (cur_tstamp > hif_ext_group->tstamp) in hif_latency_profile_measure()
566 time_elapsed = (cur_tstamp - hif_ext_group->tstamp); in hif_latency_profile_measure()
568 time_elapsed = ~0x0 - (hif_ext_group->tstamp - cur_tstamp); in hif_latency_profile_measure()
570 hif_ext_group->tstamp = cur_tstamp; in hif_latency_profile_measure()
573 hif_ext_group->sched_latency_stats[0]++; in hif_latency_profile_measure()
575 hif_ext_group->sched_latency_stats[1]++; in hif_latency_profile_measure()
577 hif_ext_group->sched_latency_stats[2]++; in hif_latency_profile_measure()
579 hif_ext_group->sched_latency_stats[3]++; in hif_latency_profile_measure()
581 hif_ext_group->sched_latency_stats[4]++; in hif_latency_profile_measure()
583 hif_ext_group->sched_latency_stats[5]++; in hif_latency_profile_measure()
585 hif_ext_group->sched_latency_stats[6]++; in hif_latency_profile_measure()
587 hif_ext_group->sched_latency_stats[7]++; in hif_latency_profile_measure()
591 void hif_latency_profile_measure(struct hif_exec_context *hif_ext_group) in hif_latency_profile_measure() argument
603 static void hif_latency_profile_start(struct hif_exec_context *hif_ext_group) in hif_latency_profile_start() argument
605 hif_ext_group->tstamp = qdf_ktime_to_ms(qdf_ktime_get()); in hif_latency_profile_start()
609 void hif_latency_profile_start(struct hif_exec_context *hif_ext_group) in hif_latency_profile_start() argument
617 hif_is_force_napi_complete_required(struct hif_exec_context *hif_ext_group) in hif_is_force_napi_complete_required() argument
619 return qdf_atomic_inc_not_zero(&hif_ext_group->force_napi_complete); in hif_is_force_napi_complete_required()
623 hif_is_force_napi_complete_required(struct hif_exec_context *hif_ext_group) in hif_is_force_napi_complete_required() argument
637 hif_irq_disabled_time_limit_reached(struct hif_exec_context *hif_ext_group) in hif_irq_disabled_time_limit_reached() argument
641 if (hif_ext_group->type != HIF_EXEC_NAPI_TYPE) in hif_irq_disabled_time_limit_reached()
645 hif_ext_group->irq_disabled_start_time; in hif_irq_disabled_time_limit_reached()
647 hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id, in hif_irq_disabled_time_limit_reached()
666 struct hif_exec_context *hif_ext_group = &napi_exec_ctx->exec_ctx; in hif_exec_poll() local
667 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_poll()
671 int shift = hif_ext_group->scale_bin_shift; in hif_exec_poll()
675 hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id, in hif_exec_poll()
678 hif_ext_group->force_break = false; in hif_exec_poll()
679 hif_exec_update_service_start_time(hif_ext_group); in hif_exec_poll()
684 hif_latency_profile_measure(hif_ext_group); in hif_exec_poll()
686 work_done = hif_ext_group->handler(hif_ext_group->context, in hif_exec_poll()
691 if (hif_is_force_napi_complete_required(hif_ext_group)) { in hif_exec_poll()
698 (!hif_ext_group->force_break && work_done < normalized_budget) || in hif_exec_poll()
700 hif_irq_disabled_time_limit_reached(hif_ext_group)))) { in hif_exec_poll()
701 hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id, in hif_exec_poll()
705 hif_ext_group->irq_enable(hif_ext_group); in hif_exec_poll()
706 hif_ext_group->stats[cpu].napi_completes++; in hif_exec_poll()
710 hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id, in hif_exec_poll()
715 hif_ext_group->stats[cpu].napi_polls++; in hif_exec_poll()
716 hif_ext_group->stats[cpu].napi_workdone += actual_dones; in hif_exec_poll()
722 hif_exec_fill_poll_time_histogram(hif_ext_group); in hif_exec_poll()
854 return hif_state->hif_ext_group[id]; in hif_exec_get_ctx()
865 return hif_state->hif_ext_group[id]->os_irq[0]; in hif_get_int_ctx_irq_num()
875 struct hif_exec_context *hif_ext_group; in hif_configure_ext_group_interrupts() local
884 hif_ext_group = hif_state->hif_ext_group[i]; in hif_configure_ext_group_interrupts()
886 qdf_spinlock_create(&hif_ext_group->irq_lock); in hif_configure_ext_group_interrupts()
887 if (hif_ext_group->configured && in hif_configure_ext_group_interrupts()
888 hif_ext_group->irq_requested == false) { in hif_configure_ext_group_interrupts()
889 hif_ext_group->irq_enabled = true; in hif_configure_ext_group_interrupts()
890 status = hif_grp_irq_configure(scn, hif_ext_group); in hif_configure_ext_group_interrupts()
894 hif_ext_group->irq_enabled = false; in hif_configure_ext_group_interrupts()
974 struct hif_exec_context *hif_ext_group = context; in hif_ext_group_interrupt_handler() local
975 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_ext_group_interrupt_handler()
977 if (hif_ext_group->irq_requested) { in hif_ext_group_interrupt_handler()
978 hif_latency_profile_start(hif_ext_group); in hif_ext_group_interrupt_handler()
980 hif_record_event(hif_ext_group->hif, hif_ext_group->grp_id, in hif_ext_group_interrupt_handler()
983 hif_ext_group->irq_disable(hif_ext_group); in hif_ext_group_interrupt_handler()
986 hif_ext_group->irq_disabled_start_time = in hif_ext_group_interrupt_handler()
1006 hif_ext_group->sched_ops->schedule(hif_ext_group); in hif_ext_group_interrupt_handler()
1024 hif_state->hif_ext_group[i]->sched_ops->kill( in hif_exec_kill()
1025 hif_state->hif_ext_group[i]); in hif_exec_kill()
1032 hif_init_force_napi_complete(struct hif_exec_context *hif_ext_group) in hif_init_force_napi_complete() argument
1034 qdf_atomic_init(&hif_ext_group->force_napi_complete); in hif_init_force_napi_complete()
1038 hif_init_force_napi_complete(struct hif_exec_context *hif_ext_group) in hif_init_force_napi_complete() argument
1065 struct hif_exec_context *hif_ext_group; in hif_register_ext_group() local
1082 hif_ext_group = hif_exec_create(type, scale); in hif_register_ext_group()
1083 if (!hif_ext_group) in hif_register_ext_group()
1086 hif_state->hif_ext_group[hif_state->hif_num_extgroup] = in hif_register_ext_group()
1087 hif_ext_group; in hif_register_ext_group()
1089 hif_ext_group->numirq = numirq; in hif_register_ext_group()
1090 qdf_mem_copy(&hif_ext_group->irq[0], irq, numirq * sizeof(irq[0])); in hif_register_ext_group()
1091 hif_ext_group->context = cb_ctx; in hif_register_ext_group()
1092 hif_ext_group->handler = handler; in hif_register_ext_group()
1093 hif_ext_group->configured = true; in hif_register_ext_group()
1094 hif_ext_group->grp_id = hif_state->hif_num_extgroup; in hif_register_ext_group()
1095 hif_ext_group->hif = hif_ctx; in hif_register_ext_group()
1096 hif_ext_group->context_name = context_name; in hif_register_ext_group()
1097 hif_ext_group->type = type; in hif_register_ext_group()
1098 hif_init_force_napi_complete(hif_ext_group); in hif_register_ext_group()
1157 struct hif_exec_context *hif_ext_group; in hif_deregister_exec_group() local
1161 hif_ext_group = hif_state->hif_ext_group[i]; in hif_deregister_exec_group()
1163 if (!hif_ext_group) in hif_deregister_exec_group()
1168 hif_ext_group->grp_id, in hif_deregister_exec_group()
1169 hif_ext_group->context_name); in hif_deregister_exec_group()
1171 if (strcmp(hif_ext_group->context_name, context_name) == 0) { in hif_deregister_exec_group()
1172 hif_ext_group->sched_ops->kill(hif_ext_group); in hif_deregister_exec_group()
1173 hif_state->hif_ext_group[i] = NULL; in hif_deregister_exec_group()
1174 hif_exec_destroy(hif_ext_group); in hif_deregister_exec_group()