Merge branch 'processor-procfs-2.6.32' into release
authorLen Brown <len.brown@intel.com>
Sat, 19 Sep 2009 06:10:40 +0000 (02:10 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 19 Sep 2009 06:10:40 +0000 (02:10 -0400)
1  2 
drivers/acpi/Kconfig
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_thermal.c
drivers/acpi/processor_throttling.c

diff --combined drivers/acpi/Kconfig
@@@ -60,7 -60,11 +60,11 @@@ config ACPI_PROCF
          /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP)
          /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer)
          /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level)
+         /proc/acpi/processor/*/power (/sys/devices/system/cpu/*/cpuidle/*)
+         /proc/acpi/processor/*/performance (/sys/devices/system/cpu/*/
+               cpufreq/*)
+         /proc/acpi/processor/*/throttling (/sys/class/thermal/
+               cooling_device*/*)
          This option has no effect on /proc/acpi/ files
          and functions which do not yet exist in /sys.
  
@@@ -82,17 -86,6 +86,17 @@@ config ACPI_PROCFS_POWE
  
          Say N to delete power /proc/acpi/ directories that have moved to /sys/
  
 +config ACPI_POWER_METER
 +      tristate "ACPI 4.0 power meter"
 +      depends on HWMON
 +      help
 +        This driver exposes ACPI 4.0 power meters as hardware monitoring
 +        devices.  Say Y (or M) if you have a computer with ACPI 4.0 firmware
 +        and a power meter.
 +
 +        To compile this driver as a module, choose M here:
 +        the module will be called power-meter.
 +
  config ACPI_SYSFS_POWER
        bool "Future power /sys interface"
        select POWER_SUPPLY
@@@ -277,7 -270,6 +281,7 @@@ config ACPI_DEBUG_FUNC_TRAC
  
  config ACPI_PCI_SLOT
        tristate "PCI slot detection driver"
 +      depends on SYSFS
        default n
        help
          This driver creates entries in /sys/bus/pci/slots/ for all PCI
@@@ -59,8 -59,6 +59,8 @@@
  #include <acpi/acpi_drivers.h>
  #include <acpi/processor.h>
  
 +#define PREFIX "ACPI: "
 +
  #define ACPI_PROCESSOR_CLASS          "processor"
  #define ACPI_PROCESSOR_DEVICE_NAME    "Processor"
  #define ACPI_PROCESSOR_FILE_INFO      "info"
@@@ -81,8 -79,11 +81,10 @@@ MODULE_DESCRIPTION("ACPI Processor Driv
  MODULE_LICENSE("GPL");
  
  static int acpi_processor_add(struct acpi_device *device);
 -static int acpi_processor_start(struct acpi_device *device);
  static int acpi_processor_remove(struct acpi_device *device, int type);
+ #ifdef CONFIG_ACPI_PROCFS
  static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
+ #endif
  static void acpi_processor_notify(struct acpi_device *device, u32 event);
  static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu);
  static int acpi_processor_handle_eject(struct acpi_processor *pr);
@@@ -90,7 -91,7 +92,7 @@@
  
  static const struct acpi_device_id processor_device_ids[] = {
        {ACPI_PROCESSOR_OBJECT_HID, 0},
 -      {ACPI_PROCESSOR_HID, 0},
 +      {"ACPI0007", 0},
        {"", 0},
  };
  MODULE_DEVICE_TABLE(acpi, processor_device_ids);
@@@ -102,6 -103,7 +104,6 @@@ static struct acpi_driver acpi_processo
        .ops = {
                .add = acpi_processor_add,
                .remove = acpi_processor_remove,
 -              .start = acpi_processor_start,
                .suspend = acpi_processor_suspend,
                .resume = acpi_processor_resume,
                .notify = acpi_processor_notify,
  
  #define INSTALL_NOTIFY_HANDLER                1
  #define UNINSTALL_NOTIFY_HANDLER      2
+ #ifdef CONFIG_ACPI_PROCFS
  static const struct file_operations acpi_processor_info_fops = {
        .owner = THIS_MODULE,
        .open = acpi_processor_info_open_fs,
        .llseek = seq_lseek,
        .release = single_release,
  };
+ #endif
  
  DEFINE_PER_CPU(struct acpi_processor *, processors);
  struct acpi_processor_errata errata __read_mostly;
@@@ -316,6 -319,7 +319,7 @@@ static int acpi_processor_set_pdc(struc
                                FS Interface (/proc)
     -------------------------------------------------------------------------- */
  
+ #ifdef CONFIG_ACPI_PROCFS
  static struct proc_dir_entry *acpi_processor_dir = NULL;
  
  static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset)
@@@ -388,7 -392,6 +392,6 @@@ static int acpi_processor_add_fs(struc
                return -EIO;
        return 0;
  }
  static int acpi_processor_remove_fs(struct acpi_device *device)
  {
  
  
        return 0;
  }
+ #else
+ static inline int acpi_processor_add_fs(struct acpi_device *device)
+ {
+       return 0;
+ }
+ static inline int acpi_processor_remove_fs(struct acpi_device *device)
+ {
+       return 0;
+ }
+ #endif
  
  /* Use the acpiid in MADT to map cpus in case of SMP */
  
@@@ -596,21 -609,7 +609,21 @@@ static int acpi_processor_get_info(stru
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "No bus mastering arbitration control\n"));
  
 -      if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_HID)) {
 +      if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
 +              /* Declared with "Processor" statement; match ProcessorID */
 +              status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
 +              if (ACPI_FAILURE(status)) {
 +                      printk(KERN_ERR PREFIX "Evaluating processor object\n");
 +                      return -ENODEV;
 +              }
 +
 +              /*
 +               * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
 +               *      >>> 'acpi_get_processor_id(acpi_id, &id)' in
 +               *      arch/xxx/acpi.c
 +               */
 +              pr->acpi_id = object.processor.proc_id;
 +      } else {
                /*
                 * Declared with "Device" statement; match _UID.
                 * Note that we don't handle string _UIDs yet.
                }
                device_declaration = 1;
                pr->acpi_id = value;
 -      } else {
 -              /* Declared with "Processor" statement; match ProcessorID */
 -              status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
 -              if (ACPI_FAILURE(status)) {
 -                      printk(KERN_ERR PREFIX "Evaluating processor object\n");
 -                      return -ENODEV;
 -              }
 -
 -              /*
 -               * TBD: Synch processor ID (via LAPIC/LSAPIC structures) on SMP.
 -               *      >>> 'acpi_get_processor_id(acpi_id, &id)' in
 -               *      arch/xxx/acpi.c
 -               */
 -              pr->acpi_id = object.processor.proc_id;
        }
        cpu_index = get_cpu_id(pr->handle, device_declaration, pr->acpi_id);
  
                        return -ENODEV;
                }
        }
 -
 +      /*
 +       * On some boxes several processors use the same processor bus id.
 +       * But they are located in different scope. For example:
 +       * \_SB.SCK0.CPU0
 +       * \_SB.SCK1.CPU0
 +       * Rename the processor device bus id. And the new bus id will be
 +       * generated as the following format:
 +       * CPU+CPU ID.
 +       */
 +      sprintf(acpi_device_bid(device), "CPU%X", pr->id);
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
                          pr->acpi_id));
  
  
  static DEFINE_PER_CPU(void *, processor_device_array);
  
 -static int __cpuinit acpi_processor_start(struct acpi_device *device)
 -{
 -      int result = 0;
 -      struct acpi_processor *pr;
 -      struct sys_device *sysdev;
 -
 -      pr = acpi_driver_data(device);
 -
 -      result = acpi_processor_get_info(device);
 -      if (result) {
 -              /* Processor is physically not present */
 -              return 0;
 -      }
 -
 -      BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 -
 -      /*
 -       * Buggy BIOS check
 -       * ACPI id of processors can be reported wrongly by the BIOS.
 -       * Don't trust it blindly
 -       */
 -      if (per_cpu(processor_device_array, pr->id) != NULL &&
 -          per_cpu(processor_device_array, pr->id) != device) {
 -              printk(KERN_WARNING "BIOS reported wrong ACPI id "
 -                      "for the processor\n");
 -              return -ENODEV;
 -      }
 -      per_cpu(processor_device_array, pr->id) = device;
 -
 -      per_cpu(processors, pr->id) = pr;
 -
 -      result = acpi_processor_add_fs(device);
 -      if (result)
 -              goto end;
 -
 -      sysdev = get_cpu_sysdev(pr->id);
 -      if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
 -              return -EFAULT;
 -
 -      /* _PDC call should be done before doing anything else (if reqd.). */
 -      arch_acpi_processor_init_pdc(pr);
 -      acpi_processor_set_pdc(pr);
 -#ifdef CONFIG_CPU_FREQ
 -      acpi_processor_ppc_has_changed(pr);
 -#endif
 -      acpi_processor_get_throttling_info(pr);
 -      acpi_processor_get_limit_info(pr);
 -
 -
 -      acpi_processor_power_init(pr, device);
 -
 -      pr->cdev = thermal_cooling_device_register("Processor", device,
 -                                              &processor_cooling_ops);
 -      if (IS_ERR(pr->cdev)) {
 -              result = PTR_ERR(pr->cdev);
 -              goto end;
 -      }
 -
 -      dev_info(&device->dev, "registered as cooling_device%d\n",
 -               pr->cdev->id);
 -
 -      result = sysfs_create_link(&device->dev.kobj,
 -                                 &pr->cdev->device.kobj,
 -                                 "thermal_cooling");
 -      if (result)
 -              printk(KERN_ERR PREFIX "Create sysfs link\n");
 -      result = sysfs_create_link(&pr->cdev->device.kobj,
 -                                 &device->dev.kobj,
 -                                 "device");
 -      if (result)
 -              printk(KERN_ERR PREFIX "Create sysfs link\n");
 -
 -      if (pr->flags.throttling) {
 -              printk(KERN_INFO PREFIX "%s [%s] (supports",
 -                     acpi_device_name(device), acpi_device_bid(device));
 -              printk(" %d throttling states", pr->throttling.state_count);
 -              printk(")\n");
 -      }
 -
 -      end:
 -
 -      return result;
 -}
 -
  static void acpi_processor_notify(struct acpi_device *device, u32 event)
  {
        struct acpi_processor *pr = acpi_driver_data(device);
@@@ -760,8 -848,10 +773,8 @@@ static struct notifier_block acpi_cpu_n
  static int acpi_processor_add(struct acpi_device *device)
  {
        struct acpi_processor *pr = NULL;
 -
 -
 -      if (!device)
 -              return -EINVAL;
 +      int result = 0;
 +      struct sys_device *sysdev;
  
        pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
        if (!pr)
        strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
        device->driver_data = pr;
  
 +      result = acpi_processor_get_info(device);
 +      if (result) {
 +              /* Processor is physically not present */
 +              return 0;
 +      }
 +
 +      BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0));
 +
 +      /*
 +       * Buggy BIOS check
 +       * ACPI id of processors can be reported wrongly by the BIOS.
 +       * Don't trust it blindly
 +       */
 +      if (per_cpu(processor_device_array, pr->id) != NULL &&
 +          per_cpu(processor_device_array, pr->id) != device) {
 +              printk(KERN_WARNING "BIOS reported wrong ACPI id "
 +                      "for the processor\n");
 +              result = -ENODEV;
 +              goto err_free_cpumask;
 +      }
 +      per_cpu(processor_device_array, pr->id) = device;
 +
 +      per_cpu(processors, pr->id) = pr;
 +
 +      result = acpi_processor_add_fs(device);
 +      if (result)
 +              goto err_free_cpumask;
 +
 +      sysdev = get_cpu_sysdev(pr->id);
 +      if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
 +              result = -EFAULT;
 +              goto err_remove_fs;
 +      }
 +
 +      /* _PDC call should be done before doing anything else (if reqd.). */
 +      arch_acpi_processor_init_pdc(pr);
 +      acpi_processor_set_pdc(pr);
 +      arch_acpi_processor_cleanup_pdc(pr);
 +
 +#ifdef CONFIG_CPU_FREQ
 +      acpi_processor_ppc_has_changed(pr);
 +#endif
 +      acpi_processor_get_throttling_info(pr);
 +      acpi_processor_get_limit_info(pr);
 +
 +
 +      acpi_processor_power_init(pr, device);
 +
 +      pr->cdev = thermal_cooling_device_register("Processor", device,
 +                                              &processor_cooling_ops);
 +      if (IS_ERR(pr->cdev)) {
 +              result = PTR_ERR(pr->cdev);
 +              goto err_power_exit;
 +      }
 +
 +      dev_info(&device->dev, "registered as cooling_device%d\n",
 +               pr->cdev->id);
 +
 +      result = sysfs_create_link(&device->dev.kobj,
 +                                 &pr->cdev->device.kobj,
 +                                 "thermal_cooling");
 +      if (result) {
 +              printk(KERN_ERR PREFIX "Create sysfs link\n");
 +              goto err_thermal_unregister;
 +      }
 +      result = sysfs_create_link(&pr->cdev->device.kobj,
 +                                 &device->dev.kobj,
 +                                 "device");
 +      if (result) {
 +              printk(KERN_ERR PREFIX "Create sysfs link\n");
 +              goto err_remove_sysfs;
 +      }
 +
 +      if (pr->flags.throttling) {
 +              printk(KERN_INFO PREFIX "%s [%s] (supports",
 +                     acpi_device_name(device), acpi_device_bid(device));
 +              printk(" %d throttling states", pr->throttling.state_count);
 +              printk(")\n");
 +      }
 +
        return 0;
 +
 +err_remove_sysfs:
 +      sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
 +err_thermal_unregister:
 +      thermal_cooling_device_unregister(pr->cdev);
 +err_power_exit:
 +      acpi_processor_power_exit(pr, device);
 +err_remove_fs:
 +      acpi_processor_remove_fs(device);
 +err_free_cpumask:
 +      free_cpumask_var(pr->throttling.shared_cpu_map);
 +
 +      return result;
  }
  
  static int acpi_processor_remove(struct acpi_device *device, int type)
