From: Ofir Bitton Date: Thu, 30 Jun 2022 11:37:03 +0000 (+0300) Subject: habanalabs: do not set max power on a secured device X-Git-Tag: block-6.0-2022-08-12~26^2~27^2~18 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=cc81c0f3b03e2830665975419893d3a0445fca85;p=linux-block.git habanalabs: do not set max power on a secured device Max power API is not supported in secured devices. Hence, we should skip setting it during boot. Signed-off-by: Ofir Bitton 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 9f3778c82e54..99d84b46aeb6 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1545,7 +1545,8 @@ kill_processes: goto out_err; } - hl_fw_set_max_power(hdev); + if (!hdev->asic_prop.fw_security_enabled) + hl_fw_set_max_power(hdev); } else { rc = hdev->asic_funcs->non_hard_reset_late_init(hdev); if (rc) { @@ -1914,7 +1915,8 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) /* Need to call this again because the max power might change, * depending on card type for certain ASICs */ - if (hdev->asic_prop.set_max_power_on_device_init) + if (hdev->asic_prop.set_max_power_on_device_init && + !hdev->asic_prop.fw_security_enabled) hl_fw_set_max_power(hdev); /*