From aef209f1f52771c4877febfa3025cf3f1ec26f0a Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Wed, 20 Oct 2021 12:59:07 -0700 Subject: [PATCH] tegra: soc_hwpm: update soc_hwpm_release logic Update soc_hwpm IP release logic to invoke hwpm_ip_pm only for reserved perfmons. Bug 3333031 Bug 3333042 Change-Id: I78ab369b0803de4ca326603fd97b21ea157c2eae Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2614689 Reviewed-by: svcacv Reviewed-by: svc_kernel_abi Reviewed-by: Seshendra Gadagottu Reviewed-by: Seema Khowala Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- tegra-soc-hwpm-ioctl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tegra-soc-hwpm-ioctl.c b/tegra-soc-hwpm-ioctl.c index bfd6472..17c7bfc 100644 --- a/tegra-soc-hwpm-ioctl.c +++ b/tegra-soc-hwpm-ioctl.c @@ -1462,20 +1462,20 @@ static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp) RELEASE_FAIL("Unable to disable PERFMON(0x%llx - 0x%llx)", aperture->start_pa, aperture->end_pa); - } - ip_ops = &hwpm->ip_info[aperture->dt_aperture]; - if (ip_ops && (*ip_ops->hwpm_ip_pm)) { - err = (*ip_ops->hwpm_ip_pm) - (ip_ops->ip_dev, false); - if (err) { - tegra_soc_hwpm_err( - "Enable Runtime PM(%d) Failed", - aperture->dt_aperture); + ip_ops = &hwpm->ip_info[aperture->dt_aperture]; + if (ip_ops && (*ip_ops->hwpm_ip_pm)) { + err = (*ip_ops->hwpm_ip_pm) + (ip_ops->ip_dev, false); + if (err) { + tegra_soc_hwpm_err( + "Enable Runtime PM(%d) Failed", + aperture->dt_aperture); + } + } else { + tegra_soc_hwpm_dbg( + "No Runtime PM(%d) for IP", + aperture->dt_aperture); } - } else { - tegra_soc_hwpm_dbg( - "No Runtime PM(%d) for IP", - aperture->dt_aperture); } } }