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

Commit 555fa365 authored by Yue Ma's avatar Yue Ma
Browse files

wcnss: Sample WCNSS TOP AHB clock on WCNSS WDOG bite



Sample the wcss_top_ahb_clk and determine whether or not the clock freq
is zero when the issue occurs. This will help confirm the reason for
the system reset when Apps tries to access PMU registers for logging
purposes.

Change-Id: Ia4f34a38b7e8d237b9e5ae935d9ce339ca2d6ed1
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent f0f3dd3b
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -655,8 +655,27 @@ EXPORT_SYMBOL(wcnss_pronto_log_debug_regs);
#ifdef CONFIG_WCNSS_REGISTER_DUMP_ON_BITE
void wcnss_log_debug_regs_on_bite(void)
{
	if (wcnss_hardware_type() == WCNSS_PRONTO_HW)
	struct platform_device *pdev = wcnss_get_platform_device();
	struct clk *measure;
	struct clk *wcnss_debug_mux;
	unsigned long clk_rate;

	if (wcnss_hardware_type() != WCNSS_PRONTO_HW)
		return;

	measure = clk_get(&pdev->dev, "measure");
	wcnss_debug_mux = clk_get(&pdev->dev, "wcnss_debug");

	if (!IS_ERR(measure) && !IS_ERR(wcnss_debug_mux)) {
		clk_set_parent(measure, wcnss_debug_mux);
		clk_rate = clk_get_rate(measure);
		pr_debug("wcnss: clock frequency is: %luHz\n", clk_rate);

		if (clk_rate)
			wcnss_pronto_log_debug_regs();
		else
			pr_err("clock frequency is zero, cannot access PMU or other registers\n");
	}
}
#endif