PM / devfreq: tegra30: Improve initial hardware resetting
Subsystems (3)
Dmitry Osipenko
maintainerPATCH 1/1 PM / devfreq: tegra30: Improve initial hardware resetting
It's safe to enable the ACTMON clock at any time during driver probing, even if we don't know the state of hardware, because it's used only for collecting and processing stats, and interrupt is kept disabled. This allows us to slightly improve code which performs initial hardware resetting by making use of a single reset_control_reset() instead of assert/deassert pair. Secondly, a potential error of the reset-control API is handled nicely now.
--- drivers/devfreq/tegra30-devfreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/devfreq/tegra30-devfreq.c +5 -3
@@ -822,8 +822,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; } -reset_control_assert (tegra->reset); - err =clk_prepare_enable (tegra->clock);if (err) { dev_err(&pdev->dev,
@@ -831,7 +829,11 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; } -reset_control_deassert (tegra->reset); + err =reset_control_reset (tegra->reset); +if (err) { +dev_err (&pdev->dev,"Failed to reset hardware: %d\n" , err); + goto disable_clk; + } rate =clk_round_rate (tegra->emc_clock,ULONG_MAX );if (rate <0 ) {
Signature · 1 line
2.27.0
Quoted 30 lines · Dmitry Osipenko
It's safe to enable the ACTMON clock at any time during driver probing, even if we don't know the state of hardware, because it's used only for collecting and processing stats, and interrupt is kept disabled. This allows us to slightly improve code which performs initial hardware resetting by making use of a single
reset_control_reset()instead of assert/deassert pair. Secondly, a potential error of the reset-control API is handled nicely now.Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/devfreq/tegra30-devfreq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/devfreq/tegra30-devfreq.c +0
-2@@ -822,8 +822,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; } -reset_control_assert (tegra->reset); - err =clk_prepare_enable (tegra->clock);if (err) { dev_err(&pdev->dev,@@ -831,7 +829,11 @@ static int tegra_devfreq_probe(struct platform_device *pdev)return err; }
drivers/devfreq/tegra30-devfreq.c static int tegra_devfreq_probe(struct platform_device *pdev) · line 839
Quoted 10 lines
drivers/devfreq/tegra30-devfreq.c +5
-1-reset_control_deassert (tegra->reset); + err =reset_control_reset (tegra->reset); +if (err) { +dev_err (&pdev->dev,"Failed to reset hardware: %d\n" , err); + goto disable_clk; + } rate =clk_round_rate (tegra->emc_clock,ULONG_MAX );if (rate <0 ) {
Applied it. Thanks.
Signature · 3 lines
Best Regards, Chanwoo Choi Samsung Electronics