linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: tegra: Capitalization fixes
@ 2020-06-03 11:19 Thierry Reding
  2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
  2020-06-23  2:07 ` [PATCH 1/2] clk: tegra: Capitalization fixes Stephen Boyd
  0 siblings, 2 replies; 6+ messages in thread
From: Thierry Reding @ 2020-06-03 11:19 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Stephen Boyd, Jon Hunter, LABBE Corentin,
	Dmitry Osipenko, linux-clk, linux-tegra

From: Thierry Reding <treding@nvidia.com>

HW, XUSB and PLL are abbreviations and should be all-uppercase.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/clk/tegra/clk-pll.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index 0b212cf2e794..583d2ac61e9e 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -1663,7 +1663,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
 	pll_writel(val, PLLE_SS_CTRL, pll);
 	udelay(1);
 
-	/* Enable hw control of xusb brick pll */
+	/* Enable HW control of XUSB brick PLL */
 	val = pll_readl_misc(pll);
 	val &= ~PLLE_MISC_IDDQ_SW_CTRL;
 	pll_writel_misc(val, pll);
@@ -1686,7 +1686,7 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
 	val |= XUSBIO_PLL_CFG0_SEQ_ENABLE;
 	pll_writel(val, XUSBIO_PLL_CFG0, pll);
 
-	/* Enable hw control of SATA pll */
+	/* Enable HW control of SATA PLL */
 	val = pll_readl(SATA_PLL_CFG0, pll);
 	val &= ~SATA_PLL_CFG0_PADPLL_RESET_SWCTL;
 	val |= SATA_PLL_CFG0_PADPLL_USE_LOCKDET;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] clk: tegra: Always program PLL_E when enabled
  2020-06-03 11:19 [PATCH 1/2] clk: tegra: Capitalization fixes Thierry Reding
@ 2020-06-03 11:19 ` Thierry Reding
  2020-06-03 13:13   ` LABBE Corentin
                     ` (2 more replies)
  2020-06-23  2:07 ` [PATCH 1/2] clk: tegra: Capitalization fixes Stephen Boyd
  1 sibling, 3 replies; 6+ messages in thread
From: Thierry Reding @ 2020-06-03 11:19 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Stephen Boyd, Jon Hunter, LABBE Corentin,
	Dmitry Osipenko, linux-clk, linux-tegra

From: Thierry Reding <treding@nvidia.com>

Commit bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
added checks to avoid enabling PLLs that have already been enabled by
the bootloader. However, the PLL_E configuration inherited from the
bootloader isn't necessarily the one that is needed for the kernel.

This can cause SATA to fail like this:

    [    5.310270] phy phy-sata.6: phy poweron failed --> -110
    [    5.315604] tegra-ahci 70027000.sata: failed to power on AHCI controller: -110
    [    5.323022] tegra-ahci: probe of 70027000.sata failed with error -110

Fix this by always programming the PLL_E. This ensures that any mis-
configuration by the bootloader will be overwritten by the kernel.

Fixes: bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
Reported-by: LABBE Corentin <clabbe@baylibre.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/clk/tegra/clk-pll.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index 583d2ac61e9e..b2d39a66f0fa 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -1601,9 +1601,6 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
 	unsigned long flags = 0;
 	unsigned long input_rate;
 
-	if (clk_pll_is_enabled(hw))
-		return 0;
-
 	input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
 
 	if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] clk: tegra: Always program PLL_E when enabled
  2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
@ 2020-06-03 13:13   ` LABBE Corentin
  2020-06-03 14:04   ` Dmitry Osipenko
  2020-06-23  2:07   ` Stephen Boyd
  2 siblings, 0 replies; 6+ messages in thread
From: LABBE Corentin @ 2020-06-03 13:13 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Stephen Boyd, Jon Hunter, Dmitry Osipenko,
	linux-clk, linux-tegra

On Wed, Jun 03, 2020 at 01:19:23PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Commit bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> added checks to avoid enabling PLLs that have already been enabled by
> the bootloader. However, the PLL_E configuration inherited from the
> bootloader isn't necessarily the one that is needed for the kernel.
> 
> This can cause SATA to fail like this:
> 
>     [    5.310270] phy phy-sata.6: phy poweron failed --> -110
>     [    5.315604] tegra-ahci 70027000.sata: failed to power on AHCI controller: -110
>     [    5.323022] tegra-ahci: probe of 70027000.sata failed with error -110
> 
> Fix this by always programming the PLL_E. This ensures that any mis-
> configuration by the bootloader will be overwritten by the kernel.
> 
> Fixes: bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> Reported-by: LABBE Corentin <clabbe@baylibre.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/clk/tegra/clk-pll.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
> index 583d2ac61e9e..b2d39a66f0fa 100644
> --- a/drivers/clk/tegra/clk-pll.c
> +++ b/drivers/clk/tegra/clk-pll.c
> @@ -1601,9 +1601,6 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
>  	unsigned long flags = 0;
>  	unsigned long input_rate;
>  
> -	if (clk_pll_is_enabled(hw))
> -		return 0;
> -
>  	input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
>  
>  	if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
> -- 
> 2.24.1
> 

