From: Jiyu Yang Date: Fri, 19 Feb 2016 09:14:51 +0000 (+0800) Subject: PD#119373 fix suspend crashed in mali X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a870d96cf9224655975c93ab3ceab65fb468dc0;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_mali-driver.git PD#119373 fix suspend crashed in mali Change-Id: I5d5c4838c8f7a5b39d3e62a5c22834170e4a7baa --- diff --git a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c index d9fe3e0..adf484d 100755 --- a/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c @@ -110,6 +110,9 @@ EXPORT_SYMBOL(shared_kernel_test_data); static const char kbase_drv_name[] = KBASE_DRV_NAME; static int kbase_dev_nr; +#ifdef CONFIG_MALI_MIDGARD_DVFS +extern int mali_pm_statue; +#endif static DEFINE_MUTEX(kbase_dev_list_lock); static LIST_HEAD(kbase_dev_list); @@ -3846,6 +3849,9 @@ static int kbase_device_suspend(struct device *dev) (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) devfreq_suspend_device(kbdev->devfreq); #endif +#if defined(CONFIG_MALI_MIDGARD_DVFS) + mali_pm_statue = 1; +#endif kbase_pm_suspend(kbdev); return 0; @@ -3871,6 +3877,9 @@ static int kbase_device_resume(struct device *dev) #if defined(CONFIG_PM_DEVFREQ) && \ (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) devfreq_resume_device(kbdev->devfreq); +#endif +#if defined(CONFIG_MALI_MIDGARD_DVFS) + mali_pm_statue = 0; #endif return 0; } @@ -3896,6 +3905,9 @@ static int kbase_device_runtime_suspend(struct device *dev) (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) devfreq_suspend_device(kbdev->devfreq); #endif +#if defined(CONFIG_MALI_MIDGARD_DVFS) + mali_pm_statue = 1; +#endif if (kbdev->pm.backend.callback_power_runtime_off) { kbdev->pm.backend.callback_power_runtime_off(kbdev); @@ -3932,6 +3944,9 @@ int kbase_device_runtime_resume(struct device *dev) (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) devfreq_resume_device(kbdev->devfreq); #endif +#if defined(CONFIG_MALI_MIDGARD_DVFS) + mali_pm_statue = 0; +#endif return ret; } diff --git a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c index 008330d..86c23e1 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c @@ -31,6 +31,7 @@ static mali_plat_info_t* pmali_plat = NULL; //static u32 mali_extr_sample_backup = 0; struct timeval start; struct timeval end; +int mali_pm_statue = 0; int mali_clock_init_clk_tree(struct platform_device* pdev) { @@ -171,15 +172,11 @@ void enable_clock(void) u32 get_mali_freq(u32 idx) { -#ifndef MESON_DRV_BRING - return pmali_plat->clk_sample[idx]; -#else if (!mali_pm_statue) { return pmali_plat->clk_sample[idx]; } else { return 0; } -#endif } void set_str_src(u32 data) diff --git a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c index 5c996e4..6907357 100644 --- a/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c +++ b/t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c @@ -30,6 +30,7 @@ static struct work_struct wq_work; static mali_plat_info_t* pmali_plat = NULL; #endif static int scaling_mode = MALI_PP_FS_SCALING; +extern int mali_pm_statue; //static int scaling_mode = MALI_SCALING_DISABLE; //static int scaling_mode = MALI_PP_SCALING; @@ -505,10 +506,8 @@ u32 get_current_frequency(void) void mali_gpu_utilization_callback(int utilization_pp) { #ifndef CONFIG_MALI_DVFS -#ifdef MESON_DRV_BRING if (mali_pm_statue) return; -#endif switch (scaling_mode) { case MALI_PP_FS_SCALING: