]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: venus: core: remove CNOC voting while device suspend
authorMansur Alisha Shaik <mansur@codeaurora.org>
Fri, 10 Apr 2020 07:17:25 +0000 (09:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:29 +0000 (09:32 +0200)
[ Upstream commit 07f8f22a33a9e3e9955e24a84e2f856dcc8c31c4 ]

The Venus driver is voting Configuration NoC during .probe but not clear
voting in .suspend. Because of this NoC is up during shutdown also. As a
consequence the whole device could leak energy while in .suspend.

So correct this by moving voting in .resume and unvoting
in .suspend

Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/qcom/venus/core.c

index 194b10b987672a2b98a972850c192dd1126bea3a..13fa5076314c062cf5eebf0d2fdd2683eaf07924 100644 (file)
@@ -242,10 +242,6 @@ static int venus_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
-       if (ret)
-               return ret;
-
        ret = hfi_create(core, &venus_core_ops);
        if (ret)
                return ret;
@@ -350,6 +346,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
        if (ret)
                return ret;
 
+       ret = icc_set_bw(core->cpucfg_path, 0, 0);
+       if (ret)
+               return ret;
+
        if (pm_ops->core_power)
                ret = pm_ops->core_power(dev, POWER_OFF);
 
@@ -368,6 +368,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
                        return ret;
        }
 
+       ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
+       if (ret)
+               return ret;
+
        return hfi_core_resume(core, false);
 }