]> asedeno.scripts.mit.edu Git - linux.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)
commit8a53fc511c5ec81347b981b438f68c3dde421608
tree918902c319d8490b2c99b182f6d26b1f5450ab68
parentd90c76bb61128ed9022b9418c31c4749764b6cd9
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: 15ed8ce5f84e ("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