habanalabs: fix pm manual->auto in GOYA
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 22 Mar 2020 14:30:00 +0000 (16:30 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 24 Mar 2020 08:54:17 +0000 (10:54 +0200)
When moving from manual to automatic power management mode in GOYA, the
driver didn't correctly place the device in LOW power mode. As a result, if
an application was run immediately after the move, it would have run with
low frequencies.

Reviewed-by: Omer Shpigelman <oshpigelman@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/goya/goya_hwmgr.c

index b2ebc01..cdd4903 100644 (file)
@@ -298,8 +298,8 @@ static ssize_t pm_mng_profile_store(struct device *dev,
                /* Make sure we are in LOW PLL when changing modes */
                if (hdev->pm_mng_profile == PM_MANUAL) {
                        hdev->curr_pll_profile = PLL_HIGH;
-                       hl_device_set_frequency(hdev, PLL_LOW);
                        hdev->pm_mng_profile = PM_AUTO;
+                       hl_device_set_frequency(hdev, PLL_LOW);
                }
        } else if (strncmp("manual", buf, strlen("manual")) == 0) {
                if (hdev->pm_mng_profile == PM_AUTO) {