[PATCH 2/3] clk: Do not let the enable count of critical clocks go below 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The enable count of critical clocks may not drop below 1. Otherwise
the new parent during a reparenting of a critical clock will not
be enabled.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/clk/clk.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 05bc21a6d4..5777c9c58e 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -84,12 +84,14 @@ void clk_disable(struct clk *clk)
 	if (!clk->enable_count)
 		return;
 
+	if (clk->enable_count == 1 && clk->flags & CLK_IS_CRITICAL) {
+		pr_warn("Disabling critical clock %s\n", clk->name);
+		return;
+	}
+
 	clk->enable_count--;
 
 	if (!clk->enable_count) {
-		if (clk->flags & CLK_IS_CRITICAL)
-			return;
-
 		if (clk->ops->disable)
 			clk->ops->disable(clk);
 
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux