From ae2a1e7dfc9e8c7118fb54df56af0fc1ec7e9a5d Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Thu, 8 Jul 2021 13:55:59 -0700 Subject: [PATCH] tegra: hwpm: redraft regops ioctl return status - As regops ioctl status is an output from kernel, the status cannot be invalid. So, remove TEGRA_SOC_HWPM_REG_OP_STATUS_INVALID define. - Redefine regops ioctl status to make SUCCESS equivalent to value 0. - Add TEGRA_SOC_HWPM_REG_OP_STATUS_WR_FAILED to indicate failure in regops write command. Bug 3335825 Change-Id: I31152f1ce2558fdf4c8829dd19fbcb9c87e20572 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2556234 Reviewed-by: svcacv Reviewed-by: Seema Khowala Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- tegra-soc-hwpm-ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tegra-soc-hwpm-ioctl.c b/tegra-soc-hwpm-ioctl.c index 35bdb1a..f027914 100644 --- a/tegra-soc-hwpm-ioctl.c +++ b/tegra-soc-hwpm-ioctl.c @@ -904,7 +904,7 @@ static int exec_reg_ops_ioctl(struct tegra_soc_hwpm *hwpm, reg_op->phys_addr, reg_op->mask_lo, reg_op->reg_val_lo, true, aperture->is_ip); if (ret < 0) { - REG_OP_FAIL(INVALID, + REG_OP_FAIL(WR_FAILED, "WR32 REGOP failed for register(0x%llx)", reg_op->phys_addr); } else { @@ -919,7 +919,7 @@ static int exec_reg_ops_ioctl(struct tegra_soc_hwpm *hwpm, reg_op->phys_addr, reg_op->mask_lo, reg_op->reg_val_lo, true, aperture->is_ip); if (ret < 0) { - REG_OP_FAIL(INVALID, + REG_OP_FAIL(WR_FAILED, "WR64 REGOP failed for register(0x%llx)", reg_op->phys_addr); continue; @@ -930,7 +930,7 @@ static int exec_reg_ops_ioctl(struct tegra_soc_hwpm *hwpm, reg_op->phys_addr + 4, reg_op->mask_hi, reg_op->reg_val_hi, true, aperture->is_ip); if (ret < 0) { - REG_OP_FAIL(INVALID, + REG_OP_FAIL(WR_FAILED, "WR64 REGOP failed for register(0x%llx)", reg_op->phys_addr + 4); } else {