23 #include <linux/kernel.h>
24 #include <linux/types.h>
26 #include <linux/module.h>
29 #include <asm/processor.h>
52 pmi_message_t pmi_msg;
56 pmi_msg.type = PMI_TYPE_FREQ_CHANGE;
58 pmi_msg.data2 = pmode;
68 pr_debug(
"had to wait %lu ms for a transition using " \
72 pr_debug(
"PMI returned slow mode %d\n", ret);
79 static void cbe_cpufreq_handle_pmi(pmi_message_t pmi_msg)
83 BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE);
86 slow_mode = pmi_msg.data2;
88 pmi_slow_mode_limit[
node] = slow_mode;
90 pr_debug(
"cbe_handle_pmi: node: %d max_freq: %d\n", node, slow_mode);
109 pr_debug(
"got notified, event=%lu, node=%u\n", event, node);
111 if (pmi_slow_mode_limit[node] != 0) {
112 pr_debug(
"limiting node %d to slow mode %d\n",
113 node, pmi_slow_mode_limit[node]);
115 cpufreq_verify_within_limits(policy, 0,
117 cbe_freqs[pmi_slow_mode_limit[node]].
frequency);
124 .notifier_call = pmi_notifier,
127 static struct pmi_handler cbe_pmi_handler = {
128 .type = PMI_TYPE_FREQ_CHANGE,
129 .handle_pmi_message = cbe_cpufreq_handle_pmi,
134 static int __init cbe_cpufreq_pmi_init(
void)
146 static void __exit cbe_cpufreq_pmi_exit(
void)