habanalabs: skip PLL freq fetch
authorOhad Sharabi <osharabi@habana.ai>
Sun, 14 Nov 2021 07:37:33 +0000 (09:37 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 26 Dec 2021 06:59:06 +0000 (08:59 +0200)
Getting the used PLL index with which to send the CPUPU packet relies on
the CPUCP info packet.

In case CPU queues are not enabled getting the PLL index will issue an
error and in some ASICs will also fail the driver load.

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c

index aed55db368d708fda7049320a8d56e9c7255ed04..465540d064b6957a994f85e4d777588d88a8b0bd 100644 (file)
@@ -881,6 +881,11 @@ static int gaudi_fetch_psoc_frequency(struct hl_device *hdev)
        int rc;
 
        if (hdev->asic_prop.fw_security_enabled) {
+               struct gaudi_device *gaudi = hdev->asic_specific;
+
+               if (!(gaudi->hw_cap_initialized & HW_CAP_CPU_Q))
+                       return 0;
+
                rc = hl_fw_cpucp_pll_info_get(hdev, HL_GAUDI_CPU_PLL, pll_freq_arr);
 
                if (rc)
index 7b3683f2a6dc67779a59219afb31230f8c14e21d..2347de2f426aec1f9f41f92bebf16990d8a7e4ba 100644 (file)
@@ -739,6 +739,11 @@ static void goya_fetch_psoc_frequency(struct hl_device *hdev)
        int rc;
 
        if (hdev->asic_prop.fw_security_enabled) {
+               struct goya_device *goya = hdev->asic_specific;
+
+               if (!(goya->hw_cap_initialized & HW_CAP_CPU_Q))
+                       return;
+
                rc = hl_fw_cpucp_pll_info_get(hdev, HL_GOYA_PCI_PLL,
                                pll_freq_arr);