printk(KERN_ERR PFX "no p states to transition\n");
return -ENODEV;
}
-
+
if (check_pst_table(data, pst, maxvid))
return -EINVAL;
continue;
}
- /* verify only 1 entry from the lo frequency table */
- if ((fid < HI_FID_TABLE_BOTTOM) && (cntlofreq++)) {
- printk(KERN_ERR PFX "Too many lo freq table entries\n");
- goto err_out;
+ if (fid < HI_FID_TABLE_BOTTOM) {
+ if (cntlofreq) {
+ /* if both entries are the same, ignore this
+ * one...
+ */
+ if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||
+ (powernow_table[i].index != powernow_table[cntlofreq].index)) {
+ printk(KERN_ERR PFX "Too many lo freq table entries\n");
+ goto err_out_mem;
+ }
+
+ dprintk(KERN_INFO PFX "double low frequency table entry, ignoring it.\n");
+ powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
+ continue;
+ } else
+ cntlofreq = i;
}
-
+
if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {
printk(KERN_INFO PFX "invalid freq entries %u kHz vs. %u kHz\n",
powernow_table[i].frequency,
print_basics(data);
powernow_k8_acpi_pst_values(data, 0);
return 0;
+
+err_out_mem:
+ kfree(powernow_table);
+
err_out:
acpi_processor_unregister_performance(&data->acpi_data, data->cpu);
/* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */
data->acpi_data.state_count = 0;
-
+
return -ENODEV;
}
if (smp_processor_id() != pol->cpu) {
printk(KERN_ERR "limiting to cpu %u failed\n", pol->cpu);
- goto sched_out;
+ goto err_out;
}
- /* from this point, do not exit without restoring preempt and cpu */
- preempt_disable();
-
if (pending_bit_stuck()) {
printk(KERN_ERR PFX "failing targ, change pending bit set\n");
goto err_out;
ret = 0;
err_out:
- preempt_enable_no_resched();
-sched_out:
set_cpus_allowed(current, oldmask);
schedule();
if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {
printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");
kfree(data);
- return 0;
+ return -ENODEV;
}
rc = find_psb_table(data);
if (rc) {
return -ENODEV;
}
-static int __exit powernowk8_cpu_exit (struct cpufreq_policy *pol)
+static int powernowk8_cpu_exit (struct cpufreq_policy *pol)
{
struct powernow_k8_data *data = powernow_data[pol->cpu];
if (query_current_values_with_pending_wait(data))
goto out;
- khz = find_khz_freq_from_fid(data->currfid);
+ khz = find_khz_freq_from_fid(data->currfid);
out:
preempt_enable_no_resched();
.verify = powernowk8_verify,
.target = powernowk8_target,
.init = powernowk8_cpu_init,
- .exit = powernowk8_cpu_exit,
+ .exit = __devexit_p(powernowk8_cpu_exit),
.get = powernowk8_get,
.name = "powernow-k8",
.owner = THIS_MODULE,
}
/* driver entry point for term */
-static void __exit powernowk8_exit(void)
+static void powernowk8_exit(void)
{
dprintk(KERN_INFO PFX "exit\n");