]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
clk: renesas: rcar-gen3: Set state when registering SD clocks
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thu, 29 Nov 2018 00:15:38 +0000 (01:15 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:01 +0000 (14:23 -0300)
commitace4b663cdab983e9989387913a77eac68032d3c
treebc286220b7731a3ea87a784b78bd82b454a2a286
parent4751f7b6c0618b9993901bbabeaa53c1b35738a4
clk: renesas: rcar-gen3: Set state when registering SD clocks

BugLink: https://bugs.launchpad.net/bugs/1857158
[ Upstream commit ecda0a09fa9933bcd67e33c952f778f0872392ed ]

The driver tries to figure out which state a SD clock is in when the
clock is registered, instead of setting a known state. This can be
problematic for two reasons.

1. If the clock driver can't figure out the state of the clock,
   registration of the clock fails, and setting of a known state by a
   clock user is not possible.

2. The state of the clock depends on if and how the bootloader
   configured it. The driver only checks that the rate is known, not if
   the clock is stopped or not for example.

Fix this by setting a known state and making sure the clock is stopped.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/clk/renesas/rcar-gen3-cpg.c