Tested-by: Corentin Labbe <clabbe@baylibre.com>

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] clk: tegra: Always program PLL_E when enabled
  2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
  2020-06-03 13:13   ` LABBE Corentin
@ 2020-06-03 14:04   ` Dmitry Osipenko
  2020-06-23  2:07   ` Stephen Boyd
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2020-06-03 14:04 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Stephen Boyd, Jon Hunter, LABBE Corentin,
	linux-clk, linux-tegra

03.06.2020 14:19, Thierry Reding пишет:
> From: Thierry Reding <treding@nvidia.com>
> 
> Commit bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> added checks to avoid enabling PLLs that have already been enabled by
> the bootloader. However, the PLL_E configuration inherited from the
> bootloader isn't necessarily the one that is needed for the kernel.
> 
> This can cause SATA to fail like this:
> 
>     [    5.310270] phy phy-sata.6: phy poweron failed --> -110
>     [    5.315604] tegra-ahci 70027000.sata: failed to power on AHCI controller: -110
>     [    5.323022] tegra-ahci: probe of 70027000.sata failed with error -110
> 
> Fix this by always programming the PLL_E. This ensures that any mis-
> configuration by the bootloader will be overwritten by the kernel.
> 
> Fixes: bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> Reported-by: LABBE Corentin <clabbe@baylibre.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/clk/tegra/clk-pll.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
> index 583d2ac61e9e..b2d39a66f0fa 100644
> --- a/drivers/clk/tegra/clk-pll.c
> +++ b/drivers/clk/tegra/clk-pll.c
> @@ -1601,9 +1601,6 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw)
>  	unsigned long flags = 0;
>  	unsigned long input_rate;
>  
> -	if (clk_pll_is_enabled(hw))
> -		return 0;
> -
>  	input_rate = clk_hw_get_rate(clk_hw_get_parent(hw));
>  
>  	if (_get_table_rate(hw, &sel, pll->params->fixed_rate, input_rate))
> 

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] clk: tegra: Capitalization fixes
  2020-06-03 11:19 [PATCH 1/2] clk: tegra: Capitalization fixes Thierry Reding
  2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
@ 2020-06-23  2:07 ` Stephen Boyd
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2020-06-23  2:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Jon Hunter, LABBE Corentin, Dmitry Osipenko,
	linux-clk, linux-tegra

Quoting Thierry Reding (2020-06-03 04:19:22)
> From: Thierry Reding <treding@nvidia.com>
> 
> HW, XUSB and PLL are abbreviations and should be all-uppercase.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] clk: tegra: Always program PLL_E when enabled
  2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
  2020-06-03 13:13   ` LABBE Corentin
  2020-06-03 14:04   ` Dmitry Osipenko
@ 2020-06-23  2:07   ` Stephen Boyd
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2020-06-23  2:07 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Michael Turquette, Jon Hunter, LABBE Corentin, Dmitry Osipenko,
	linux-clk, linux-tegra

Quoting Thierry Reding (2020-06-03 04:19:23)
> From: Thierry Reding <treding@nvidia.com>
> 
> Commit bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> added checks to avoid enabling PLLs that have already been enabled by
> the bootloader. However, the PLL_E configuration inherited from the
> bootloader isn't necessarily the one that is needed for the kernel.
> 
> This can cause SATA to fail like this:
> 
>     [    5.310270] phy phy-sata.6: phy poweron failed --> -110
>     [    5.315604] tegra-ahci 70027000.sata: failed to power on AHCI controller: -110
>     [    5.323022] tegra-ahci: probe of 70027000.sata failed with error -110
> 
> Fix this by always programming the PLL_E. This ensures that any mis-
> configuration by the bootloader will be overwritten by the kernel.
> 
> Fixes: bff1cef5f23a ("clk: tegra: Don't enable already enabled PLLs")
> Reported-by: LABBE Corentin <clabbe@baylibre.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-23  2:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 11:19 [PATCH 1/2] clk: tegra: Capitalization fixes Thierry Reding
2020-06-03 11:19 ` [PATCH 2/2] clk: tegra: Always program PLL_E when enabled Thierry Reding
2020-06-03 13:13   ` LABBE Corentin
2020-06-03 14:04   ` Dmitry Osipenko
2020-06-23  2:07   ` Stephen Boyd
2020-06-23  2:07 ` [PATCH 1/2] clk: tegra: Capitalization fixes Stephen Boyd

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).