@@@ -947,6 -944,7 +960,6 @@@ int acpi_processor_device_add(acpi_hand
  {
        acpi_handle phandle;
        struct acpi_device *pdev;
 -      struct acpi_processor *pr;
  
  
        if (acpi_get_parent(handle, &phandle)) {
                return -ENODEV;
        }
  
 -      acpi_bus_start(*device);
 -
 -      pr = acpi_driver_data(*device);
 -      if (!pr)
 -              return -ENODEV;
 -
 -      if ((pr->id >= 0) && (pr->id < nr_cpu_ids)) {
 -              kobject_uevent(&(*device)->dev.kobj, KOBJ_ONLINE);
 -      }
        return 0;
  }
  
@@@ -990,6 -997,25 +1003,6 @@@ static void __ref acpi_processor_hotplu
                                            "Unable to add the device\n");
                        break;
                }
 -
 -              pr = acpi_driver_data(device);
 -              if (!pr) {
 -                      printk(KERN_ERR PREFIX "Driver data is NULL\n");
 -                      break;
 -              }
 -
 -              if (pr->id >= 0 && (pr->id < nr_cpu_ids)) {
 -                      kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
 -                      break;
 -              }
 -
 -              result = acpi_processor_start(device);
 -              if ((!result) && ((pr->id >= 0) && (pr->id < nr_cpu_ids))) {
 -                      kobject_uevent(&device->dev.kobj, KOBJ_ONLINE);
 -              } else {
 -                      printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
 -                                  acpi_device_bid(device));
 -              }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                    "Driver data is NULL, dropping EJECT\n");
                        return;
                }
 -
 -              if ((pr->id < nr_cpu_ids) && (cpu_present(pr->id)))
 -                      kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@@ -1124,9 -1153,6 +1137,9 @@@ static int __init acpi_processor_init(v
  {
        int result = 0;
  
 +      if (acpi_disabled)
 +              return 0;
 +
        memset(&errata, 0, sizeof(errata));
  
  #ifdef CONFIG_SMP
                                (struct acpi_table_header **)&madt)))
                madt = NULL;
  #endif
