From b6fa5596607c817c560d7517bad19dea2674a736 Mon Sep 17 00:00:00 2001 From: vasukis Date: Sat, 14 Sep 2024 22:47:02 +0000 Subject: [PATCH] tegra: hwpm: fix credit programming count logic The num_entries variable indicates the number of credit programming requests that is sent from user space test app. Current implementation has been configured to loop through this in such a way that leads to an additional loop. This change fixes the issue. Bug 4571175 Signed-off-by: vasukis Change-Id: Id9fd4315e5ef470c697bf2815e16b42e746edf45 Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3212369 Reviewed-by: Seema Khowala GVS: buildbot_gerritrpt --- drivers/tegra/hwpm/os/linux/regops_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tegra/hwpm/os/linux/regops_utils.c b/drivers/tegra/hwpm/os/linux/regops_utils.c index 2d2550f..0c3802e 100644 --- a/drivers/tegra/hwpm/os/linux/regops_utils.c +++ b/drivers/tegra/hwpm/os/linux/regops_utils.c @@ -244,7 +244,7 @@ int tegra_hwpm_credit_program(struct tegra_soc_hwpm *hwpm, return -EINVAL; } - for (idx = 0; idx <= credit_prog->num_entries; idx++) { + for (idx = 0; idx < credit_prog->num_entries; idx++) { //Extract the credit_info pointer for a given Credit packet. //This contains the num_credits param //which has to be updated in chip specific HALs.