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 54 they have been replaced by functions in /sys. 55 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 57 /proc/acpi/processor/*/throttling (/sys/class/thermal/ 61 58 cooling_device*/*) 62 59 This option has no effect on /proc/acpi/ files
-85
drivers/acpi/processor_driver.c
··· 83 83 84 84 static int acpi_processor_add(struct acpi_device *device); 85 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 86 static void acpi_processor_notify(struct acpi_device *device, u32 event); 90 87 static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); 91 88 static int acpi_processor_handle_eject(struct acpi_processor *pr); ··· 110 113 111 114 #define INSTALL_NOTIFY_HANDLER 1 112 115 #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 116 123 117 DEFINE_PER_CPU(struct acpi_processor *, processors); 124 118 EXPORT_PER_CPU_SYMBOL(processors); ··· 244 256 return result; 245 257 } 246 258 247 - /* -------------------------------------------------------------------------- 248 - FS Interface (/proc) 249 - -------------------------------------------------------------------------- */ 250 - 251 - #ifdef CONFIG_ACPI_PROCFS 252 259 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 260 285 261 static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) 286 262 { ··· 258 306 return -ENODEV; 259 307 } 260 308 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 309 /* 'throttling' [R/W] */ 270 310 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, 271 311 S_IFREG | S_IRUGO | S_IWUSR, 272 312 acpi_device_dir(device), 273 313 &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 314 acpi_driver_data(device)); 284 315 if (!entry) 285 316 return -EIO; ··· 272 337 { 273 338 274 339 if (acpi_device_dir(device)) { 275 - remove_proc_entry(ACPI_PROCESSOR_FILE_INFO, 276 - acpi_device_dir(device)); 277 340 remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, 278 - acpi_device_dir(device)); 279 - remove_proc_entry(ACPI_PROCESSOR_FILE_LIMIT, 280 341 acpi_device_dir(device)); 281 342 remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); 282 343 acpi_device_dir(device) = NULL; ··· 280 349 281 350 return 0; 282 351 } 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 352 294 353 /* -------------------------------------------------------------------------- 295 354 Driver Interface ··· 842 921 843 922 memset(&errata, 0, sizeof(errata)); 844 923 845 - #ifdef CONFIG_ACPI_PROCFS 846 924 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 847 925 if (!acpi_processor_dir) 848 926 return -ENOMEM; 849 - #endif 850 927 851 928 if (!cpuidle_register_driver(&acpi_idle_driver)) { 852 929 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", ··· 871 952 out_cpuidle: 872 953 cpuidle_unregister_driver(&acpi_idle_driver); 873 954 874 - #ifdef CONFIG_ACPI_PROCFS 875 955 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 876 - #endif 877 956 878 957 return result; 879 958 } ··· 891 974 892 975 cpuidle_unregister_driver(&acpi_idle_driver); 893 976 894 - #ifdef CONFIG_ACPI_PROCFS 895 977 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 896 - #endif 897 978 898 979 return; 899 980 }
-99
drivers/acpi/processor_idle.c
··· 33 33 #include <linux/init.h> 34 34 #include <linux/cpufreq.h> 35 35 #include <linux/slab.h> 36 - #include <linux/proc_fs.h> 37 - #include <linux/seq_file.h> 38 36 #include <linux/acpi.h> 39 37 #include <linux/dmi.h> 40 38 #include <linux/moduleparam.h> ··· 79 81 80 82 static unsigned int latency_factor __read_mostly = 2; 81 83 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 84 90 85 /* 91 86 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. ··· 680 689 return 0; 681 690 } 682 691 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 692 /** 756 693 * acpi_idle_bm_check - checks if bus master activity was detected 757 694 */ ··· 1091 1172 { 1092 1173 acpi_status status = 0; 1093 1174 static int first_run; 1094 - #ifdef CONFIG_ACPI_PROCFS 1095 - struct proc_dir_entry *entry = NULL; 1096 - #endif 1097 1175 1098 1176 if (boot_option_idle_override) 1099 1177 return 0; ··· 1139 1223 if (cpuidle_register_device(&pr->power.dev)) 1140 1224 return -EIO; 1141 1225 } 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 1226 return 0; 1152 1227 } 1153 1228 ··· 1150 1243 1151 1244 cpuidle_unregister_device(&pr->power.dev); 1152 1245 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 1246 1160 1247 return 0; 1161 1248 }
-83
drivers/acpi/processor_thermal.c
··· 30 30 #include <linux/module.h> 31 31 #include <linux/init.h> 32 32 #include <linux/cpufreq.h> 33 - #include <linux/proc_fs.h> 34 - #include <linux/seq_file.h> 35 33 #include <linux/sysdev.h> 36 34 37 35 #include <asm/uaccess.h> ··· 436 438 .get_cur_state = processor_get_cur_state, 437 439 .set_cur_state = processor_set_cur_state, 438 440 }; 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
-2
drivers/acpi/processor_throttling.c
··· 1215 1215 } 1216 1216 1217 1217 /* proc interface */ 1218 - #ifdef CONFIG_ACPI_PROCFS 1219 1218 static int acpi_processor_throttling_seq_show(struct seq_file *seq, 1220 1219 void *offset) 1221 1220 { ··· 1322 1323 .llseek = seq_lseek, 1323 1324 .release = single_release, 1324 1325 }; 1325 - #endif
-1
include/acpi/processor.h
··· 338 338 339 339 /* in processor_thermal.c */ 340 340 int acpi_processor_get_limit_info(struct acpi_processor *pr); 341 - extern const struct file_operations acpi_processor_limit_fops; 342 341 extern struct thermal_cooling_device_ops processor_cooling_ops; 343 342 #ifdef CONFIG_CPU_FREQ 344 343 void acpi_thermal_cpufreq_init(void);