PD#119373 fix suspend crashed in mali
authorJiyu Yang <jiyu.yang@amlogic.com>
Fri, 19 Feb 2016 09:14:51 +0000 (17:14 +0800)
committerJiyu Yang <jiyu.yang@amlogic.com>
Mon, 22 Feb 2016 03:17:17 +0000 (11:17 +0800)
Change-Id: I5d5c4838c8f7a5b39d3e62a5c22834170e4a7baa

t83x/kernel/drivers/gpu/arm/midgard/mali_kbase_core_linux.c
t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/mali_clock.c
t83x/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c

index d9fe3e0b5b94d84ce9d56ec050359b01dcd4aa17..adf484d6ba375f1802bfb36461c803e070a4adde 100755 (executable)
@@ -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;
 }
index 008330d85f077ba25a21c508d79c15c2765d2375..86c23e16539101ca5100e541d97ea623e3d7a5d5 100644 (file)
@@ -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)
index 5c996e404712fc53dacd20795bd6c53591b3ac39..6907357b07539cf0677686dcb4326b5ea9894e91 100644 (file)
@@ -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: