@@ -462,7 +462,6 @@ static int check_supported_cpu(unsigned int cpu)
462462
463463 oldmask = current -> cpus_allowed ;
464464 set_cpus_allowed (current , cpumask_of_cpu (cpu ));
465- schedule ();
466465
467466 if (smp_processor_id () != cpu ) {
468467 printk (KERN_ERR "limiting to cpu %u failed\n" , cpu );
@@ -497,9 +496,7 @@ static int check_supported_cpu(unsigned int cpu)
497496
498497out :
499498 set_cpus_allowed (current , oldmask );
500- schedule ();
501499 return rc ;
502-
503500}
504501
505502static int check_pst_table (struct powernow_k8_data * data , struct pst_s * pst , u8 maxvid )
@@ -913,7 +910,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
913910 /* only run on specific CPU from here on */
914911 oldmask = current -> cpus_allowed ;
915912 set_cpus_allowed (current , cpumask_of_cpu (pol -> cpu ));
916- schedule ();
917913
918914 if (smp_processor_id () != pol -> cpu ) {
919915 printk (KERN_ERR "limiting to cpu %u failed\n" , pol -> cpu );
@@ -968,8 +964,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
968964
969965err_out :
970966 set_cpus_allowed (current , oldmask );
971- schedule ();
972-
973967 return ret ;
974968}
975969
@@ -991,12 +985,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
991985 if (!check_supported_cpu (pol -> cpu ))
992986 return - ENODEV ;
993987
994- data = kmalloc (sizeof (struct powernow_k8_data ), GFP_KERNEL );
988+ data = kzalloc (sizeof (struct powernow_k8_data ), GFP_KERNEL );
995989 if (!data ) {
996990 printk (KERN_ERR PFX "unable to alloc powernow_k8_data" );
997991 return - ENOMEM ;
998992 }
999- memset (data ,0 ,sizeof (struct powernow_k8_data ));
1000993
1001994 data -> cpu = pol -> cpu ;
1002995
@@ -1026,7 +1019,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
10261019 /* only run on specific CPU from here on */
10271020 oldmask = current -> cpus_allowed ;
10281021 set_cpus_allowed (current , cpumask_of_cpu (pol -> cpu ));
1029- schedule ();
10301022
10311023 if (smp_processor_id () != pol -> cpu ) {
10321024 printk (KERN_ERR "limiting to cpu %u failed\n" , pol -> cpu );
@@ -1045,7 +1037,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
10451037
10461038 /* run on any CPU again */
10471039 set_cpus_allowed (current , oldmask );
1048- schedule ();
10491040
10501041 pol -> governor = CPUFREQ_DEFAULT_GOVERNOR ;
10511042 pol -> cpus = cpu_core_map [pol -> cpu ];
@@ -1080,7 +1071,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
10801071
10811072err_out :
10821073 set_cpus_allowed (current , oldmask );
1083- schedule ();
10841074 powernow_k8_cpu_exit_acpi (data );
10851075
10861076 kfree (data );
@@ -1116,17 +1106,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
11161106 set_cpus_allowed (current , oldmask );
11171107 return 0 ;
11181108 }
1119- preempt_disable ();
1120-
1109+
11211110 if (query_current_values_with_pending_wait (data ))
11221111 goto out ;
11231112
11241113 khz = find_khz_freq_from_fid (data -> currfid );
11251114
1126- out :
1127- preempt_enable_no_resched ();
1115+ out :
11281116 set_cpus_allowed (current , oldmask );
1129-
11301117 return khz ;
11311118}
11321119
0 commit comments