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

Commit 1323aed9 authored by Jilai Wang's avatar Jilai Wang
Browse files

npu: Don't disable post clk if not enabled



If post clock is not enabled, don't disable it to avoid crash.

Change-Id: I422903fb2ccb6da5b4f892b9ef4185751ae929d9
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent cb0a5a67
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -536,6 +536,11 @@ static void npu_disable_core_clocks(struct npu_device *npu_dev)
	for (i = (npu_dev->core_clk_num)-1; i >= 0 ; i--) {
		if (npu_is_exclude_clock(core_clks[i].clk_name))
			continue;
		if (!npu_dev->host_ctx.fw_enabled) {
			if (npu_is_post_clock(npu_dev->core_clks[i].clk_name))
				continue;
		}

		pr_debug("disabling clock [%s]\n", core_clks[i].clk_name);
		clk_disable_unprepare(core_clks[i].clk);
	}