]> git.baikalelectronics.ru Git - kernel.git/commit
clk: aspeed: Prevent reset if clock is enabled
authorEddie James <eajames@linux.vnet.ibm.com>
Thu, 8 Mar 2018 20:57:20 +0000 (14:57 -0600)
committerStephen Boyd <sboyd@kernel.org>
Thu, 15 Mar 2018 18:13:49 +0000 (11:13 -0700)
commitd9a6a7cbffe25c366754e6b1260372bae08037e9
tree918902c319d8490b2c99b182f6d26b1f5450ab68
parentc3147bf7320f7926a49b064963b5445e7b91d471
clk: aspeed: Prevent reset if clock is enabled

According to the Aspeed specification, the reset and enable sequence
should be done when the clock is stopped. The specification doesn't
define behavior if the reset is done while the clock is enabled.

From testing on the AST2500, the LPC Controller has problems if the
clock is reset while enabled.

Therefore, check whether the clock is enabled or not before performing
the reset and enable sequence in the Aspeed clock driver.

Reported-by: Lei Yu <mine260309@gmail.com>
Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
Fixes: 5356c904a8aa ("clk: aspeed: Register gated clocks")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-aspeed.c