]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'ost' into release
authorLen Brown <len.brown@intel.com>
Wed, 16 Dec 2009 07:18:36 +0000 (02:18 -0500)
committerLen Brown <len.brown@intel.com>
Wed, 16 Dec 2009 07:18:36 +0000 (02:18 -0500)
Conflicts:
include/acpi/processor.h

Signed-off-by: Len Brown <len.brown@intel.com>
1  2 
drivers/acpi/processor_core.c
drivers/acpi/processor_perflib.c
include/acpi/processor.h

index cb4283f5a79d298280537fd471de3e3114c53f42,773d7e76f30119ea5613c7802cbfe39509815b24..65b9f29ef10b2e66aefb14bec35f642630c226cc
@@@ -722,7 -722,7 +722,7 @@@ static void acpi_processor_notify(struc
        switch (event) {
        case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:
                saved = pr->performance_platform_limit;
-               acpi_processor_ppc_has_changed(pr);
+               acpi_processor_ppc_has_changed(pr, 1);
                if (saved == pr->performance_platform_limit)
                        break;
                acpi_bus_generate_proc_event(device, event,
@@@ -758,7 -758,7 +758,7 @@@ static int acpi_cpu_soft_notify(struct 
        struct acpi_processor *pr = per_cpu(processors, cpu);
  
        if (action == CPU_ONLINE && pr) {
-               acpi_processor_ppc_has_changed(pr);
+               acpi_processor_ppc_has_changed(pr, 0);
                acpi_processor_cst_has_changed(pr);
                acpi_processor_tstate_has_changed(pr);
        }
@@@ -770,7 -770,7 +770,7 @@@ static struct notifier_block acpi_cpu_n
            .notifier_call = acpi_cpu_soft_notify,
  };
  
 -static int acpi_processor_add(struct acpi_device *device)
 +static int __cpuinit acpi_processor_add(struct acpi_device *device)
  {
        struct acpi_processor *pr = NULL;
        int result = 0;
        arch_acpi_processor_cleanup_pdc(pr);
  
  #ifdef CONFIG_CPU_FREQ
-       acpi_processor_ppc_has_changed(pr);
+       acpi_processor_ppc_has_changed(pr, 0);
  #endif
        acpi_processor_get_throttling_info(pr);
        acpi_processor_get_limit_info(pr);
@@@ -1102,7 -1102,7 +1102,7 @@@ void acpi_processor_install_hotplug_not
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
 -                          processor_walk_namespace_cb, &action, NULL);
 +                          processor_walk_namespace_cb, NULL, &action, NULL);
  #endif
        register_hotcpu_notifier(&acpi_cpu_notifier);
  }
@@@ -1115,7 -1115,7 +1115,7 @@@ void acpi_processor_uninstall_hotplug_n
        acpi_walk_namespace(ACPI_TYPE_PROCESSOR,
                            ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX,
 -                          processor_walk_namespace_cb, &action, NULL);
 +                          processor_walk_namespace_cb, NULL, &action, NULL);
  #endif
        unregister_hotcpu_notifier(&acpi_cpu_notifier);
  }
index 01e366d2b6fb14475e0b6074b886fd8b55877348,fc1f49bbbeef1cc88b804a3b428d8ee69b1220e1..2cabadcc4d8c36806bc886080a6c0cae3d50dd04
@@@ -152,34 -152,65 +152,78 @@@ static int acpi_processor_get_platform_
        return 0;
  }
  
- int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
+ #define ACPI_PROCESSOR_NOTIFY_PERFORMANCE     0x80
+ /*
+  * acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
+  * @handle: ACPI processor handle
+  * @status: the status code of _PPC evaluation
+  *    0: success. OSPM is now using the performance state specificed.
+  *    1: failure. OSPM has not changed the number of P-states in use
+  */
+ static void acpi_processor_ppc_ost(acpi_handle handle, int status)
+ {
+       union acpi_object params[2] = {
+               {.type = ACPI_TYPE_INTEGER,},
+               {.type = ACPI_TYPE_INTEGER,},
+       };
+       struct acpi_object_list arg_list = {2, params};
+       acpi_handle temp;
+       params[0].integer.value = ACPI_PROCESSOR_NOTIFY_PERFORMANCE;
+       params[1].integer.value =  status;
+       /* when there is no _OST , skip it */
+       if (ACPI_FAILURE(acpi_get_handle(handle, "_OST", &temp)))
+               return;
+       acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
+       return;
+ }
+ int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
  {
        int ret;
  
-       if (ignore_ppc)
+       if (ignore_ppc) {
+               /*
+                * Only when it is notification event, the _OST object
+                * will be evaluated. Otherwise it is skipped.
+                */
+               if (event_flag)
+                       acpi_processor_ppc_ost(pr->handle, 1);
                return 0;
+       }
  
        ret = acpi_processor_get_platform_limit(pr);
+       /*
+        * Only when it is notification event, the _OST object
+        * will be evaluated. Otherwise it is skipped.
+        */
+       if (event_flag) {
+               if (ret < 0)
+                       acpi_processor_ppc_ost(pr->handle, 1);
+               else
+                       acpi_processor_ppc_ost(pr->handle, 0);
+       }
        if (ret < 0)
                return (ret);
        else
                return cpufreq_update_policy(pr->id);
  }
  
 +int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
 +{
 +      struct acpi_processor *pr;
 +
 +      pr = per_cpu(processors, cpu);
 +      if (!pr || !pr->performance || !pr->performance->state_count)
 +              return -ENODEV;
 +      *limit = pr->performance->states[pr->performance_platform_limit].
 +              core_frequency * 1000;
 +      return 0;
 +}
 +EXPORT_SYMBOL(acpi_processor_get_bios_limit);
 +
  void acpi_processor_ppc_init(void)
  {
        if (!cpufreq_register_notifier
diff --combined include/acpi/processor.h
index 8b668ead6d6e84a55f7cd9c743524cbeace28e1a,a920237f7c62dd3496effd65483a5bfc7286b604..29245c6b5c0e0f6f1faa8bbe554bdf9c9422e08b
@@@ -294,8 -294,7 +294,8 @@@ static inline void acpi_processor_ffh_c
  #ifdef CONFIG_CPU_FREQ
  void acpi_processor_ppc_init(void);
  void acpi_processor_ppc_exit(void);
- int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
+ int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag);
 +extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit);
  #else
  static inline void acpi_processor_ppc_init(void)
  {
@@@ -305,7 -304,8 +305,8 @@@ static inline void acpi_processor_ppc_e
  {
        return;
  }
- static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
+ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
+                                                               int event_flag)
  {
        static unsigned int printout = 1;
        if (printout) {
        }
        return 0;
  }
 +static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
 +{
 +      return -ENODEV;
 +}
 +
  #endif                                /* CONFIG_CPU_FREQ */
  
  /* in processor_throttling.c */