From c983eec6257854eee63b687c06ed2144f62bfc64 Mon Sep 17 00:00:00 2001 From: Johnny Liu Date: Wed, 2 Aug 2023 09:52:01 +0000 Subject: [PATCH] drivers: pva: skip vpu load reading when suspended WHen PVA is already suspended, there is no need to resume the device through nvhost_module_busy and send mailbox request to PVA for VPU load reading. It avoids switching CV power domain on and off. Bug 4168798 Signed-off-by: Johnny Liu Change-Id: Ib9ec4d4ded2b96ee8f76267e190087612d1e0468 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946818 Reviewed-by: svcacv Reviewed-by: Ninad Malwade Reviewed-by: Omar Nemri GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/pva/pva_debug.c | 26 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/video/tegra/host/pva/pva_debug.c b/drivers/video/tegra/host/pva/pva_debug.c index 172dee5d..68c5d26b 100644 --- a/drivers/video/tegra/host/pva/pva_debug.c +++ b/drivers/video/tegra/host/pva/pva_debug.c @@ -5,18 +5,21 @@ * PVA Debug Information file */ +#include +#include +#include #include #include -#include -#include -#include #include -#include -#include -#include +#include +#include #include -#include "pva.h" +#include +#include + #include + +#include "pva.h" #include "pva_vpu_ocd.h" #include "pva-fw-address-map.h" @@ -249,8 +252,13 @@ static void update_vpu_stats(struct pva *pva, bool stats_enabled) pva->vpu_util_info.stats_fw_buffer_va; u64 *vpu_stats = pva->vpu_util_info.vpu_stats; - if (vpu_stats == 0) - goto err_out; +#ifdef CONFIG_PM + if (pm_runtime_suspended(&pva->pdev->dev)) { + vpu_stats[0] = 0; + vpu_stats[1] = 0; + return; + } +#endif err = nvhost_module_busy(pva->pdev); if (err < 0) {