Hi Daniel,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on pm/linux-next]
[also build test ERROR on linux/master linus/master v5.8-rc4 next-20200707]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Daniel-Lezcano/powercap-drivers-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
> drivers/powercap/powercap_em.c:49:21: warning: no previous
prototype for 'to_powercap_em' [-Wmissing-prototypes]
49 | struct
powercap_em *to_powercap_em(struct powercap_zone *zone)
| ^~~~~~~~~~~~~~
drivers/powercap/powercap_em.c: In function 'powercap_em_set_power_range':
> drivers/powercap/powercap_em.c:131:21: error:
'MICROWATT_PER_MILLIWATT' undeclared (first use in this function)
131 |
pcem->power_min *= MICROWATT_PER_MILLIWATT;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/powercap/powercap_em.c:131:21: note: each undeclared identifier is reported
only once for each function it appears in
> drivers/powercap/powercap_em.c:134:34: error: 'struct
em_perf_domain' has no member named 'nr_cap_states'; did you mean
'nr_perf_states'?
134 | pcem->power_max =
em->table[em->nr_cap_states - 1].power;
| ^~~~~~~~~~~~~
| nr_perf_states
drivers/powercap/powercap_em.c: In function 'get_pd_power_uw':
drivers/powercap/powercap_em.c:171:22: error: 'struct em_perf_domain' has no
member named 'nr_cap_states'; did you mean 'nr_perf_states'?
171 | for (i = 0; i < pd->nr_cap_states; i++) {
| ^~~~~~~~~~~~~
| nr_perf_states
drivers/powercap/powercap_em.c:177:4: error: 'MICROWATT_PER_MILLIWATT'
undeclared (first use in this function)
177 | MICROWATT_PER_MILLIWATT * nr_cpus;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/powercap/powercap_em.c: In function 'set_domain_enable':
drivers/powercap/powercap_em.c:224:23: error: 'struct em_perf_domain' has no
member named 'nr_cap_states'; did you mean 'nr_perf_states'?
224 | pd->table[pd->nr_cap_states - 1].frequency);
| ^~~~~~~~~~~~~
| nr_perf_states
drivers/powercap/powercap_em.c: In function 'set_pd_power_limit':
drivers/powercap/powercap_em.c:342:58: error: 'struct em_perf_domain' has no
member named 'nr_cap_states'; did you mean 'nr_perf_states'?
342 | for (i = 0, frequency = pd->table[0].frequency; i <
pd->nr_cap_states; i++) {
| ^~~~~~~~~~~~~
| nr_perf_states
drivers/powercap/powercap_em.c:344:36: error: 'MICROWATT_PER_MILLIWATT'
undeclared (first use in this function)
344 | u64 power = pd->table[i].power * MICROWATT_PER_MILLIWATT;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/powercap/powercap_em.c: In function 'cpuhp_powercap_em_online':
drivers/powercap/powercap_em.c:456:22: error: 'struct em_perf_domain' has no
member named 'nr_cap_states'; did you mean 'nr_perf_states'?
456 | pd->table[pd->nr_cap_states - 1].frequency);
| ^~~~~~~~~~~~~
| nr_perf_states
vim +/MICROWATT_PER_MILLIWATT +131 drivers/powercap/powercap_em.c
48
49 struct powercap_em *to_powercap_em(struct powercap_zone *zone)
50 {
51 return container_of(zone, struct powercap_em, zone);
52 }
53
54 /*
55 * Browse the powercap nodes of the tree and rebalance their
56 * weigths. This function is called when a node is inserted or
57 * deleted.
58 */
59 static void powercap_em_rebalance_weight(struct powercap_em *pcem)
60 {
61 struct powercap_em *child;
62
63 spin_lock(&pcem->lock);
64 list_for_each_entry(child, &pcem->children, sibling) {
65
66 child->weight = (child->power_max * 1024) / pcem->power_max;
67
68 powercap_em_rebalance_weight(child);
69 }
70 spin_unlock(&pcem->lock);
71 }
72
73 /*
74 * Initialize the energy model powercap zone by calling the underlying
75 * powercap register function followed by the specific allocations.
76 */
77 static struct powercap_em *
78 powercap_em_register(struct powercap_control_type *control_type,
79 const char *name,
80 struct powercap_em *parent,
81 const struct powercap_zone_ops *ops,
82 int nr_constraints,
83 const struct powercap_zone_constraint_ops *const_ops)
84 {
85 struct powercap_em *pcem;
86 struct powercap_zone *pcz;
87
88 pcem = kzalloc(sizeof(*pcem), GFP_KERNEL);
89 if (!pcem)
90 return NULL;
91
92 INIT_LIST_HEAD(&pcem->children);
93 INIT_LIST_HEAD(&pcem->sibling);
94 spin_lock_init(&pcem->lock);
95
96 pcz = powercap_register_zone(&pcem->zone, control_type, name,
97 parent ? &parent->zone : NULL,
98 ops, nr_constraints, const_ops);
99 if (IS_ERR(pcz)) {
100 kfree(pcem);
101 return NULL;
102 }
103
104 /*
105 * The root node does not have a parent
106 */
107 if (parent) {
108 spin_lock(&parent->lock);
109 list_add_tail(&pcem->sibling, &parent->children);
110 spin_unlock(&parent->lock);
111 pcem->parent = parent;
112 }
113
114 return pcem;
115 }
116
117 /*
118 * When a new powercap zone is inserted, propagate its power numbers
119 * to the parents.
120 */
121 static int powercap_em_set_power_range(struct powercap_em *pcem,
122 struct em_perf_domain *em)
123 {
124 struct powercap_em *parent = pcem->parent;
125 int nr_cpus = cpumask_weight(to_cpumask(em->cpus));
126
127 if (pcem->power_min || pcem->power_max)
128 return -EINVAL;
129
130 pcem->power_min = em->table[0].power;
131 pcem->power_min *= MICROWATT_PER_MILLIWATT;
132 pcem->power_min *= nr_cpus;
133
134 pcem->power_max = em->table[em->nr_cap_states -
1].power;
135 pcem->power_max *= MICROWATT_PER_MILLIWATT;
136 pcem->power_max *= nr_cpus;
137
138 while (parent) {
139 spin_lock(&parent->lock);
140 parent->power_min += pcem->power_min;
141 parent->power_max += pcem->power_max;
142 spin_unlock(&parent->lock);
143 parent = parent->parent;
144 }
145
146 return 0;
147 }
148
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org