]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00279545 [MX6x:Cpufreq] Initialize mutex before driver registration
authorRanjani Vaidyanathan <ra5478@freescale.com>
Thu, 12 Sep 2013 19:44:20 +0000 (14:44 -0500)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:55:45 +0000 (09:55 +0800)
The mutex, set_cpufreq_lock, should be initialized before the driver is
registered. Else if the default governor is set to performance or ondemand,
the cpufreq driver will try to set the freq to the max freq supported and
this will cause a crash during boot.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
drivers/cpufreq/cpufreq-imx6.c

index 51861d668ee329c4d17a705e0ad20495cc72cb75..eb7baacf6fdf96b57e9007245689b8f2da2a32e4 100644 (file)
@@ -441,15 +441,15 @@ static int imx6_cpufreq_probe(struct platform_device *pdev)
        if (ret > 0)
                transition_latency += ret * 1000;
 
+       mutex_init(&set_cpufreq_lock);
+       register_pm_notifier(&imx6_cpufreq_pm_notifier);
+
        ret = cpufreq_register_driver(&imx6_cpufreq_driver);
        if (ret) {
                dev_err(cpu_dev, "failed register driver: %d\n", ret);
                goto free_freq_table;
        }
 
-       mutex_init(&set_cpufreq_lock);
-       register_pm_notifier(&imx6_cpufreq_pm_notifier);
-
        of_node_put(np);
        return 0;