From: Tomer Tayar Date: Mon, 17 Jan 2022 22:21:49 +0000 (+0200) Subject: habanalabs: use proper max_power variable for device utilization X-Git-Tag: v6.1-rc5~1693^2~59^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35629bc171b642d5f0bbb59345471d20ecff5ff7;p=platform%2Fkernel%2Flinux-starfive.git habanalabs: use proper max_power variable for device utilization The max_power variable which is used for calculating the device utilization is the ASIC specific property which is set during init. However, the max value can be modified via sysfs, and thus the updated value in the device structure should be used instead. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 60bfd73..63e2449 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -614,7 +614,7 @@ int hl_device_utilization(struct hl_device *hdev, u32 *utilization) u64 max_power, curr_power, dc_power, dividend; int rc; - max_power = hdev->asic_prop.max_power_default; + max_power = hdev->max_power; dc_power = hdev->asic_prop.dc_power_default; rc = hl_fw_cpucp_power_get(hdev, &curr_power);