tegra: hwpm: fix bugs on ToT

- With latest changes, disable PMA triggers contained a bug related to
timeout checks. Reading register value in while loop was removed
accidentally.
Replace HWPM_TIMEOUT macro with do-while loop to check condition.
- Correct func enum used to release router.
- Correct MSS MCF IP and instance address stride.

Jira THWPM-41

Change-Id: I28b4b223c33992599332de39471fd80215e0c98b
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2713365
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Vedashree Vidwans
2022-05-16 17:14:35 -07:00
committed by mobile promotions
parent c220f9f46f
commit 787831388d
9 changed files with 98 additions and 68 deletions

View File

@@ -209,21 +209,27 @@ int tegra_hwpm_clear_mem_pipeline(struct tegra_soc_hwpm *hwpm)
/* Stream MEM_BYTES to clear pipeline */
if (hwpm->mem_bytes_kernel) {
bool timeout = false;
s32 timeout_msecs = 1000;
u32 sleep_msecs = 100;
u32 *mem_bytes_kernel_u32 = (u32 *)(hwpm->mem_bytes_kernel);
ret = hwpm->active_chip->stream_mem_bytes(hwpm);
if (ret != 0) {
do {
ret = hwpm->active_chip->stream_mem_bytes(hwpm);
if (ret != 0) {
tegra_hwpm_err(hwpm,
"Trigger mem_bytes streaming failed");
goto fail;
}
msleep(sleep_msecs);
timeout_msecs -= sleep_msecs;
} while ((*mem_bytes_kernel_u32 ==
TEGRA_SOC_HWPM_MEM_BYTES_INVALID) &&
(timeout_msecs > 0));
if (timeout_msecs <= 0) {
tegra_hwpm_err(hwpm,
"Failed to trigger mem_bytes streaming");
goto fail;
}
timeout = HWPM_TIMEOUT(*mem_bytes_kernel_u32 !=
TEGRA_SOC_HWPM_MEM_BYTES_INVALID,
"MEM_BYTES streaming");
if (timeout) {
ret = -EIO;
goto fail;
"Timeout expired for MEM_BYTES streaming");
return -ETIMEDOUT;
}
}