Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f974a2b authored by Prasad Sodagudi's avatar Prasad Sodagudi
Browse files

soc:qcom: Add support to log time taken ipi pings



In some cases there is no way to find which core
is taking long time for responding to pings. When
dumps are collected there is no way to find culprit
cpu details and exact task context disabled IRQs.
So add support for logging time taken for each ping.

Change-Id: Ifa6fb42413857c2b3fe15c8719faa1ab1a953069
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 18604f1e
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ struct msm_watchdog_data {

	bool timer_expired;
	bool user_pet_complete;
	unsigned long long timer_fired;
	unsigned long long thread_start;
	unsigned long long ping_start[NR_CPUS];
	unsigned long long ping_end[NR_CPUS];
};

/*
@@ -374,6 +378,7 @@ static void keep_alive_response(void *info)
	struct msm_watchdog_data *wdog_dd = (struct msm_watchdog_data *)info;

	cpumask_set_cpu(cpu, &wdog_dd->alive_mask);
	wdog_dd->ping_end[cpu] = sched_clock();
	/* Make sure alive mask is cleared and set in order */
	smp_mb();
}
@@ -390,17 +395,20 @@ static void ping_other_cpus(struct msm_watchdog_data *wdog_dd)
	/* Make sure alive mask is cleared and set in order */
	smp_mb();
	for_each_cpu(cpu, cpu_online_mask) {
		if (!cpu_idle_pc_state[cpu] && !cpu_isolated(cpu))
		if (!cpu_idle_pc_state[cpu] && !cpu_isolated(cpu)) {
			wdog_dd->ping_start[cpu] = sched_clock();
			smp_call_function_single(cpu, keep_alive_response,
						 wdog_dd, 1);
		}
	}
}

static void pet_task_wakeup(unsigned long data)
{
	struct msm_watchdog_data *wdog_dd =
		(struct msm_watchdog_data *)data;
	wdog_dd->timer_expired = true;
	wdog_dd->timer_fired = sched_clock();
	wake_up(&wdog_dd->pet_complete);
}

@@ -410,7 +418,7 @@ static __ref int watchdog_kthread(void *arg)
		(struct msm_watchdog_data *)arg;
	unsigned long delay_time = 0;
	struct sched_param param = {.sched_priority = MAX_RT_PRIO-1};
	int ret;
	int ret, cpu;

	sched_setscheduler(current, SCHED_FIFO, &param);
	while (!kthread_should_stop()) {
@@ -419,6 +427,10 @@ static __ref int watchdog_kthread(void *arg)
						wdog_dd->timer_expired);
		} while (ret != 0);

		wdog_dd->thread_start = sched_clock();
		for_each_cpu(cpu, cpu_present_mask)
			wdog_dd->ping_start[cpu] = wdog_dd->ping_end[cpu] = 0;

		if (wdog_dd->do_ipi_ping)
			ping_other_cpus(wdog_dd);