+ #ifdef CONFIG_ACPI_PROCFS
        acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
        if (!acpi_processor_dir)
                return -ENOMEM;
+ #endif
        /*
         * Check whether the system is DMI table. If yes, OSPM
         * should not use mwait for CPU-states.
@@@ -1166,16 -1192,15 +1179,18 @@@ out_cpuidle
        cpuidle_unregister_driver(&acpi_idle_driver);
  
  out_proc:
+ #ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
+ #endif
  
        return result;
  }
  
  static void __exit acpi_processor_exit(void)
  {
 +      if (acpi_disabled)
 +              return;
 +
        acpi_processor_ppc_exit();
  
        acpi_thermal_cpufreq_exit();
  
        cpuidle_unregister_driver(&acpi_idle_driver);
  
+ #ifdef CONFIG_ACPI_PROCFS
        remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
+ #endif
  
        return;
  }
@@@ -60,8 -60,6 +60,8 @@@
  #include <acpi/processor.h>
  #include <asm/processor.h>
  
 +#define PREFIX "ACPI: "
 +
  #define ACPI_PROCESSOR_CLASS            "processor"
  #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
  ACPI_MODULE_NAME("processor_idle");
@@@ -141,7 -139,7 +141,7 @@@ static void acpi_safe_halt(void
   * are affected too. We pick the most conservative approach: we assume
   * that the local APIC stops in both C2 and C3.
   */
 -static void acpi_timer_check_state(int state, struct acpi_processor *pr,
 +static void lapic_timer_check_state(int state, struct acpi_processor *pr,
                                   struct acpi_processor_cx *cx)
  {
        struct acpi_processor_power *pwr = &pr->power;
                pr->power.timer_broadcast_on_state = state;
  }
  
 -static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
 +static void lapic_timer_propagate_broadcast(void *arg)
  {
 +      struct acpi_processor *pr = (struct acpi_processor *) arg;
        unsigned long reason;
  
        reason = pr->power.timer_broadcast_on_state < INT_MAX ?
  }
  
  /* Power(C) State timer broadcast control */
 -static void acpi_state_timer_broadcast(struct acpi_processor *pr,
 +static void lapic_timer_state_broadcast(struct acpi_processor *pr,
                                       struct acpi_processor_cx *cx,
                                       int broadcast)
  {
  
  #else
  
 -static void acpi_timer_check_state(int state, struct acpi_processor *pr,
 +static void lapic_timer_check_state(int state, struct acpi_processor *pr,
                                   struct acpi_processor_cx *cstate) { }
 -static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { }
 -static void acpi_state_timer_broadcast(struct acpi_processor *pr,
 +static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }
 +static void lapic_timer_state_broadcast(struct acpi_processor *pr,
                                       struct acpi_processor_cx *cx,
                                       int broadcast)
  {
@@@ -518,8 -515,7 +518,8 @@@ static void acpi_processor_power_verify
  static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
                                           struct acpi_processor_cx *cx)
  {
 -      static int bm_check_flag;
 +      static int bm_check_flag = -1;
 +      static int bm_control_flag = -1;
  
  
        if (!cx->address)
        }
  
        /* All the logic here assumes flags.bm_check is same across all CPUs */
 -      if (!bm_check_flag) {
 +      if (bm_check_flag == -1) {
                /* Determine whether bm_check is needed based on CPU  */
                acpi_processor_power_init_bm_check(&(pr->flags), pr->id);
                bm_check_flag = pr->flags.bm_check;
 +              bm_control_flag = pr->flags.bm_control;
        } else {
                pr->flags.bm_check = bm_check_flag;
 +              pr->flags.bm_control = bm_control_flag;
        }
  
        if (pr->flags.bm_check) {
@@@ -620,26 -614,29 +620,26 @@@ static int acpi_processor_power_verify(
                switch (cx->type) {
                case ACPI_STATE_C1:
                        cx->valid = 1;
 -                      acpi_timer_check_state(i, pr, cx);
                        break;
  
                case ACPI_STATE_C2:
                        acpi_processor_power_verify_c2(cx);
 -                      if (cx->valid)
 -                              acpi_timer_check_state(i, pr, cx);
                        break;
  
                case ACPI_STATE_C3:
                        acpi_processor_power_verify_c3(pr, cx);
 -                      if (cx->valid)
 -                              acpi_timer_check_state(i, pr, cx);
                        break;
                }
 -              if (cx->valid)
 -                      tsc_check_state(cx->type);
 +              if (!cx->valid)
 +                      continue;
  
 -              if (cx->valid)
 -                      working++;
 +              lapic_timer_check_state(i, pr, cx);
 +              tsc_check_state(cx->type);
 +              working++;
        }
  
 -      acpi_propagate_timer_broadcast(pr);
 +      smp_call_function_single(pr->id, lapic_timer_propagate_broadcast,
 +                               pr, 1);
  
        return (working);
  }
@@@ -682,6 -679,7 +682,7 @@@ static int acpi_processor_get_power_inf
        return 0;
  }
  
+ #ifdef CONFIG_ACPI_PROCFS
  static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
  {
        struct acpi_processor *pr = seq->private;
@@@ -761,7 -759,7 +762,7 @@@ static const struct file_operations acp
        .llseek = seq_lseek,
        .release = single_release,
  };
+ #endif
  
  /**
   * acpi_idle_bm_check - checks if bus master activity was detected
@@@ -842,7 -840,7 +843,7 @@@ static int acpi_idle_enter_c1(struct cp
                return 0;
        }
  
 -      acpi_state_timer_broadcast(pr, cx, 1);
 +      lapic_timer_state_broadcast(pr, cx, 1);
        kt1 = ktime_get_real();
        acpi_idle_do_entry(cx);
        kt2 = ktime_get_real();
  
        local_irq_enable();
        cx->usage++;
 -      acpi_state_timer_broadcast(pr, cx, 0);
 +      lapic_timer_state_broadcast(pr, cx, 0);
  
        return idle_time;
  }
@@@ -895,7 -893,7 +896,7 @@@ static int acpi_idle_enter_simple(struc
         * Must be done before busmaster disable as we might need to
         * access HPET !
         */
 -      acpi_state_timer_broadcast(pr, cx, 1);
 +      lapic_timer_state_broadcast(pr, cx, 1);
  
        if (cx->type == ACPI_STATE_C3)
                ACPI_FLUSH_CPU_CACHE();
  
        cx->usage++;
  
 -      acpi_state_timer_broadcast(pr, cx, 0);
 +      lapic_timer_state_broadcast(pr, cx, 0);
        cx->time += sleep_ticks;
        return idle_time;
  }
@@@ -984,7 -982,7 +985,7 @@@ static int acpi_idle_enter_bm(struct cp
         * Must be done before busmaster disable as we might need to
         * access HPET !
         */
 -      acpi_state_timer_broadcast(pr, cx, 1);
 +      lapic_timer_state_broadcast(pr, cx, 1);
  
        kt1 = ktime_get_real();
        /*
  
        cx->usage++;
  
 -      acpi_state_timer_broadcast(pr, cx, 0);
 +      lapic_timer_state_broadcast(pr, cx, 0);
        cx->time += sleep_ticks;
        return idle_time;
  }
@@@ -1162,7 -1160,9 +1163,9 @@@ int __cpuinit acpi_processor_power_init
  {
        acpi_status status = 0;
        static int first_run;
+ #ifdef CONFIG_ACPI_PROCFS
        struct proc_dir_entry *entry = NULL;
+ #endif
        unsigned int i;
  
        if (boot_option_idle_override)
                                       pr->power.states[i].type);
                printk(")\n");
        }
+ #ifdef CONFIG_ACPI_PROCFS
        /* 'power' [R] */
        entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER,
                                 S_IRUGO, acpi_device_dir(device),
                                 acpi_driver_data(device));
        if (!entry)
                return -EIO;
+ #endif
        return 0;
  }
  
@@@ -1239,9 -1240,11 +1243,11 @@@ int acpi_processor_power_exit(struct ac
        cpuidle_unregister_device(&pr->power.dev);
        pr->flags.power_setup_done = 0;
  
+ #ifdef CONFIG_ACPI_PROCFS
        if (acpi_device_dir(device))
                remove_proc_entry(ACPI_PROCESSOR_FILE_POWER,
                                  acpi_device_dir(device));
+ #endif
  
        return 0;
  }
@@@ -40,8 -40,6 +40,8 @@@
  #include <acpi/processor.h>
  #include <acpi/acpi_drivers.h>
  
 +#define PREFIX "ACPI: "
 +
  #define ACPI_PROCESSOR_CLASS            "processor"
  #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
  ACPI_MODULE_NAME("processor_thermal");
@@@ -68,7 -66,7 +68,7 @@@ static int acpi_processor_apply_limit(s
                if (pr->limit.thermal.tx > tx)
                        tx = pr->limit.thermal.tx;
  
 -              result = acpi_processor_set_throttling(pr, tx);
 +              result = acpi_processor_set_throttling(pr, tx, false);
                if (result)
                        goto end;
        }
@@@ -423,12 -421,12 +423,12 @@@ processor_set_cur_state(struct thermal_
  
        if (state <= max_pstate) {
                if (pr->flags.throttling && pr->throttling.state)
 -                      result = acpi_processor_set_throttling(pr, 0);
 +                      result = acpi_processor_set_throttling(pr, 0, false);
                cpufreq_set_cur_state(pr->id, state);
        } else {
                cpufreq_set_cur_state(pr->id, max_pstate);
                result = acpi_processor_set_throttling(pr,
 -                              state - max_pstate);
 +                              state - max_pstate, false);
        }
        return result;
  }
@@@ -440,7 -438,7 +440,7 @@@ struct thermal_cooling_device_ops proce
  };
  
  /* /proc interface */
