diff options
author | Tomer Tayar <ttayar@habana.ai> | 2022-01-18 19:27:14 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-02-28 14:22:05 +0200 |
commit | 2908826d09f829528cb507ce547967beccf4388d (patch) | |
tree | 512c97d0674bccfc024aaac4fddfbeeb1976a91f /drivers/misc/habanalabs/common/device.c | |
parent | 35629bc171b642d5f0bbb59345471d20ecff5ff7 (diff) |
habanalabs: set max power on device init per ASIC
For current devices there is a need to send the max power value to F/W
during device init, for example because there might be several card
types.
In future devices, this info will be programmed in the device's EEPROM
and will be read by F/W, and hence the driver should not send it.
Modify the sending of the relevant message to be done only for ASIC
types that need it.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/device.c')
-rw-r--r-- | drivers/misc/habanalabs/common/device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 63e2449ad136..8ea9dfe3f79b 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -1541,7 +1541,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 */ - hl_fw_set_max_power(hdev); + if (hdev->asic_prop.set_max_power_on_device_init) + hl_fw_set_max_power(hdev); /* * hl_hwmon_init() must be called after device_late_init(), because only |