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

Commit a5aadd73 authored by Taniya Das's avatar Taniya Das Committed by Deepak Katragadda
Browse files

clk: Add separate function to print clocks enabled during suspend



When debug_suspend is set to true and the low power code invokes the
function to print the enabled clocks during suspend the function fails to
execute the do while loop in clock_debug_print_enabled_clocks, so separate
out the function to handle the same.

Change-Id: I014750637bc17c1107c7f0745d2d44caf6c96e62
Signed-off-by: default avatarTaniya Das <tdas@codeaurora.org>
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 607b49ce
Loading
Loading
Loading
Loading
+41 −2
Original line number Diff line number Diff line
@@ -2631,7 +2631,46 @@ do { \
		pr_info(fmt, ##__VA_ARGS__);		\
} while (0)

int clock_debug_print_clock(struct clk_core *c, struct seq_file *s)
/*
 * clock_debug_print_enabled_debug_suspend() - Print names of enabled clocks
 * during suspend.
 */
static void clock_debug_print_enabled_debug_suspend(struct seq_file *s)
{
	struct clk_core *core;
	int cnt = 0;

	if (!mutex_trylock(&clk_debug_lock))
		return;

	clock_debug_output(s, 0, "Enabled clocks:\n");

	hlist_for_each_entry(core, &clk_debug_list, debug_node) {
		if (!core || !core->prepare_count)
			continue;

		if (core->vdd_class)
			clock_debug_output(s, 0, " %s:%u:%u [%ld, %d]",
					core->name, core->prepare_count,
					core->enable_count, core->rate,
					clk_find_vdd_level(core, core->rate));

		else
			clock_debug_output(s, 0, " %s:%u:%u [%ld]",
					core->name, core->prepare_count,
					core->enable_count, core->rate);
		cnt++;
	}

	mutex_unlock(&clk_debug_lock);

	if (cnt)
		clock_debug_output(s, 0, "Enabled clock count: %d\n", cnt);
	else
		clock_debug_output(s, 0, "No clocks enabled.\n");
}

static int clock_debug_print_clock(struct clk_core *c, struct seq_file *s)
{
	char *start = "";
	struct clk *clk;
@@ -3005,7 +3044,7 @@ void clock_debug_print_enabled(void)
	if (likely(!debug_suspend))
		return;

	clock_debug_print_enabled_clocks(NULL);
	clock_debug_print_enabled_debug_suspend(NULL);
}
EXPORT_SYMBOL_GPL(clock_debug_print_enabled);

+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
 */

struct clk_hw;
struct clk_core;

#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,