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>

authored by Zhang Rui and committed by Len Brown d09fe555 06af7eb0

-273
-3
drivers/acpi/Kconfig
··· 54 they have been replaced by functions in /sys. 55 The deprecated files (and their replacements) include: 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/ 61 cooling_device*/*) 62 This option has no effect on /proc/acpi/ files
··· 54 they have been replaced by functions in /sys. 55 The deprecated files (and their replacements) include: 56 57 /proc/acpi/processor/*/throttling (/sys/class/thermal/ 58 cooling_device*/*) 59 This option has no effect on /proc/acpi/ files
-85
drivers/acpi/processor_driver.c
··· 83 84 static int acpi_processor_add(struct acpi_device *device); 85 static int acpi_processor_remove(struct acpi_device *device, int type); 86 - #ifdef CONFIG_ACPI_PROCFS 87 - static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); 88 - #endif 89 static void acpi_processor_notify(struct acpi_device *device, u32 event); 90 static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); 91 static int acpi_processor_handle_eject(struct acpi_processor *pr); ··· 110 111 #define INSTALL_NOTIFY_HANDLER 1 112 #define UNINSTALL_NOTIFY_HANDLER 2 113 - #ifdef CONFIG_ACPI_PROCFS 114 - static const struct file_operations acpi_processor_info_fops = { 115 - .owner = THIS_MODULE, 116 - .open = acpi_processor_info_open_fs, 117 - .read = seq_read, 118 - .llseek = seq_lseek, 119 - .release = single_release, 120 - }; 121 - #endif 122 123 DEFINE_PER_CPU(struct acpi_processor *, processors); 124 EXPORT_PER_CPU_SYMBOL(processors); ··· 244 return result; 245 } 246 247 - /* -------------------------------------------------------------------------- 248 - FS Interface (/proc) 249 - -------------------------------------------------------------------------- */ 250 - 251 - #ifdef CONFIG_ACPI_PROCFS 252 static struct proc_dir_entry *acpi_processor_dir = NULL; 253 - 254 - static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) 255 - { 256 - struct acpi_processor *pr = seq->private; 257 - 258 - 259 - if (!pr) 260 - goto end; 261 - 262 - seq_printf(seq, "processor id: %d\n" 263 - "acpi id: %d\n" 264 - "bus mastering control: %s\n" 265 - "power management: %s\n" 266 - "throttling control: %s\n" 267 - "limit interface: %s\n", 268 - pr->id, 269 - pr->acpi_id, 270 - pr->flags.bm_control ? "yes" : "no", 271 - pr->flags.power ? "yes" : "no", 272 - pr->flags.throttling ? "yes" : "no", 273 - pr->flags.limit ? "yes" : "no"); 274 - 275 - end: 276 - return 0; 277 - } 278 - 279 - static int acpi_processor_info_open_fs(struct inode *inode, struct file *file) 280 - { 281 - return single_open(file, acpi_processor_info_seq_show, 282 - PDE(inode)->data); 283 - } 284 285 static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) 286 { ··· 258 return -ENODEV; 259 } 260 261 - /* 'info' [R] */ 262 - entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO, 263 - S_IRUGO, acpi_device_dir(device), 264 - &acpi_processor_info_fops, 265 - acpi_driver_data(device)); 266 - if (!entry) 267 - return -EIO; 268 - 269 /* 'throttling' [R/W] */ 270 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, 271 S_IFREG | S_IRUGO | S_IWUSR, 272 acpi_device_dir(device), 273 &acpi_processor_throttling_fops, 274 - acpi_driver_data(device)); 275 - if (!entry) 276 - return -EIO; 277 - 278 - /* 'limit' [R/W] */ 279 - entry = proc_create_data(ACPI_PROCESSOR_FILE_LIMIT, 280 - S_IFREG | S_IRUGO | S_IWUSR, 281 - acpi_device_dir(device), 282 - &acpi_processor_limit_fops, 283 acpi_driver_data(device)); 284 if (!entry) 285 return -EIO; ··· 272 { 273 274 if (acpi_device_dir(device)) { 275 - remove_proc_entry(ACPI_PROCESSOR_FILE_INFO, 276 - acpi_device_dir(device)); 277 remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, 278 - acpi_device_dir(device)); 279 - remove_proc_entry(ACPI_PROCESSOR_FILE_LIMIT, 280 acpi_device_dir(device)); 281 remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); 282 acpi_device_dir(device) = NULL; ··· 280 281 return 0; 282 } 283 - #else 284 - static inline int acpi_processor_add_fs(struct acpi_device *device) 285 - { 286 - return 0; 287 - } 288 - static inline int acpi_processor_remove_fs(struct acpi_device *device) 289 - { 290 - return 0; 291 - } 292 - #endif 293 294 /* -------------------------------------------------------------------------- 295 Driver Interface ··· 842 843 memset(&errata, 0, sizeof(errata)); 844 845 - #ifdef CONFIG_ACPI_PROCFS 846 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 847 if (!acpi_processor_dir) 848 return -ENOMEM; 849 - #endif 850 851 if (!cpuidle_register_driver(&acpi_idle_driver)) { 852 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", ··· 871 out_cpuidle: 872 cpuidle_unregister_driver(&acpi_idle_driver); 873 874 - #ifdef CONFIG_ACPI_PROCFS 875 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 876 - #endif 877 878 return result; 879 } ··· 891 892 cpuidle_unregister_driver(&acpi_idle_driver); 893 894 - #ifdef CONFIG_ACPI_PROCFS 895 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 896 - #endif 897 898 return; 899 }
··· 83 84 static int acpi_processor_add(struct acpi_device *device); 85 static int acpi_processor_remove(struct acpi_device *device, int type); 86 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); 88 static int acpi_processor_handle_eject(struct acpi_processor *pr); ··· 113 114 #define INSTALL_NOTIFY_HANDLER 1 115 #define UNINSTALL_NOTIFY_HANDLER 2 116 117 DEFINE_PER_CPU(struct acpi_processor *, processors); 118 EXPORT_PER_CPU_SYMBOL(processors); ··· 256 return result; 257 } 258 259 static struct proc_dir_entry *acpi_processor_dir = NULL; 260 261 static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) 262 { ··· 306 return -ENODEV; 307 } 308 309 /* 'throttling' [R/W] */ 310 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, 311 S_IFREG | S_IRUGO | S_IWUSR, 312 acpi_device_dir(device), 313 &acpi_processor_throttling_fops, 314 acpi_driver_data(device)); 315 if (!entry) 316 return -EIO; ··· 337 { 338 339 if (acpi_device_dir(device)) { 340 remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, 341 acpi_device_dir(device)); 342 remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); 343 acpi_device_dir(device) = NULL; ··· 349 350 return 0; 351 } 352 353 /* -------------------------------------------------------------------------- 354 Driver Interface ··· 921 922 memset(&errata, 0, sizeof(errata)); 923 924 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 925 if (!acpi_processor_dir) 926 return -ENOMEM; 927 928 if (!cpuidle_register_driver(&acpi_idle_driver)) { 929 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", ··· 952 out_cpuidle: 953 cpuidle_unregister_driver(&acpi_idle_driver); 954 955 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 956 957 return result; 958 } ··· 974 975 cpuidle_unregister_driver(&acpi_idle_driver); 976 977 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 978 979 return; 980 }
-99
drivers/acpi/processor_idle.c
··· 33 #include <linux/init.h> 34 #include <linux/cpufreq.h> 35 #include <linux/slab.h> 36 - #include <linux/proc_fs.h> 37 - #include <linux/seq_file.h> 38 #include <linux/acpi.h> 39 #include <linux/dmi.h> 40 #include <linux/moduleparam.h> ··· 79 80 static unsigned int latency_factor __read_mostly = 2; 81 module_param(latency_factor, uint, 0644); 82 - 83 - #ifdef CONFIG_ACPI_PROCFS 84 - static u64 us_to_pm_timer_ticks(s64 t) 85 - { 86 - return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); 87 - } 88 - #endif 89 90 /* 91 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. ··· 680 return 0; 681 } 682 683 - #ifdef CONFIG_ACPI_PROCFS 684 - static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) 685 - { 686 - struct acpi_processor *pr = seq->private; 687 - unsigned int i; 688 - 689 - 690 - if (!pr) 691 - goto end; 692 - 693 - seq_printf(seq, "active state: C%zd\n" 694 - "max_cstate: C%d\n" 695 - "maximum allowed latency: %d usec\n", 696 - pr->power.state ? pr->power.state - pr->power.states : 0, 697 - max_cstate, pm_qos_request(PM_QOS_CPU_DMA_LATENCY)); 698 - 699 - seq_puts(seq, "states:\n"); 700 - 701 - for (i = 1; i <= pr->power.count; i++) { 702 - seq_printf(seq, " %cC%d: ", 703 - (&pr->power.states[i] == 704 - pr->power.state ? '*' : ' '), i); 705 - 706 - if (!pr->power.states[i].valid) { 707 - seq_puts(seq, "<not supported>\n"); 708 - continue; 709 - } 710 - 711 - switch (pr->power.states[i].type) { 712 - case ACPI_STATE_C1: 713 - seq_printf(seq, "type[C1] "); 714 - break; 715 - case ACPI_STATE_C2: 716 - seq_printf(seq, "type[C2] "); 717 - break; 718 - case ACPI_STATE_C3: 719 - seq_printf(seq, "type[C3] "); 720 - break; 721 - default: 722 - seq_printf(seq, "type[--] "); 723 - break; 724 - } 725 - 726 - seq_puts(seq, "promotion[--] "); 727 - 728 - seq_puts(seq, "demotion[--] "); 729 - 730 - seq_printf(seq, "latency[%03d] usage[%08d] duration[%020Lu]\n", 731 - pr->power.states[i].latency, 732 - pr->power.states[i].usage, 733 - us_to_pm_timer_ticks(pr->power.states[i].time)); 734 - } 735 - 736 - end: 737 - return 0; 738 - } 739 - 740 - static int acpi_processor_power_open_fs(struct inode *inode, struct file *file) 741 - { 742 - return single_open(file, acpi_processor_power_seq_show, 743 - PDE(inode)->data); 744 - } 745 - 746 - static const struct file_operations acpi_processor_power_fops = { 747 - .owner = THIS_MODULE, 748 - .open = acpi_processor_power_open_fs, 749 - .read = seq_read, 750 - .llseek = seq_lseek, 751 - .release = single_release, 752 - }; 753 - #endif 754 - 755 /** 756 * acpi_idle_bm_check - checks if bus master activity was detected 757 */ ··· 1091 { 1092 acpi_status status = 0; 1093 static int first_run; 1094 - #ifdef CONFIG_ACPI_PROCFS 1095 - struct proc_dir_entry *entry = NULL; 1096 - #endif 1097 1098 if (boot_option_idle_override) 1099 return 0; ··· 1139 if (cpuidle_register_device(&pr->power.dev)) 1140 return -EIO; 1141 } 1142 - #ifdef CONFIG_ACPI_PROCFS 1143 - /* 'power' [R] */ 1144 - entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER, 1145 - S_IRUGO, acpi_device_dir(device), 1146 - &acpi_processor_power_fops, 1147 - acpi_driver_data(device)); 1148 - if (!entry) 1149 - return -EIO; 1150 - #endif 1151 return 0; 1152 } 1153 ··· 1150 1151 cpuidle_unregister_device(&pr->power.dev); 1152 pr->flags.power_setup_done = 0; 1153 - 1154 - #ifdef CONFIG_ACPI_PROCFS 1155 - if (acpi_device_dir(device)) 1156 - remove_proc_entry(ACPI_PROCESSOR_FILE_POWER, 1157 - acpi_device_dir(device)); 1158 - #endif 1159 1160 return 0; 1161 }
··· 33 #include <linux/init.h> 34 #include <linux/cpufreq.h> 35 #include <linux/slab.h> 36 #include <linux/acpi.h> 37 #include <linux/dmi.h> 38 #include <linux/moduleparam.h> ··· 81 82 static unsigned int latency_factor __read_mostly = 2; 83 module_param(latency_factor, uint, 0644); 84 85 /* 86 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. ··· 689 return 0; 690 } 691 692 /** 693 * acpi_idle_bm_check - checks if bus master activity was detected 694 */ ··· 1172 { 1173 acpi_status status = 0; 1174 static int first_run; 1175 1176 if (boot_option_idle_override) 1177 return 0; ··· 1223 if (cpuidle_register_device(&pr->power.dev)) 1224 return -EIO; 1225 } 1226 return 0; 1227 } 1228 ··· 1243 1244 cpuidle_unregister_device(&pr->power.dev); 1245 pr->flags.power_setup_done = 0; 1246 1247 return 0; 1248 }
-83
drivers/acpi/processor_thermal.c
··· 30 #include <linux/module.h> 31 #include <linux/init.h> 32 #include <linux/cpufreq.h> 33 - #include <linux/proc_fs.h> 34 - #include <linux/seq_file.h> 35 #include <linux/sysdev.h> 36 37 #include <asm/uaccess.h> ··· 436 .get_cur_state = processor_get_cur_state, 437 .set_cur_state = processor_set_cur_state, 438 }; 439 - 440 - /* /proc interface */ 441 - #ifdef CONFIG_ACPI_PROCFS 442 - static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) 443 - { 444 - struct acpi_processor *pr = seq->private; 445 - 446 - if (!pr) 447 - goto end; 448 - 449 - if (!pr->flags.limit) { 450 - seq_puts(seq, "<not supported>\n"); 451 - goto end; 452 - } 453 - 454 - seq_printf(seq, "active limit: P%d:T%d\n" 455 - "user limit: P%d:T%d\n" 456 - "thermal limit: P%d:T%d\n", 457 - pr->limit.state.px, pr->limit.state.tx, 458 - pr->limit.user.px, pr->limit.user.tx, 459 - pr->limit.thermal.px, pr->limit.thermal.tx); 460 - 461 - end: 462 - return 0; 463 - } 464 - 465 - static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file) 466 - { 467 - return single_open(file, acpi_processor_limit_seq_show, 468 - PDE(inode)->data); 469 - } 470 - 471 - static ssize_t acpi_processor_write_limit(struct file * file, 472 - const char __user * buffer, 473 - size_t count, loff_t * data) 474 - { 475 - int result = 0; 476 - struct seq_file *m = file->private_data; 477 - struct acpi_processor *pr = m->private; 478 - char limit_string[25] = { '\0' }; 479 - int px = 0; 480 - int tx = 0; 481 - 482 - 483 - if (!pr || (count > sizeof(limit_string) - 1)) { 484 - return -EINVAL; 485 - } 486 - 487 - if (copy_from_user(limit_string, buffer, count)) { 488 - return -EFAULT; 489 - } 490 - 491 - limit_string[count] = '\0'; 492 - 493 - if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) { 494 - printk(KERN_ERR PREFIX "Invalid data format\n"); 495 - return -EINVAL; 496 - } 497 - 498 - if (pr->flags.throttling) { 499 - if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) { 500 - printk(KERN_ERR PREFIX "Invalid tx\n"); 501 - return -EINVAL; 502 - } 503 - pr->limit.user.tx = tx; 504 - } 505 - 506 - result = acpi_processor_apply_limit(pr); 507 - 508 - return count; 509 - } 510 - 511 - const struct file_operations acpi_processor_limit_fops = { 512 - .owner = THIS_MODULE, 513 - .open = acpi_processor_limit_open_fs, 514 - .read = seq_read, 515 - .write = acpi_processor_write_limit, 516 - .llseek = seq_lseek, 517 - .release = single_release, 518 - }; 519 - #endif
··· 30 #include <linux/module.h> 31 #include <linux/init.h> 32 #include <linux/cpufreq.h> 33 #include <linux/sysdev.h> 34 35 #include <asm/uaccess.h> ··· 438 .get_cur_state = processor_get_cur_state, 439 .set_cur_state = processor_set_cur_state, 440 };
-2
drivers/acpi/processor_throttling.c
··· 1215 } 1216 1217 /* proc interface */ 1218 - #ifdef CONFIG_ACPI_PROCFS 1219 static int acpi_processor_throttling_seq_show(struct seq_file *seq, 1220 void *offset) 1221 { ··· 1322 .llseek = seq_lseek, 1323 .release = single_release, 1324 }; 1325 - #endif
··· 1215 } 1216 1217 /* proc interface */ 1218 static int acpi_processor_throttling_seq_show(struct seq_file *seq, 1219 void *offset) 1220 { ··· 1323 .llseek = seq_lseek, 1324 .release = single_release, 1325 };
-1
include/acpi/processor.h
··· 338 339 /* in processor_thermal.c */ 340 int acpi_processor_get_limit_info(struct acpi_processor *pr); 341 - extern const struct file_operations acpi_processor_limit_fops; 342 extern struct thermal_cooling_device_ops processor_cooling_ops; 343 #ifdef CONFIG_CPU_FREQ 344 void acpi_thermal_cpufreq_init(void);
··· 338 339 /* in processor_thermal.c */ 340 int acpi_processor_get_limit_info(struct acpi_processor *pr); 341 extern struct thermal_cooling_device_ops processor_cooling_ops; 342 #ifdef CONFIG_CPU_FREQ 343 void acpi_thermal_cpufreq_init(void);