tegra: hwpm: move clock-reset assert to func end

Clock/reset should be disabled/asserted after all register accesses.
Move la and hwpm clk/reset disable/assert to the end of
tegra_soc_hwpm_release().

THWPM-2

Change-Id: I8e71ec5a9251bf76d785d0dc23cc4c8edbb5267f
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2585981
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2021-08-26 17:21:56 -07:00
committed by mobile promotions
parent ba34af77a4
commit 93b933c955

View File

@@ -1605,14 +1605,6 @@ static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp)
}
hwpm->mem_bytes_dma_buf = NULL;
if (tegra_platform_is_silicon()) {
err = reset_control_assert(hwpm->hwpm_rst);
RELEASE_FAIL("hwpm reset assert failed");
err = reset_control_assert(hwpm->la_rst);
RELEASE_FAIL("la reset assert failed");
clk_disable_unprepare(hwpm->la_clk);
}
/* FIXME: Remove after verification */
/* Enable SLCG */
err = reg_rmw(hwpm, NULL, TEGRA_SOC_HWPM_PMA_DT,
@@ -1690,6 +1682,15 @@ static int tegra_soc_hwpm_release(struct inode *inode, struct file *filp)
}
}
}
if (tegra_platform_is_silicon()) {
err = reset_control_assert(hwpm->hwpm_rst);
RELEASE_FAIL("hwpm reset assert failed");
err = reset_control_assert(hwpm->la_rst);
RELEASE_FAIL("la reset assert failed");
clk_disable_unprepare(hwpm->la_clk);
}
return ret;
}