mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-24 02:07:34 +03:00
tegra: hwpm: clean up code and add bug fixes
- Create tegra_hwpm_element_enable() instead of directly using perfmon_enable() HAL. This will allow us to expand tegra_hwpm_element_enable in future. - Update log messages in ip structure init code and floorsweep info function. - It is possible that IP instances and elements to have 0 start range address. So, modify check for available elements to use range end instead. - Use tegra_hwpm_fake_readl() and tegra_hwpm_fake_writel() macros instead of fake_readl() and fake_write() functions. That way we have similar implementation of IO functions and macros can be used across OSes. - Check that reserve perfmon function is invoked only for HWPM components. This check will be useful for expansion in types of components in the future. - Clean up and rearrange tegra_hwpm_regops_readl_impl() and tegra_hwpm_regops_writel_impl() to have designated code corresponding to the element type. - Currently, device open and release functions are incorrectly using clock enable/disable functions instead of using HALs. Correct open and close functions to use lock HALs. - Currently, tegra_hwpm_update_mem_bytes() doesn't validate mem_mgmt structure allocation before accessing mem_bytes_kernel pointer. This can lead to kernel crash. Update tegra_hwpm_update_mem_bytes() to return error if mem_mgmt structure s not allocated. Jira THWPM-74 Change-Id: Ia40bd51187e5ea08572dbee81e577dacf5fb66b6 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> (cherry picked from commit 411f07484d68dfde0d350a5c67f2748e876b11b8) Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2888553 Reviewed-by: Adeel Raza <araza@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
5c6e6f4797
commit
4ecc672c3e
@@ -405,7 +405,7 @@ static int tegra_hwpm_open(struct inode *inode, struct file *filp)
|
||||
}
|
||||
|
||||
if (hwpm->active_chip->clk_rst_set_rate_enable) {
|
||||
ret = tegra_hwpm_clk_rst_set_rate_enable(hwpm_linux);
|
||||
ret = hwpm->active_chip->clk_rst_set_rate_enable(hwpm_linux);
|
||||
if (ret != 0) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -514,7 +514,7 @@ static int tegra_hwpm_release(struct inode *inode, struct file *filp)
|
||||
}
|
||||
|
||||
if (hwpm->active_chip->clk_rst_disable) {
|
||||
ret = tegra_hwpm_clk_rst_disable(hwpm_linux);
|
||||
ret = hwpm->active_chip->clk_rst_disable(hwpm_linux);
|
||||
if (ret != 0) {
|
||||
tegra_hwpm_err(hwpm, "Failed to release clock");
|
||||
err = ret;
|
||||
|
||||
Reference in New Issue
Block a user