Skip to content

Commit

Permalink
Merge branches 'pm-domains', 'powercap' and 'pm-tools'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rafaeljw committed Dec 29, 2014
4 parents ff23ab2 + 7496fcb + d72be77 + a59e510 commit 4f2f277
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
* 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 generic_pm_domain *genpd = ERR_PTR(-ENOENT);
Expand All @@ -2108,6 +2108,7 @@ static struct generic_pm_domain *of_genpd_get_from_provider(

return genpd;
}
EXPORT_SYMBOL_GPL(of_genpd_get_from_provider);

/**
* genpd_dev_pm_detach - Detach a device from its PM domain.
Expand Down
1 change: 1 addition & 0 deletions drivers/powercap/intel_rapl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ static const struct x86_cpu_id rapl_ids[] = {
RAPL_CPU(0x45, rapl_defaults_core),/* Haswell ULT */
RAPL_CPU(0x4C, rapl_defaults_atom),/* Braswell */
RAPL_CPU(0x4A, rapl_defaults_atom),/* Tangier */
RAPL_CPU(0x56, rapl_defaults_core),/* Future Xeon */
RAPL_CPU(0x5A, rapl_defaults_atom),/* Annidale */
{}
};
Expand Down
8 changes: 8 additions & 0 deletions include/linux/pm_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
void *data);
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 of_phandle_args *genpdspec,
Expand All @@ -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 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_onecell NULL

Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/utils/cpupower.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int main(int argc, const char *argv[])
}

get_cpu_info(0, &cpupower_cpu_info);
run_as_root = !getuid();
run_as_root = !geteuid();
if (run_as_root) {
ret = uname(&uts);
if (!ret && !strcmp(uts.machine, "x86_64") &&
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/utils/helpers/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ unsigned int sysfs_get_idlestate_count(unsigned int cpu)

snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle");
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);
if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
Expand Down

0 comments on commit 4f2f277

Please sign in to comment.