]> 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)
commita26ac9e1049ee6e73f698e5ae5a10f48c2861ddb
tree918902c319d8490b2c99b182f6d26b1f5450ab68
parentedacad5f6da3fa42e973798160211ecfefae5977
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: 3b200e76cd22 ("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