diff options
author | Len Brown <len.brown@intel.com> | 2009-09-19 02:10:40 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-09-19 02:10:40 -0400 |
commit | cbeee13570adfb0af494a07074958e4888c2351c (patch) | |
tree | 998d9ff501c4abe19ebe5c262aa5b7052fa80b72 | |
parent | 7ef0143e2f898f9bf675c81bdf0e045c8dd53c57 (diff) | |
parent | b188e4ce3b7965ecc8d45191042cc9d25f6b90ee (diff) |
Merge branch 'processor-procfs-2.6.32' into release
-rw-r--r-- | drivers/acpi/Kconfig | 6 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 25 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 10 | ||||
-rw-r--r-- | drivers/acpi/processor_thermal.c | 3 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 3 |
5 files changed, 38 insertions, 9 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 2c1cab5642ff..dd8729d674e5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -60,7 +60,11 @@ config ACPI_PROCFS | |||
60 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) | 60 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) |
61 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) | 61 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) |
62 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) | 62 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) |
63 | 63 | /proc/acpi/processor/*/power (/sys/devices/system/cpu/*/cpuidle/*) | |
64 | /proc/acpi/processor/*/performance (/sys/devices/system/cpu/*/ | ||
65 | cpufreq/*) | ||
66 | /proc/acpi/processor/*/throttling (/sys/class/thermal/ | ||
67 | cooling_device*/*) | ||
64 | This option has no effect on /proc/acpi/ files | 68 | This option has no effect on /proc/acpi/ files |
65 | and functions which do not yet exist in /sys. | 69 | and functions which do not yet exist in /sys. |
66 | 70 | ||
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index b972107a1ef2..c2d4d6e09364 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -82,7 +82,9 @@ MODULE_LICENSE("GPL"); | |||
82 | 82 | ||
83 | static int acpi_processor_add(struct acpi_device *device); | 83 | static int acpi_processor_add(struct acpi_device *device); |
84 | static int acpi_processor_remove(struct acpi_device *device, int type); | 84 | static int acpi_processor_remove(struct acpi_device *device, int type); |
85 | #ifdef CONFIG_ACPI_PROCFS | ||
85 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); | 86 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); |
87 | #endif | ||
86 | static void acpi_processor_notify(struct acpi_device *device, u32 event); | 88 | static void acpi_processor_notify(struct acpi_device *device, u32 event); |
87 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); | 89 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); |
88 | static int acpi_processor_handle_eject(struct acpi_processor *pr); | 90 | static int acpi_processor_handle_eject(struct acpi_processor *pr); |
@@ -110,7 +112,7 @@ static struct acpi_driver acpi_processor_driver = { | |||
110 | 112 | ||
111 | #define INSTALL_NOTIFY_HANDLER 1 | 113 | #define INSTALL_NOTIFY_HANDLER 1 |
112 | #define UNINSTALL_NOTIFY_HANDLER 2 | 114 | #define UNINSTALL_NOTIFY_HANDLER 2 |
113 | 115 | #ifdef CONFIG_ACPI_PROCFS | |
114 | static const struct file_operations acpi_processor_info_fops = { | 116 | static const struct file_operations acpi_processor_info_fops = { |
115 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
116 | .open = acpi_processor_info_open_fs, | 118 | .open = acpi_processor_info_open_fs, |
@@ -118,6 +120,7 @@ static const struct file_operations acpi_processor_info_fops = { | |||
118 | .llseek = seq_lseek, | 120 | .llseek = seq_lseek, |
119 | .release = single_release, | 121 | .release = single_release, |
120 | }; | 122 | }; |
123 | #endif | ||
121 | 124 | ||
122 | DEFINE_PER_CPU(struct acpi_processor *, processors); | 125 | DEFINE_PER_CPU(struct acpi_processor *, processors); |
123 | struct acpi_processor_errata errata __read_mostly; | 126 | struct acpi_processor_errata errata __read_mostly; |
@@ -316,6 +319,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr) | |||
316 | FS Interface (/proc) | 319 | FS Interface (/proc) |
317 | -------------------------------------------------------------------------- */ | 320 | -------------------------------------------------------------------------- */ |
318 | 321 | ||
322 | #ifdef CONFIG_ACPI_PROCFS | ||
319 | static struct proc_dir_entry *acpi_processor_dir = NULL; | 323 | static struct proc_dir_entry *acpi_processor_dir = NULL; |
320 | 324 | ||
321 | static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) | 325 | static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) |
@@ -388,7 +392,6 @@ static int acpi_processor_add_fs(struct acpi_device *device) | |||
388 | return -EIO; | 392 | return -EIO; |
389 | return 0; | 393 | return 0; |
390 | } | 394 | } |
391 | |||
392 | static int acpi_processor_remove_fs(struct acpi_device *device) | 395 | static int acpi_processor_remove_fs(struct acpi_device *device) |
393 | { | 396 | { |
394 | 397 | ||
@@ -405,6 +408,16 @@ static int acpi_processor_remove_fs(struct acpi_device *device) | |||
405 | 408 | ||
406 | return 0; | 409 | return 0; |
407 | } | 410 | } |
411 | #else | ||
412 | static inline int acpi_processor_add_fs(struct acpi_device *device) | ||
413 | { | ||
414 | return 0; | ||
415 | } | ||
416 | static inline int acpi_processor_remove_fs(struct acpi_device *device) | ||
417 | { | ||
418 | return 0; | ||
419 | } | ||
420 | #endif | ||
408 | 421 | ||
409 | /* Use the acpiid in MADT to map cpus in case of SMP */ | 422 | /* Use the acpiid in MADT to map cpus in case of SMP */ |
410 | 423 | ||
@@ -1134,11 +1147,11 @@ static int __init acpi_processor_init(void) | |||
1134 | (struct acpi_table_header **)&madt))) | 1147 | (struct acpi_table_header **)&madt))) |
1135 | madt = NULL; | 1148 | madt = NULL; |
1136 | #endif | 1149 | #endif |
1137 | 1150 | #ifdef CONFIG_ACPI_PROCFS | |
1138 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1151 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1139 | if (!acpi_processor_dir) | 1152 | if (!acpi_processor_dir) |
1140 | return -ENOMEM; | 1153 | return -ENOMEM; |
1141 | 1154 | #endif | |
1142 | /* | 1155 | /* |
1143 | * Check whether the system is DMI table. If yes, OSPM | 1156 | * Check whether the system is DMI table. If yes, OSPM |
1144 | * should not use mwait for CPU-states. | 1157 | * should not use mwait for CPU-states. |
@@ -1166,7 +1179,9 @@ out_cpuidle: | |||
1166 | cpuidle_unregister_driver(&acpi_idle_driver); | 1179 | cpuidle_unregister_driver(&acpi_idle_driver); |
1167 | 1180 | ||
1168 | out_proc: | 1181 | out_proc: |
1182 | #ifdef CONFIG_ACPI_PROCFS | ||
1169 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1183 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1184 | #endif | ||
1170 | 1185 | ||
1171 | return result; | 1186 | return result; |
1172 | } | 1187 | } |
@@ -1186,7 +1201,9 @@ static void __exit acpi_processor_exit(void) | |||
1186 | 1201 | ||
1187 | cpuidle_unregister_driver(&acpi_idle_driver); | 1202 | cpuidle_unregister_driver(&acpi_idle_driver); |
1188 | 1203 | ||
1204 | #ifdef CONFIG_ACPI_PROCFS | ||
1189 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1205 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1206 | #endif | ||
1190 | 1207 | ||
1191 | return; | 1208 | return; |
1192 | } | 1209 | } |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 22aab1fc9b45..cc61a6220102 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -682,6 +682,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) | |||
682 | return 0; | 682 | return 0; |
683 | } | 683 | } |
684 | 684 | ||
685 | #ifdef CONFIG_ACPI_PROCFS | ||
685 | static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | 686 | static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) |
686 | { | 687 | { |
687 | struct acpi_processor *pr = seq->private; | 688 | struct acpi_processor *pr = seq->private; |
@@ -761,7 +762,7 @@ static const struct file_operations acpi_processor_power_fops = { | |||
761 | .llseek = seq_lseek, | 762 | .llseek = seq_lseek, |
762 | .release = single_release, | 763 | .release = single_release, |
763 | }; | 764 | }; |
764 | 765 | #endif | |
765 | 766 | ||
766 | /** | 767 | /** |
767 | * acpi_idle_bm_check - checks if bus master activity was detected | 768 | * acpi_idle_bm_check - checks if bus master activity was detected |
@@ -1162,7 +1163,9 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1162 | { | 1163 | { |
1163 | acpi_status status = 0; | 1164 | acpi_status status = 0; |
1164 | static int first_run; | 1165 | static int first_run; |
1166 | #ifdef CONFIG_ACPI_PROCFS | ||
1165 | struct proc_dir_entry *entry = NULL; | 1167 | struct proc_dir_entry *entry = NULL; |
1168 | #endif | ||
1166 | unsigned int i; | 1169 | unsigned int i; |
1167 | 1170 | ||
1168 | if (boot_option_idle_override) | 1171 | if (boot_option_idle_override) |
@@ -1219,7 +1222,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1219 | pr->power.states[i].type); | 1222 | pr->power.states[i].type); |
1220 | printk(")\n"); | 1223 | printk(")\n"); |
1221 | } | 1224 | } |
1222 | 1225 | #ifdef CONFIG_ACPI_PROCFS | |
1223 | /* 'power' [R] */ | 1226 | /* 'power' [R] */ |
1224 | entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER, | 1227 | entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER, |
1225 | S_IRUGO, acpi_device_dir(device), | 1228 | S_IRUGO, acpi_device_dir(device), |
@@ -1227,6 +1230,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1227 | acpi_driver_data(device)); | 1230 | acpi_driver_data(device)); |
1228 | if (!entry) | 1231 | if (!entry) |
1229 | return -EIO; | 1232 | return -EIO; |
1233 | #endif | ||
1230 | return 0; | 1234 | return 0; |
1231 | } | 1235 | } |
1232 | 1236 | ||
@@ -1239,9 +1243,11 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
1239 | cpuidle_unregister_device(&pr->power.dev); | 1243 | cpuidle_unregister_device(&pr->power.dev); |
1240 | pr->flags.power_setup_done = 0; | 1244 | pr->flags.power_setup_done = 0; |
1241 | 1245 | ||
1246 | #ifdef CONFIG_ACPI_PROCFS | ||
1242 | if (acpi_device_dir(device)) | 1247 | if (acpi_device_dir(device)) |
1243 | remove_proc_entry(ACPI_PROCESSOR_FILE_POWER, | 1248 | remove_proc_entry(ACPI_PROCESSOR_FILE_POWER, |
1244 | acpi_device_dir(device)); | 1249 | acpi_device_dir(device)); |
1250 | #endif | ||
1245 | 1251 | ||
1246 | return 0; | 1252 | return 0; |
1247 | } | 1253 | } |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 3e3181c0efc3..140c5c5b423c 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -440,7 +440,7 @@ struct thermal_cooling_device_ops processor_cooling_ops = { | |||
440 | }; | 440 | }; |
441 | 441 | ||
442 | /* /proc interface */ | 442 | /* /proc interface */ |
443 | 443 | #ifdef CONFIG_ACPI_PROCFS | |
444 | static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) | 444 | static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) |
445 | { | 445 | { |
446 | struct acpi_processor *pr = (struct acpi_processor *)seq->private; | 446 | struct acpi_processor *pr = (struct acpi_processor *)seq->private; |
@@ -519,3 +519,4 @@ const struct file_operations acpi_processor_limit_fops = { | |||
519 | .llseek = seq_lseek, | 519 | .llseek = seq_lseek, |
520 | .release = single_release, | 520 | .release = single_release, |
521 | }; | 521 | }; |
522 | #endif | ||
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index b366b9c13d4d..ce7cf3bc5101 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -1218,7 +1218,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) | |||
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | /* proc interface */ | 1220 | /* proc interface */ |
1221 | 1221 | #ifdef CONFIG_ACPI_PROCFS | |
1222 | static int acpi_processor_throttling_seq_show(struct seq_file *seq, | 1222 | static int acpi_processor_throttling_seq_show(struct seq_file *seq, |
1223 | void *offset) | 1223 | void *offset) |
1224 | { | 1224 | { |
@@ -1326,3 +1326,4 @@ const struct file_operations acpi_processor_throttling_fops = { | |||
1326 | .llseek = seq_lseek, | 1326 | .llseek = seq_lseek, |
1327 | .release = single_release, | 1327 | .release = single_release, |
1328 | }; | 1328 | }; |
1329 | #endif | ||