soc: amlogic: meson-gx-pwrc-vpu: fix two issues
cover soc: amlogic: meson-gx-pwrc-vpu: fix two issues
This series fixes two issues, one being more cosmetic and the other one causing errors during shutdown.
Heiner Kallweit (2):
soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off
drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.15.1
PATCH 1/2 soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
The error message may be misleading in case of probe deferral (happens on my Odroid-C2). Therefore don't print it in this case.
--- drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/amlogic/meson-gx-pwrc-vpu.c +2 -1
@@ -184,7 +184,8 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) rstc =devm_reset_control_array_get (&pdev->dev, false, false);if (IS_ERR (rstc)) { -dev_err (&pdev->dev,"failed to get reset lines\n" ); +if (PTR_ERR (rstc) != -EPROBE_DEFER ) +dev_err (&pdev->dev,"failed to get reset lines\n" );return PTR_ERR (rstc); }
Signature · 1 line
2.15.1
PATCH 1/2 soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
Quoted 15 lines · Heiner Kallweit
The error message may be misleading in case of probe deferral (happens on my Odroid-C2). Therefore don't print it in this case.
Fixes 75fcb5ca4b46 "soc: amlogic: add Meson GX VPU Domains driver"Signed-off-by Heiner Kallweit <[email protected]>--- drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/soc/amlogic/meson-gx-pwrc-vpu.c +0
-0
drivers/soc/amlogic/meson-gx-pwrc-vpu.c static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) · line 191
Quoted 9 lines
drivers/soc/amlogic/meson-gx-pwrc-vpu.c +2
-1@@ -184,7 +184,8 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) rstc =devm_reset_control_array_get (&pdev->dev, false, false);if (IS_ERR (rstc)) { -dev_err (&pdev->dev,"failed to get reset lines\n" ); +if (PTR_ERR (rstc) != -EPROBE_DEFER ) +dev_err (&pdev->dev,"failed to get reset lines\n" );return PTR_ERR (rstc); }
This will definitely help removing this useless message when booting nominally.
PATCH 2/2 soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off
In reply to Heiner KallweitWhen operating the system headless headless, the domain is never powered on, leaving the clocks disabled. The shutdown function then tries to disable the already disabled clocks, resulting in errors. Therefore call meson_gx_pwrc_vpu_power_off() only if domain is powered on.
This patch fixes the described issue on my system (Odorid-C2).
--- drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/soc/amlogic/meson-gx-pwrc-vpu.c +5 -1
@@ -225,7 +225,11 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)static void meson_gx_pwrc_vpu_shutdown (struct platform_device *pdev) { -meson_gx_pwrc_vpu_power_off (&vpu_hdmi_pd.genpd); +bool powered_off; + + powered_off =meson_gx_pwrc_vpu_get_power (&vpu_hdmi_pd); +if (!powered_off) +meson_gx_pwrc_vpu_power_off (&vpu_hdmi_pd.genpd); }static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = {
Signature · 1 line
2.15.1
PATCH 2/2 soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off
Quoted 21 lines · Heiner Kallweit
When operating the system headless headless, the domain is never powered on, leaving the clocks disabled. The shutdown function then tries to disable the already disabled clocks, resulting in errors. Therefore call
meson_gx_pwrc_vpu_power_off()only if domain is powered on.
This patch fixes the described issue on my system (Odorid-C2).Fixes 339cd0ea0822 "soc: amlogic: meson-gx-pwrc-vpu: fix power-off when powered by bootloader"Signed-off-by Heiner Kallweit <[email protected]>--- drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/soc/amlogic/meson-gx-pwrc-vpu.c +0
-0@@ -225,7 +225,11 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)static void meson_gx_pwrc_vpu_shutdown (struct platform_device *pdev)
drivers/soc/amlogic/meson-gx-pwrc-vpu.c static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) · line 235
Quoted 10 lines
drivers/soc/amlogic/meson-gx-pwrc-vpu.c +5
-1{ -meson_gx_pwrc_vpu_power_off (&vpu_hdmi_pd.genpd); +bool powered_off; + + powered_off =meson_gx_pwrc_vpu_get_power (&vpu_hdmi_pd); +if (!powered_off) +meson_gx_pwrc_vpu_power_off (&vpu_hdmi_pd.genpd); }static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = {
Ok, this occurs using mainline U-Boot, but with Meson DRM driver disabled, this use case should be covered.
cover soc: amlogic: meson-gx-pwrc-vpu: fix two issues
In reply to Heiner KallweitHi Heiner,
Quoted 6 lines · Heiner Kallweit
This series fixes two issues, one being more cosmetic and the other one causing errors during shutdown.
Heiner Kallweit (2):
soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off
Queued for v4.17 with Neil's tags. (branch: v4.17/drivers)
Thanks for the cleanups!
Kevin