Commit 2908826d authored by Tomer Tayar's avatar Tomer Tayar Committed by Oded Gabbay
Browse files

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: default avatarTomer Tayar <ttayar@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 35629bc1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1541,6 +1541,7 @@ 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)
		hl_fw_set_max_power(hdev);

	/*
+2 −0
Original line number Diff line number Diff line
@@ -562,6 +562,7 @@ struct hl_hints_range {
 *                              to the fact that training runs on multiple
 *                              devices)
 * @configurable_stop_on_err: is stop-on-error option configurable via debugfs.
 * @set_max_power_on_device_init: true if need to set max power in F/W on device init.
 */
struct asic_fixed_properties {
	struct hw_queue_properties	*hw_queues_props;
@@ -646,6 +647,7 @@ struct asic_fixed_properties {
	u8				supports_soft_reset;
	u8				allow_inference_soft_reset;
	u8				configurable_stop_on_err;
	u8				set_max_power_on_device_init;
};

/**
+2 −0
Original line number Diff line number Diff line
@@ -671,6 +671,8 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev)

	prop->configurable_stop_on_err = true;

	prop->set_max_power_on_device_init = true;

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -485,6 +485,8 @@ int goya_set_fixed_properties(struct hl_device *hdev)

	prop->configurable_stop_on_err = true;

	prop->set_max_power_on_device_init = true;

	return 0;
}