Commit 4f2f2777 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'pm-domains', 'powercap' and 'pm-tools'

* pm-domains:
  PM / Domains: Export of_genpd_get_from_provider function

* powercap:
  powercap / RAPL: add IDs for future Xeon CPUs

* pm-tools:
  tools / cpupower: Fix no idle state information return value
  tools / cpupower: Correctly detect if running as root
...@@ -2088,7 +2088,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider); ...@@ -2088,7 +2088,7 @@ EXPORT_SYMBOL_GPL(of_genpd_del_provider);
* Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR() * Returns a valid pointer to struct generic_pm_domain on success or ERR_PTR()
* on failure. * on failure.
*/ */
static struct generic_pm_domain *of_genpd_get_from_provider( struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec) struct of_phandle_args *genpdspec)
{ {
struct generic_pm_domain *genpd = ERR_PTR(-ENOENT); struct generic_pm_domain *genpd = ERR_PTR(-ENOENT);
...@@ -2108,6 +2108,7 @@ static struct generic_pm_domain *of_genpd_get_from_provider( ...@@ -2108,6 +2108,7 @@ static struct generic_pm_domain *of_genpd_get_from_provider(
return genpd; return genpd;
} }
EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);
/** /**
* genpd_dev_pm_detach - Detach a device from its PM domain. * genpd_dev_pm_detach - Detach a device from its PM domain.
......
...@@ -1041,6 +1041,7 @@ static const struct x86_cpu_id rapl_ids[] = { ...@@ -1041,6 +1041,7 @@ static const struct x86_cpu_id rapl_ids[] = {
RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */ RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */
RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */ RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */
RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */ RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */
RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
RAPL_CPU(0x5A, rapl_defaults_atom),/* Annidale */ RAPL_CPU(0x5A, rapl_defaults_atom),/* Annidale */
{} {}
}; };
......
...@@ -271,6 +271,8 @@ typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args, ...@@ -271,6 +271,8 @@ typedef struct generic_pm_domain *(*genpd_xlate_t)(struct of_phandle_args *args,
int __of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate, int __of_genpd_add_provider(struct device_node *np, genpd_xlate_t xlate,
void *data); void *data);
void of_genpd_del_provider(struct device_node *np); void of_genpd_del_provider(struct device_node *np);
struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec);
struct generic_pm_domain *__of_genpd_xlate_simple( struct generic_pm_domain *__of_genpd_xlate_simple(
struct of_phandle_args *genpdspec, struct of_phandle_args *genpdspec,
...@@ -288,6 +290,12 @@ static inline int __of_genpd_add_provider(struct device_node *np, ...@@ -288,6 +290,12 @@ static inline int __of_genpd_add_provider(struct device_node *np,
} }
static inline void of_genpd_del_provider(struct device_node *np) {} static inline void of_genpd_del_provider(struct device_node *np) {}
static inline struct generic_pm_domain *of_genpd_get_from_provider(
struct of_phandle_args *genpdspec)
{
return NULL;
}
#define __of_genpd_xlate_simple NULL #define __of_genpd_xlate_simple NULL
#define __of_genpd_xlate_onecell NULL #define __of_genpd_xlate_onecell NULL
......
...@@ -199,7 +199,7 @@ int main(int argc, const char *argv[]) ...@@ -199,7 +199,7 @@ int main(int argc, const char *argv[])
} }
get_cpu_info(0, &cpupower_cpu_info); get_cpu_info(0, &cpupower_cpu_info);
run_as_root = !getuid(); run_as_root = !geteuid();
if (run_as_root) { if (run_as_root) {
ret = uname(&uts); ret = uname(&uts);
if (!ret && !strcmp(uts.machine, "x86_64") && if (!ret && !strcmp(uts.machine, "x86_64") &&
......
...@@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu) ...@@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu)
snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle");
if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
return -ENODEV; return 0;
snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu);
if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment