habanalabs/gaudi: define DC POWER for secured PMC
authorOded Gabbay <ogabbay@kernel.org>
Tue, 10 Aug 2021 18:02:33 +0000 (21:02 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Wed, 1 Sep 2021 15:38:24 +0000 (18:38 +0300)
In secured mode, the CGM is disabled. Therefore, the DC power is
higher. Without taking it into consideration, the utilization is
12-15% at idle.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/gaudi/gaudiP.h

index 2e3e4b8..1ce89c9 100644 (file)
@@ -506,7 +506,11 @@ static inline void set_default_power_values(struct hl_device *hdev)
 
        if (hdev->card_type == cpucp_card_type_pmc) {
                prop->max_power_default = MAX_POWER_DEFAULT_PMC;
-               prop->dc_power_default = DC_POWER_DEFAULT_PMC;
+
+               if (prop->fw_security_enabled)
+                       prop->dc_power_default = DC_POWER_DEFAULT_PMC_SEC;
+               else
+                       prop->dc_power_default = DC_POWER_DEFAULT_PMC;
        } else {
                prop->max_power_default = MAX_POWER_DEFAULT_PCI;
                prop->dc_power_default = DC_POWER_DEFAULT_PCI;
index 2f0928c..7addb31 100644 (file)
@@ -52,6 +52,8 @@
 #define DC_POWER_DEFAULT_PCI           60000           /* 60W */
 #define DC_POWER_DEFAULT_PMC           60000           /* 60W */
 
+#define DC_POWER_DEFAULT_PMC_SEC       97000           /* 97W */
+
 #define GAUDI_CPU_TIMEOUT_USEC         30000000        /* 30s */
 
 #define TPC_ENABLED_MASK               0xFF