aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2010-07-14 22:46:41 -0400
committerLen Brown <len.brown@intel.com>2010-08-15 00:31:45 -0400
commitd09fe55510257f1acd21ea80a9bdd7c72b5895b3 (patch)
tree8de6e26f254167fabbc66b4de6f03a44bb57acde
parent06af7eb043c02822072cea862fce1b7c74115e8f (diff)
ACPI processor: remove deprecated ACPI procfs I/F
Remove deprecated ACPI processor procfs I/F, including: /proc/acpi/processor/CPUX/power /proc/acpi/processor/CPUX/limit /proc/acpi/processor/CPUX/info /proc/acpi/processor/CPUX/throttling still exists, as we don't have sysfs I/F available for now. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/Kconfig3
-rw-r--r--drivers/acpi/processor_driver.c85
-rw-r--r--drivers/acpi/processor_idle.c99
-rw-r--r--drivers/acpi/processor_thermal.c83
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--include/acpi/processor.h1
6 files changed, 0 insertions, 273 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index d77d9c27c846..6f66a937ba20 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -54,9 +54,6 @@ config ACPI_PROCFS
54 they have been replaced by functions in /sys. 54 they have been replaced by functions in /sys.
55 The deprecated files (and their replacements) include: 55 The deprecated files (and their replacements) include:
56 56
57 /proc/acpi/processor/*/power (/sys/devices/system/cpu/*/cpuidle/*)
58 /proc/acpi/processor/*/performance (/sys/devices/system/cpu/*/
59 cpufreq/*)
60 /proc/acpi/processor/*/throttling (/sys/class/thermal/ 57 /proc/acpi/processor/*/throttling (/sys/class/thermal/
61 cooling_device*/*) 58 cooling_device*/*)
62 This option has no effect on /proc/acpi/ files 59 This option has no effect on /proc/acpi/ files
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 38ea0cc6dc49..156021892389 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -83,9 +83,6 @@ MODULE_LICENSE("GPL");
83 83
84static int acpi_processor_add(struct acpi_device *device); 84static int acpi_processor_add(struct acpi_device *device);
85static int acpi_processor_remove(struct acpi_device *device, int type); 85static int acpi_processor_remove(struct acpi_device *device, int type);
86#ifdef CONFIG_ACPI_PROCFS
87static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
88#endif
89static void acpi_processor_notify(struct acpi_device *device, u32 event); 86static void acpi_processor_notify(struct acpi_device *device, u32 event);
90static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); 87static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
91static int acpi_processor_handle_eject(struct acpi_processor *pr); 88static int acpi_processor_handle_eject(struct acpi_processor *pr);
@@ -113,15 +110,6 @@ static struct acpi_driver acpi_processor_driver = {
113 110
114#define INSTALL_NOTIFY_HANDLER 1 111#define INSTALL_NOTIFY_HANDLER 1
115#define UNINSTALL_NOTIFY_HANDLER 2 112#define UNINSTALL_NOTIFY_HANDLER 2
116#ifdef CONFIG_ACPI_PROCFS
117static const struct file_operations acpi_processor_info_fops = {
118 .owner = THIS_MODULE,
119 .open = acpi_processor_info_open_fs,
120 .read = seq_read,
121 .llseek = seq_lseek,
122 .release = single_release,
123};
124#endif
125 113
126DEFINE_PER_CPU(struct acpi_processor *, processors); 114DEFINE_PER_CPU(struct acpi_processor *, processors);
127EXPORT_PER_CPU_SYMBOL(processors); 115EXPORT_PER_CPU_SYMBOL(processors);
@@ -256,44 +244,8 @@ static int acpi_processor_errata(struct acpi_processor *pr)
256 return result; 244 return result;
257} 245}
258 246
259/* --------------------------------------------------------------------------
260 FS Interface (/proc)
261 -------------------------------------------------------------------------- */
262
263#ifdef CONFIG_ACPI_PROCFS
264static struct proc_dir_entry *acpi_processor_dir = NULL; 247static struct proc_dir_entry *acpi_processor_dir = NULL;
265 248
266static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
267{
268 struct acpi_processor *pr = seq->private;
269
270
271 if (!pr)
272 goto end;
273
274 seq_printf(seq, "processor id: %d\n"
275 "acpi id: %d\n"
276 "bus mastering control: %s\n"
277 "power management: %s\n"
278 "throttling control: %s\n"
279 "limit interface: %s\n",
280 pr->id,
281 pr->acpi_id,
282 pr->flags.bm_control ? "yes" : "no",
283 pr->flags.power ? "yes" : "no",
284 pr->flags.throttling ? "yes" : "no",
285 pr->flags.limit ? "yes" : "no");
286
287 end:
288 return 0;
289}
290
291static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)
292{
293 return single_open(file, acpi_processor_info_seq_show,
294 PDE(inode)->data);
295}
296
297static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) 249static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
298{ 250{
299 struct proc_dir_entry *entry = NULL; 251 struct proc_dir_entry *entry = NULL;
@@ -306,14 +258,6 @@ static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
306 return -ENODEV; 258 return -ENODEV;
307 } 259 }
308 260
309 /* 'info' [R] */
310 entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO,
311 S_IRUGO, acpi_device_dir(device),
312 &acpi_processor_info_fops,
313 acpi_driver_data(device));
314 if (!entry)
315 return -EIO;
316
317 /* 'throttling' [R/W] */ 261 /* 'throttling' [R/W] */
318 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, 262 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING,
319 S_IFREG | S_IRUGO | S_IWUSR, 263 S_IFREG | S_IRUGO | S_IWUSR,
@@ -322,43 +266,20 @@ static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
322 acpi_driver_data(device)); 266 acpi_driver_data(device));
323 if (!entry) 267 if (!entry)
324 return -EIO; 268 return -EIO;
325
326 /* 'limit' [R/W] */
327 entry = proc_create_data(ACPI_PROCESSOR_FILE_LIMIT,
328 S_IFREG | S_IRUGO | S_IWUSR,
329 acpi_device_dir(device),
330 &acpi_processor_limit_fops,
331 acpi_driver_data(device));
332 if (!entry)
333 return -EIO;
334 return 0; 269 return 0;
335} 270}
336static int acpi_processor_remove_fs(struct acpi_device *device) 271static int acpi_processor_remove_fs(struct acpi_device *device)
337{ 272{
338 273
339 if (acpi_device_dir(device)) { 274 if (acpi_device_dir(device)) {
340 remove_proc_entry(ACPI_PROCESSOR_FILE_INFO,
341 acpi_device_dir(device));
342 remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, 275 remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING,
343 acpi_device_dir(device)); 276 acpi_device_dir(device));
344 remove_proc_entry(ACPI_PROCESSOR_FILE_LIMIT,
345 acpi_device_dir(device));
346 remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); 277 remove_proc_entry(acpi_device_bid(device), acpi_processor_dir);
347 acpi_device_dir(device) = NULL; 278 acpi_device_dir(device) = NULL;
348 } 279 }
349 280
350 return 0; 281 return 0;
351} 282}
352#else
353static inline int acpi_processor_add_fs(struct acpi_device *device)
354{
355 return 0;
356}
357static inline int acpi_processor_remove_fs(struct acpi_device *device)
358{
359 return 0;
360}
361#endif
362 283
363/* -------------------------------------------------------------------------- 284/* --------------------------------------------------------------------------
364 Driver Interface 285 Driver Interface
@@ -921,11 +842,9 @@ static int __init acpi_processor_init(void)
921 842
922 memset(&errata, 0, sizeof(errata)); 843 memset(&errata, 0, sizeof(errata));
923 844
924#ifdef CONFIG_ACPI_PROCFS
925 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 845 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
926 if (!acpi_processor_dir) 846 if (!acpi_processor_dir)
927 return -ENOMEM; 847 return -ENOMEM;
928#endif
929 848
930 if (!cpuidle_register_driver(&acpi_idle_driver)) { 849 if (!cpuidle_register_driver(&acpi_idle_driver)) {
931 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", 850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
@@ -952,9 +871,7 @@ static int __init acpi_processor_init(void)
952out_cpuidle: 871out_cpuidle:
953 cpuidle_unregister_driver(&acpi_idle_driver); 872 cpuidle_unregister_driver(&acpi_idle_driver);
954 873
955#ifdef CONFIG_ACPI_PROCFS
956 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 874 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
957#endif
958 875
959 return result; 876 return result;
960} 877}
@@ -974,9 +891,7 @@ static void __exit acpi_processor_exit(void)
974 891
975 cpuidle_unregister_driver(&acpi_idle_driver); 892 cpuidle_unregister_driver(&acpi_idle_driver);
976 893
977#ifdef CONFIG_ACPI_PROCFS
978 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 894 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
979#endif
980 895
981 return; 896 return;
982} 897}
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index e9a8026d39f0..5cbc0cb73e2c 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 */
@@ -1172,9 +1091,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1172{ 1091{
1173 acpi_status status = 0; 1092 acpi_status status = 0;
1174 static int first_run; 1093 static int first_run;
1175#ifdef CONFIG_ACPI_PROCFS
1176 struct proc_dir_entry *entry = NULL;
1177#endif
1178 1094
1179 if (boot_option_idle_override) 1095 if (boot_option_idle_override)
1180 return 0; 1096 return 0;
@@ -1223,15 +1139,6 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1223 if (cpuidle_register_device(&pr->power.dev)) 1139 if (cpuidle_register_device(&pr->power.dev))
1224 return -EIO; 1140 return -EIO;
1225 } 1141 }
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; 1142 return 0;
1236} 1143}
1237 1144
@@ -1244,11 +1151,5 @@ int acpi_processor_power_exit(struct acpi_processor *pr,
1244 cpuidle_unregister_device(&pr->power.dev); 1151 cpuidle_unregister_device(&pr->power.dev);
1245 pr->flags.power_setup_done = 0; 1152 pr->flags.power_setup_done = 0;
1246 1153
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; 1154 return 0;
1254} 1155}
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index 6deafb4aa0da..953b25fb9869 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -30,8 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/cpufreq.h> 32#include <linux/cpufreq.h>
33#include <linux/proc_fs.h>
34#include <linux/seq_file.h>
35#include <linux/sysdev.h> 33#include <linux/sysdev.h>
36 34
37#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -438,84 +436,3 @@ struct thermal_cooling_device_ops processor_cooling_ops = {
438 .get_cur_state = processor_get_cur_state, 436 .get_cur_state = processor_get_cur_state,
439 .set_cur_state = processor_set_cur_state, 437 .set_cur_state = processor_set_cur_state,
440}; 438};
441
442/* /proc interface */
443#ifdef CONFIG_ACPI_PROCFS
444static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
445{
446 struct acpi_processor *pr = seq->private;
447
448 if (!pr)
449 goto end;
450
451 if (!pr->flags.limit) {
452 seq_puts(seq, "<not supported>\n");
453 goto end;
454 }
455
456 seq_printf(seq, "active limit: P%d:T%d\n"
457 "user limit: P%d:T%d\n"
458 "thermal limit: P%d:T%d\n",
459 pr->limit.state.px, pr->limit.state.tx,
460 pr->limit.user.px, pr->limit.user.tx,
461 pr->limit.thermal.px, pr->limit.thermal.tx);
462
463 end:
464 return 0;
465}
466
467static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)
468{
469 return single_open(file, acpi_processor_limit_seq_show,
470 PDE(inode)->data);
471}
472
473static ssize_t acpi_processor_write_limit(struct file * file,
474 const char __user * buffer,
475 size_t count, loff_t * data)
476{
477 int result = 0;
478 struct seq_file *m = file->private_data;
479 struct acpi_processor *pr = m->private;
480 char limit_string[25] = { '\0' };
481 int px = 0;
482 int tx = 0;
483
484
485 if (!pr || (count > sizeof(limit_string) - 1)) {
486 return -EINVAL;
487 }
488
489 if (copy_from_user(limit_string, buffer, count)) {
490 return -EFAULT;
491 }
492
493 limit_string[count] = '\0';
494
495 if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {
496 printk(KERN_ERR PREFIX "Invalid data format\n");
497 return -EINVAL;
498 }
499
500 if (pr->flags.throttling) {
501 if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {
502 printk(KERN_ERR PREFIX "Invalid tx\n");
503 return -EINVAL;
504 }
505 pr->limit.user.tx = tx;
506 }
507
508 result = acpi_processor_apply_limit(pr);
509
510 return count;
511}
512
513const struct file_operations acpi_processor_limit_fops = {
514 .owner = THIS_MODULE,
515 .open = acpi_processor_limit_open_fs,
516 .read = seq_read,
517 .write = acpi_processor_write_limit,
518 .llseek = seq_lseek,
519 .release = single_release,
520};
521#endif
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 9ade1a5b32ed..730863855ed5 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -1215,7 +1215,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
1215} 1215}
1216 1216
1217/* proc interface */ 1217/* proc interface */
1218#ifdef CONFIG_ACPI_PROCFS
1219static int acpi_processor_throttling_seq_show(struct seq_file *seq, 1218static int acpi_processor_throttling_seq_show(struct seq_file *seq,
1220 void *offset) 1219 void *offset)
1221{ 1220{
@@ -1323,4 +1322,3 @@ const struct file_operations acpi_processor_throttling_fops = {
1323 .llseek = seq_lseek, 1322 .llseek = seq_lseek,
1324 .release = single_release, 1323 .release = single_release,
1325}; 1324};
1326#endif
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index a68ca8a11a53..1b62102fbb67 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -338,7 +338,6 @@ extern struct cpuidle_driver acpi_idle_driver;
338 338
339/* in processor_thermal.c */ 339/* in processor_thermal.c */
340int acpi_processor_get_limit_info(struct acpi_processor *pr); 340int acpi_processor_get_limit_info(struct acpi_processor *pr);
341extern const struct file_operations acpi_processor_limit_fops;
342extern struct thermal_cooling_device_ops processor_cooling_ops; 341extern struct thermal_cooling_device_ops processor_cooling_ops;
343#ifdef CONFIG_CPU_FREQ 342#ifdef CONFIG_CPU_FREQ
344void acpi_thermal_cpufreq_init(void); 343void acpi_thermal_cpufreq_init(void);