Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off

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 <hkallweit1@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>

authored by

Heiner Kallweit and committed by
Kevin Hilman
87f88732 3a2ad7bd

+5 -1
+5 -1
drivers/soc/amlogic/meson-gx-pwrc-vpu.c
··· 225 225 226 226 static void meson_gx_pwrc_vpu_shutdown(struct platform_device *pdev) 227 227 { 228 - meson_gx_pwrc_vpu_power_off(&vpu_hdmi_pd.genpd); 228 + bool powered_off; 229 + 230 + powered_off = meson_gx_pwrc_vpu_get_power(&vpu_hdmi_pd); 231 + if (!powered_off) 232 + meson_gx_pwrc_vpu_power_off(&vpu_hdmi_pd.genpd); 229 233 } 230 234 231 235 static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = {