Shawn Guo
63288b721a
ARM: imx: fix shared gate clock
...
Let's say clock A and B are two gate clocks that share the same register
bit in hardware. Therefore they are registered as shared gate clocks
with imx_clk_gate2_shared().
In a scenario that only clock A is enabled by clk_enable(A) while B is
not used, the shared gate will be unexpectedly disabled in hardware.
It happens because clk_enable(A) increments the share_count from 0 to 1,
while clock B is unused to clock core, and therefore the core function
will just disable B by calling clk->ops->disable() directly. The
consequence of that call is share_count is decremented to 0 and the gate
is disabled in hardware, even though clock A is still in use.
The patch fixes the issue by initializing the share_count per hardware
state and returns enable state per share_count from .is_enabled() hook,
in case it's a shared gate.
While at it, add a check in clk_gate2_disable() to ensure it's never
called with a zero share_count.
Reported-by: Fabio Estevam <fabio.estevam@freescale.com>
Fixes: f9f28cdf2167 ("ARM: imx: add shared gate clock support")
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
2014-07-07 21:21:11 -07:00
..
2014-06-02 16:15:12 -07:00
2012-10-15 10:05:43 +08:00
2012-10-15 09:18:14 +08:00
2013-10-21 09:13:13 +08:00
2014-05-12 22:58:51 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2013-05-02 08:56:55 -07:00
2013-08-16 13:11:24 +08:00
2013-09-17 10:04:23 +08:00
2014-07-07 21:21:11 -07:00
2014-05-16 15:39:07 +08:00
2014-05-12 22:58:49 +08:00
2014-06-17 21:11:18 +08:00
2014-05-16 15:35:19 +08:00
2014-03-05 10:35:09 +08:00
2014-05-16 22:51:34 +08:00
2014-05-12 22:58:50 +08:00
2014-05-12 22:58:47 +08:00
2014-05-20 14:25:21 -05:00
2014-04-30 13:40:28 +08:00
2013-12-31 09:36:45 +08:00
2013-12-31 09:36:29 +08:00
2013-04-01 16:17:50 +08:00
2013-11-11 22:58:45 +08:00
2014-03-05 10:35:08 +08:00
2013-08-16 13:11:25 +08:00
2014-05-12 22:58:48 +08:00
2014-05-12 22:58:51 +08:00
2013-04-01 16:17:49 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2014-05-16 15:35:25 +08:00
2013-04-23 13:45:23 +02:00
2014-03-05 10:34:59 +08:00
2014-03-05 10:35:01 +08:00
2014-03-05 10:35:01 +08:00
2012-06-04 15:23:57 +02:00
2012-04-25 17:03:45 +02:00
2012-10-15 09:18:15 +08:00
2012-10-15 09:18:15 +08:00
2014-03-05 10:35:09 +08:00
2012-11-16 16:21:48 +01:00
2012-10-15 09:18:15 +08:00
2013-06-27 15:15:08 +02:00
2014-03-05 10:35:09 +08:00
2012-10-15 10:05:43 +08:00
2012-11-30 09:27:57 -08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-11-30 09:27:57 -08:00
2013-10-21 09:11:05 +08:00
2013-04-03 16:50:54 +08:00
2013-06-27 15:15:08 +02:00
2013-06-27 15:15:08 +02:00
2012-10-15 09:18:14 +08:00
2013-10-21 09:39:26 +08:00
2014-03-05 10:35:10 +08:00
2014-03-05 10:48:26 +08:00
2013-10-21 09:37:31 +08:00
2012-10-15 10:03:10 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2013-04-01 16:17:48 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 09:18:14 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 09:18:14 +08:00
2013-06-17 15:45:14 +08:00
2013-12-09 13:18:25 +08:00
2014-06-24 13:59:00 -07:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-03-05 10:40:48 +08:00
2014-03-05 10:35:10 +08:00
2014-05-16 15:35:25 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2012-10-15 10:03:10 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-12 22:58:51 +08:00
2014-05-30 00:49:28 +01:00
2014-05-12 22:58:51 +08:00
2014-05-16 15:35:25 +08:00
2013-06-17 15:45:10 +08:00
2013-07-03 09:46:29 -07:00
2013-12-09 13:18:24 +08:00
2013-06-17 15:45:10 +08:00
2013-08-26 20:47:16 +05:30
2013-06-17 15:45:10 +08:00
2013-01-03 15:57:04 -08:00
2012-09-14 11:17:21 +02:00
2010-06-30 08:59:44 +02:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2013-07-15 08:28:07 +08:00
2012-10-15 10:05:43 +08:00
2013-10-21 09:11:05 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2012-10-15 10:05:43 +08:00
2014-05-16 15:35:25 +08:00
2012-05-08 20:36:16 +08:00
2012-10-15 10:05:43 +08:00
2013-12-11 16:24:34 -08:00
2012-10-15 10:05:43 +08:00
2013-08-22 23:20:45 +08:00
2014-04-05 14:19:54 -07:00
2012-10-15 10:05:43 +08:00
2013-11-11 22:58:43 +08:00
2012-10-15 10:02:19 +08:00
2012-10-15 10:02:19 +08:00
2014-05-30 00:49:24 +01:00
2014-05-30 00:49:22 +01:00
2014-04-30 13:40:28 +08:00
2014-05-12 22:58:51 +08:00
2013-06-17 15:45:16 +08:00