Files
android_kernel_xiaomi_sm8450/arch/arm/kernel
Linus Walleij a68becd1dc ARM: 7563/1: SMP_TWD: make setup()/stop() reentrant
It has been brought to my knowledge that the .setup()/.stop()
function pair in the SMP TWD is going to be called from atomic
contexts for CPUs coming and going, and then the
clk_prepare()/clk_unprepare() calls cannot be called
on subsequent .setup()/.stop() iterations. This is however
just the tip of an iceberg as the function pair is not
designed to be reentrant at all.

This change makes the SMP_TWD clock .setup()/.stop() pair reentrant
by splitting the .setup() function in three parts:

- One COMMON part that is executed the first time the first CPU
  in the TWD cluster is initialized. This will fetch the TWD
  clk for the cluster and prepare+enable it. If no clk is
  available it will calibrate the rate instead.

- One part that is executed the FIRST TIME a certain CPU is
  brought on-line. This initializes and sets up the clock event
  for a certain CPU.

- One part that is executed on every subsequent .setup() call.
  This will re-initialize the clock event. This is augmented
  to call the clk_enable()/clk_disable() pair properly.

Cc: Shawn Guo <shawn.guo@linaro.org>
Reported-by: Peter Chen <peter.chen@freescale.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-11-04 10:31:02 +00:00
..
2008-08-12 19:54:09 +01:00
2012-03-28 18:30:01 +01:00
2012-07-01 21:59:19 +08:00
2012-10-11 10:55:04 +01:00
2012-03-24 09:38:56 +00:00
2010-10-29 13:14:40 -05:00
2012-10-11 10:55:04 +01:00
2012-10-11 10:55:04 +01:00
2012-10-01 09:58:18 -04:00
2012-03-28 18:30:01 +01:00
2012-10-11 10:55:04 +01:00
2012-03-28 18:30:01 +01:00