+ #ifdef CONFIG_ACPI_PROCFS
  static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset)
  {
        struct acpi_processor *pr = (struct acpi_processor *)seq->private;
@@@ -519,3 -517,4 +519,4 @@@ const struct file_operations acpi_proce
        .llseek = seq_lseek,
        .release = single_release,
  };
+ #endif
@@@ -41,8 -41,6 +41,8 @@@
  #include <acpi/acpi_drivers.h>
  #include <acpi/processor.h>
  
 +#define PREFIX "ACPI: "
 +
  #define ACPI_PROCESSOR_CLASS            "processor"
  #define _COMPONENT              ACPI_PROCESSOR_COMPONENT
  ACPI_MODULE_NAME("processor_throttling");
@@@ -64,8 -62,7 +64,8 @@@ struct throttling_tstate 
  #define THROTTLING_POSTCHANGE      (2)
  
  static int acpi_processor_get_throttling(struct acpi_processor *pr);
 -int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
 +int acpi_processor_set_throttling(struct acpi_processor *pr,
 +                                              int state, bool force);
  
  static int acpi_processor_update_tsd_coord(void)
  {
@@@ -364,7 -361,7 +364,7 @@@ int acpi_processor_tstate_has_changed(s
                 */
                target_state = throttling_limit;
        }
 -      return acpi_processor_set_throttling(pr, target_state);
 +      return acpi_processor_set_throttling(pr, target_state, false);
  }
  
  /*
@@@ -842,10 -839,10 +842,10 @@@ static int acpi_processor_get_throttlin
        if (ret >= 0) {
                state = acpi_get_throttling_state(pr, value);
                if (state == -1) {
 -                      ACPI_WARNING((AE_INFO,
 -                              "Invalid throttling state, reset"));
 +                      ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 +                              "Invalid throttling state, reset\n"));
                        state = 0;
 -                      ret = acpi_processor_set_throttling(pr, state);
 +                      ret = acpi_processor_set_throttling(pr, state, true);
                        if (ret)
                                return ret;
                }
@@@ -918,7 -915,7 +918,7 @@@ static int acpi_processor_get_fadt_info
  }
  
  static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
 -                                            int state)
 +                                            int state, bool force)
  {
        u32 value = 0;
        u32 duty_mask = 0;
        if (!pr->flags.throttling)
                return -ENODEV;
  
 -      if (state == pr->throttling.state)
 +      if (!force && (state == pr->throttling.state))
                return 0;
  
        if (state < pr->throttling_platform_limit)
  }
  
  static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
 -                                           int state)
 +                                           int state, bool force)
  {
        int ret;
        acpi_integer value;
        if (!pr->flags.throttling)
                return -ENODEV;
  
 -      if (state == pr->throttling.state)
 +      if (!force && (state == pr->throttling.state))
                return 0;
  
        if (state < pr->throttling_platform_limit)
        return 0;
  }
  
 -int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
 +int acpi_processor_set_throttling(struct acpi_processor *pr,
 +                                              int state, bool force)
  {
        cpumask_var_t saved_mask;
        int ret = 0;
                /* FIXME: use work_on_cpu() */
                set_cpus_allowed_ptr(current, cpumask_of(pr->id));
                ret = p_throttling->acpi_processor_set_throttling(pr,
 -                                              t_state.target_state);
 +                                              t_state.target_state, force);
        } else {
                /*
                 * When the T-state coordination is SW_ALL or HW_ALL,
                        set_cpus_allowed_ptr(current, cpumask_of(i));
                        ret = match_pr->throttling.
                                acpi_processor_set_throttling(
 -                              match_pr, t_state.target_state);
 +                              match_pr, t_state.target_state, force);
                }
        }
        /*
@@@ -1205,7 -1201,7 +1205,7 @@@ int acpi_processor_get_throttling_info(
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                  "Disabling throttling (was T%d)\n",
                                  pr->throttling.state));
 -              result = acpi_processor_set_throttling(pr, 0);
 +              result = acpi_processor_set_throttling(pr, 0, false);
                if (result)
                        goto end;
        }
  }
  
  /* proc interface */
+ #ifdef CONFIG_ACPI_PROCFS
  static int acpi_processor_throttling_seq_show(struct seq_file *seq,
                                              void *offset)
  {
@@@ -1311,7 -1307,7 +1311,7 @@@ static ssize_t acpi_processor_write_thr
        if (strcmp(tmpbuf, charp) != 0)
                return -EINVAL;
  
 -      result = acpi_processor_set_throttling(pr, state_val);
 +      result = acpi_processor_set_throttling(pr, state_val, false);
        if (result)
                return result;
  
@@@ -1326,3 -1322,4 +1326,4 @@@ const struct file_operations acpi_proce
        .llseek = seq_lseek,
        .release = single_release,
  };
+ #endif