* [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled
@ 2017-03-27 11:01 Jon Hunter
2017-03-29 12:49 ` Peter De Schrijver
2017-04-04 14:06 ` Thierry Reding
0 siblings, 2 replies; 3+ messages in thread
From: Jon Hunter @ 2017-03-27 11:01 UTC (permalink / raw)
To: Peter De Schrijver, Prashant Gaikwad, Thierry Reding
Cc: Michael Turquette, Stephen Boyd, linux-clk, linux-tegra,
Jon Hunter
Commit 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
changed the tegra210_pllcx_set_defaults() function causing the PLL to
always be reset regardless of whether it is in-use. This function was
changed so that resetting of the PLL will only be skipped if the PLL
is enabled AND 'pllcx->params->defaults_set' is not true. However, the
'pllcx->params->defaults_set' is always true and hence, the PLL is now
always reset. This causes the boot to fail on the Tegra210 Smaug where
the PLL is already enabled and in-use. Fix this by only resetting the
PLL if not in-use and only printing the warning that the defaults are
not set after we have checked the default settings.
Fixes: 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
drivers/clk/tegra/clk-tegra210.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c
index 9897dc55676b..b56a104328fa 100644
--- a/drivers/clk/tegra/clk-tegra210.c
+++ b/drivers/clk/tegra/clk-tegra210.c
@@ -555,12 +555,12 @@ static void tegra210_pllcx_set_defaults(const char *name,
{
pllcx->params->defaults_set = true;
- if (readl_relaxed(clk_base + pllcx->params->base_reg) &
- PLL_ENABLE && !pllcx->params->defaults_set) {
+ if (readl_relaxed(clk_base + pllcx->params->base_reg) & PLL_ENABLE) {
/* PLL is ON: only check if defaults already set */
pllcx_check_defaults(pllcx->params);
- pr_warn("%s already enabled. Postponing set full defaults\n",
- name);
+ if (!pllcx->params->defaults_set)
+ pr_warn("%s already enabled. Postponing set full defaults\n",
+ name);
return;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled
2017-03-27 11:01 [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled Jon Hunter
@ 2017-03-29 12:49 ` Peter De Schrijver
2017-04-04 14:06 ` Thierry Reding
1 sibling, 0 replies; 3+ messages in thread
From: Peter De Schrijver @ 2017-03-29 12:49 UTC (permalink / raw)
To: Jon Hunter
Cc: Prashant Gaikwad, Thierry Reding, Michael Turquette, Stephen Boyd,
linux-clk, linux-tegra
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
On Mon, Mar 27, 2017 at 12:01:05PM +0100, Jon Hunter wrote:
> Commit 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
> changed the tegra210_pllcx_set_defaults() function causing the PLL to
> always be reset regardless of whether it is in-use. This function was
> changed so that resetting of the PLL will only be skipped if the PLL
> is enabled AND 'pllcx->params->defaults_set' is not true. However, the
> 'pllcx->params->defaults_set' is always true and hence, the PLL is now
> always reset. This causes the boot to fail on the Tegra210 Smaug where
> the PLL is already enabled and in-use. Fix this by only resetting the
> PLL if not in-use and only printing the warning that the defaults are
> not set after we have checked the default settings.
>
> Fixes: 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> drivers/clk/tegra/clk-tegra210.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c
> index 9897dc55676b..b56a104328fa 100644
> --- a/drivers/clk/tegra/clk-tegra210.c
> +++ b/drivers/clk/tegra/clk-tegra210.c
> @@ -555,12 +555,12 @@ static void tegra210_pllcx_set_defaults(const char *name,
> {
> pllcx->params->defaults_set = true;
>
> - if (readl_relaxed(clk_base + pllcx->params->base_reg) &
> - PLL_ENABLE && !pllcx->params->defaults_set) {
> + if (readl_relaxed(clk_base + pllcx->params->base_reg) & PLL_ENABLE) {
> /* PLL is ON: only check if defaults already set */
> pllcx_check_defaults(pllcx->params);
> - pr_warn("%s already enabled. Postponing set full defaults\n",
> - name);
> + if (!pllcx->params->defaults_set)
> + pr_warn("%s already enabled. Postponing set full defaults\n",
> + name);
> return;
> }
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled
2017-03-27 11:01 [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled Jon Hunter
2017-03-29 12:49 ` Peter De Schrijver
@ 2017-04-04 14:06 ` Thierry Reding
1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2017-04-04 14:06 UTC (permalink / raw)
To: Jon Hunter
Cc: Peter De Schrijver, Prashant Gaikwad, Michael Turquette,
Stephen Boyd, linux-clk, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
On Mon, Mar 27, 2017 at 12:01:05PM +0100, Jon Hunter wrote:
> Commit 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
> changed the tegra210_pllcx_set_defaults() function causing the PLL to
> always be reset regardless of whether it is in-use. This function was
> changed so that resetting of the PLL will only be skipped if the PLL
> is enabled AND 'pllcx->params->defaults_set' is not true. However, the
> 'pllcx->params->defaults_set' is always true and hence, the PLL is now
> always reset. This causes the boot to fail on the Tegra210 Smaug where
> the PLL is already enabled and in-use. Fix this by only resetting the
> PLL if not in-use and only printing the warning that the defaults are
> not set after we have checked the default settings.
>
> Fixes: 8dce89a1c2cf ("clk: tegra: Don't warn for PLL defaults unnecessarily")
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> drivers/clk/tegra/clk-tegra210.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to for-4.12/clk, thanks.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-04 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27 11:01 [PATCH] clk: tegra: Don't reset PLL-CX if it is already enabled Jon Hunter
2017-03-29 12:49 ` Peter De Schrijver
2017-04-04 14:06 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).