aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 20:37:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-15 20:37:07 -0400
commit2245ba2a3a975656bb303dfaa115accaa4667083 (patch)
treecbeb348c43d58461d851907373c34a7b9a985e41 /drivers/acpi/processor_idle.c
parente2e96c663639a3361bb1a84e666887d308c6c87e (diff)
parent95ee46aa8698f2000647dfb362400fadbb5807cf (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: gcc-4.6: ACPI: fix unused but set variables in ACPI ACPI thermal: make procfs I/F depend on CONFIG_ACPI_PROCFS ACPI video: make procfs I/F depend on CONFIG_ACPI_PROCFS ACPI processor: remove deprecated ACPI procfs I/F ACPI power_resource: remove unused procfs I/F ACPI: remove deprecated ACPI procfs I/F ACPI: introduce drivers/acpi/sysfs.c ACPI: introduce module parameter acpi.aml_debug_output ACPI: introduce drivers/acpi/debugfs.c ACPI, APEI, ERST debug support ACPI, APEI, Manage GHES as platform devices ACPI, APEI, Rename CPER and GHES severity constants ACPI, APEI, Fix a typo of error path of apei_resources_request ACPI / ACPICA: Fix reference counting problems with GPE handlers ACPI: Add the check of ADR flag in course of finding ACPI handle for PCI device ACPI / Sleep: Drop acpi_suspend_finish() ACPI / Sleep: Consolidate suspend and hibernation routines ACPI / Wakeup: Simplify enabling of wakeup devices ACPI / Sleep: Rework enabling wakeup devices ACPI / Sleep: Free NVS copy if suspending of devices fails Fixed up totally buggered "ACPI: fix unused but set variables in ACPI" patch that doesn't even compile in the merge. Thanks to Sedat Dilek <sedat.dilek@googlemail.com> for noticing the breakage before I even pulled. And a big "Grrr.." at Len for not even bothering to compile the tree before asking me to pull.
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c102
1 files changed, 1 insertions, 101 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index b4c2f3bdadeb..f4428e82b352 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -33,8 +33,6 @@
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/cpufreq.h> 34#include <linux/cpufreq.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/proc_fs.h>
37#include <linux/seq_file.h>
38#include <linux/acpi.h> 36#include <linux/acpi.h>
39#include <linux/dmi.h> 37#include <linux/dmi.h>
40#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
@@ -82,13 +80,6 @@ module_param(bm_check_disable, uint, 0000);
82static unsigned int latency_factor __read_mostly = 2; 80static unsigned int latency_factor __read_mostly = 2;
83module_param(latency_factor, uint, 0644); 81module_param(latency_factor, uint, 0644);
84 82
85#ifdef CONFIG_ACPI_PROCFS
86static u64 us_to_pm_timer_ticks(s64 t)
87{
88 return div64_u64(t * PM_TIMER_FREQUENCY, 1000000);
89}
90#endif
91
92/* 83/*
93 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. 84 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3.
94 * For now disable this. Probably a bug somewhere else. 85 * For now disable this. Probably a bug somewhere else.
@@ -689,78 +680,6 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr)
689 return 0; 680 return 0;
690} 681}
691 682
692#ifdef CONFIG_ACPI_PROCFS
693static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
694{
695 struct acpi_processor *pr = seq->private;
696 unsigned int i;
697
698
699 if (!pr)
700 goto end;
701
702 seq_printf(seq, "active state: C%zd\n"
703 "max_cstate: C%d\n"
704 "maximum allowed latency: %d usec\n",
705 pr->power.state ? pr->power.state - pr->power.states : 0,
706 max_cstate, pm_qos_request(PM_QOS_CPU_DMA_LATENCY));
707
708 seq_puts(seq, "states:\n");
709
710 for (i = 1; i <= pr->power.count; i++) {
711 seq_printf(seq, " %cC%d: ",
712 (&pr->power.states[i] ==
713 pr->power.state ? '*' : ' '), i);
714
715 if (!pr->power.states[i].valid) {
716 seq_puts(seq, "<not supported>\n");
717 continue;
718 }
719
720 switch (pr->power.states[i].type) {
721 case ACPI_STATE_C1:
722 seq_printf(seq, "type[C1] ");
723 break;
724 case ACPI_STATE_C2:
725 seq_printf(seq, "type[C2] ");
726 break;
727 case ACPI_STATE_C3:
728 seq_printf(seq, "type[C3] ");
729 break;
730 default:
731 seq_printf(seq, "type[--] ");
732 break;
733 }
734
735 seq_puts(seq, "promotion[--] ");
736
737 seq_puts(seq, "demotion[--] ");
738
739 seq_printf(seq, "latency[%03d] usage[%08d] duration[%020Lu]\n",
740 pr->power.states[i].latency,
741 pr->power.states[i].usage,
742 us_to_pm_timer_ticks(pr->power.states[i].time));
743 }
744
745 end:
746 return 0;
747}
748
749static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
750{
751 return single_open(file, acpi_processor_power_seq_show,
752 PDE(inode)->data);
753}
754
755static const struct file_operations acpi_processor_power_fops = {
756 .owner = THIS_MODULE,
757 .open = acpi_processor_power_open_fs,
758 .read = seq_read,
759 .llseek = seq_lseek,
760 .release = single_release,
761};
762#endif
763
764/** 683/**
765 * acpi_idle_bm_check - checks if bus master activity was detected 684 * acpi_idle_bm_check - checks if bus master activity was detected
766 */ 685 */
@@ -803,13 +722,12 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
803 } else if (cx->entry_method == ACPI_CSTATE_HALT) { 722 } else if (cx->entry_method == ACPI_CSTATE_HALT) {
804 acpi_safe_halt(); 723 acpi_safe_halt();
805 } else { 724 } else {
806 int unused;
807 /* IO port based C-state */ 725 /* IO port based C-state */
808 inb(cx->address); 726 inb(cx->address);
809 /* Dummy wait op - must do something useless after P_LVL2 read 727 /* Dummy wait op - must do something useless after P_LVL2 read
810 because chipsets cannot guarantee that STPCLK# signal 728 because chipsets cannot guarantee that STPCLK# signal
811 gets asserted in time to freeze execution properly. */ 729 gets asserted in time to freeze execution properly. */
812 unused = inl(acpi_gbl_FADT.xpm_timer_block.address); 730 inl(acpi_gbl_FADT.xpm_timer_block.address);
813 } 731 }
814 start_critical_timings(); 732 start_critical_timings();
815} 733}
@@ -1172,9 +1090,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1172{ 1090{
1173 acpi_status status = 0; 1091 acpi_status status = 0;
1174 static int first_run; 1092 static int first_run;
1175#ifdef CONFIG_ACPI_PROCFS
1176 struct proc_dir_entry *entry = NULL;
1177#endif
1178 1093
1179 if (boot_option_idle_override) 1094 if (boot_option_idle_override)
1180 return 0; 1095 return 0;
@@ -1223,15 +1138,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1223 if (cpuidle_register_device(&pr->power.dev)) 1138 if (cpuidle_register_device(&pr->power.dev))
1224 return -EIO; 1139 return -EIO;
1225 } 1140 }
1226#ifdef CONFIG_ACPI_PROCFS
1227 /* 'power' [R] */
1228 entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER,
1229 S_IRUGO, acpi_device_dir(device),
1230 &acpi_processor_power_fops,
1231 acpi_driver_data(device));
1232 if (!entry)
1233 return -EIO;
1234#endif
1235 return 0; 1141 return 0;
1236} 1142}
1237 1143
@@ -1244,11 +1150,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
1244 cpuidle_unregister_device(&pr->power.dev); 1150 cpuidle_unregister_device(&pr->power.dev);
1245 pr->flags.power_setup_done = 0; 1151 pr->flags.power_setup_done = 0;
1246 1152
1247#ifdef CONFIG_ACPI_PROCFS
1248 if (acpi_device_dir(device))
1249 remove_proc_entry(ACPI_PROCESSOR_FILE_POWER,
1250 acpi_device_dir(device));
1251#endif
1252
1253 return 0; 1153 return 0;
1254} 1154}