From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 08:20:59 +0000 Subject: [PATCH] kernel_5.10 no rt --- kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c b/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c index 260c2a8..7438cb4 100644 --- a/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c +++ b/kernel/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c @@ -12,6 +12,7 @@ #include "mali_kernel_common.h" #include <linux/clk.h> +#include <linux/clk-provider.h> #include <linux/devfreq.h> #include <linux/regulator/consumer.h> #include <linux/regulator/driver.h> @@ -40,7 +41,7 @@ #include <soc/rockchip/rockchip_system_monitor.h> static struct monitor_dev_profile mali_mdevp = { - .type = MONITOR_TPYE_DEV, + .type = MONITOR_TYPE_DEV, .low_temp_adjust = rockchip_monitor_dev_low_temp_adjust, .high_temp_adjust = rockchip_monitor_dev_high_temp_adjust, }; @@ -87,13 +88,17 @@ return 0; } + err = clk_bulk_enable(mdev->num_clks, mdev->clks); + if (err) + return err; + #ifdef CONFIG_REGULATOR if (mdev->regulator && mdev->current_voltage != voltage && old_freq < freq) { err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX); if (err) { MALI_PRINT_ERROR(("Failed to increase voltage (%d)\n", err)); - return err; + goto err; } } #endif @@ -101,8 +106,9 @@ err = clk_set_rate(mdev->clock, freq); if (err) { MALI_PRINT_ERROR(("Failed to set clock %lu (target %lu)\n", freq, *target_freq)); - return err; + goto err; } + *target_freq = freq; mdev->current_freq = freq; if (mdev->devfreq) @@ -114,7 +120,7 @@ err = regulator_set_voltage(mdev->regulator, voltage, INT_MAX); if (err) { MALI_PRINT_ERROR(("Failed to decrease voltage (%d)\n", err)); - return err; + goto err; } } #endif @@ -122,6 +128,8 @@ mdev->current_voltage = voltage; mali_pm_reset_dvfs_utilisation(mdev); +err: + clk_bulk_disable(mdev->num_clks, mdev->clks); return err; } -- Gitblit v1.6.2