From: kernel test robot <lkp@intel.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v3 3/6] thermal/netlink: Add the commands and the events for the thresholds
Date: Sat, 7 Sep 2024 11:19:53 +0800 [thread overview]
Message-ID: <202409071156.H2PINAke-lkp@intel.com> (raw)
In-Reply-To: <20240906073631.1655552-4-daniel.lezcano@linaro.org>
Hi Daniel,
kernel test robot noticed the following build errors:
[auto build test ERROR on rafael-pm/thermal]
[also build test ERROR on next-20240906]
[cannot apply to linus/master v6.11-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Lezcano/thermal-core-Add-user-thresholds-support/20240906-153941
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
patch link: https://lore.kernel.org/r/20240906073631.1655552-4-daniel.lezcano%40linaro.org
patch subject: [PATCH v3 3/6] thermal/netlink: Add the commands and the events for the thresholds
config: i386-buildonly-randconfig-004-20240907 (https://download.01.org/0day-ci/archive/20240907/202409071156.H2PINAke-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240907/202409071156.H2PINAke-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409071156.H2PINAke-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/thermal/thermal_thresholds.c:35:2: error: call to undeclared function 'thermal_notify_threshold_flush'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
35 | thermal_notify_threshold_flush(tz, pid);
| ^
drivers/thermal/thermal_thresholds.c:35:2: note: did you mean 'thermal_thresholds_flush'?
drivers/thermal/thermal_thresholds.c:23:6: note: 'thermal_thresholds_flush' declared here
23 | void thermal_thresholds_flush(struct thermal_zone_device *tz, pid_t pid)
| ^
24 | {
25 | struct list_head *thresholds = &tz->user_thresholds;
26 | struct user_threshold *entry, *tmp;
27 |
28 | lockdep_assert_held(&tz->lock);
29 |
30 | list_for_each_entry_safe(entry, tmp, thresholds, list_node) {
31 | list_del(&entry->list_node);
32 | kfree(entry);
33 | }
34 |
35 | thermal_notify_threshold_flush(tz, pid);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| thermal_thresholds_flush
>> drivers/thermal/thermal_thresholds.c:151:4: error: call to undeclared function 'thermal_notify_threshold_up'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
151 | thermal_notify_threshold_up(tz);
| ^
drivers/thermal/thermal_thresholds.c:151:4: note: did you mean 'thermal_notify_tz_trip_up'?
drivers/thermal/thermal_netlink.h:105:19: note: 'thermal_notify_tz_trip_up' declared here
105 | static inline int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
| ^
>> drivers/thermal/thermal_thresholds.c:155:4: error: call to undeclared function 'thermal_notify_threshold_down'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
155 | thermal_notify_threshold_down(tz);
| ^
drivers/thermal/thermal_thresholds.c:155:4: note: did you mean 'thermal_notify_tz_trip_down'?
drivers/thermal/thermal_netlink.h:99:19: note: 'thermal_notify_tz_trip_down' declared here
99 | static inline int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
| ^
>> drivers/thermal/thermal_thresholds.c:186:2: error: call to undeclared function 'thermal_notify_threshold_add'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
186 | thermal_notify_threshold_add(tz, temperature, direction, pid);
| ^
>> drivers/thermal/thermal_thresholds.c:212:2: error: call to undeclared function 'thermal_notify_threshold_delete'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
212 | thermal_notify_threshold_delete(tz, temperature, direction, pid);
| ^
5 errors generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FB_IOMEM_HELPERS
Depends on [n]: HAS_IOMEM [=y] && FB_CORE [=n]
Selected by [m]:
- DRM_XE_DISPLAY [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_XE [=m] && DRM_XE [=m]=m [=m]
vim +/thermal_notify_threshold_flush +35 drivers/thermal/thermal_thresholds.c
22
23 void thermal_thresholds_flush(struct thermal_zone_device *tz, pid_t pid)
24 {
25 struct list_head *thresholds = &tz->user_thresholds;
26 struct user_threshold *entry, *tmp;
27
28 lockdep_assert_held(&tz->lock);
29
30 list_for_each_entry_safe(entry, tmp, thresholds, list_node) {
31 list_del(&entry->list_node);
32 kfree(entry);
33 }
34
> 35 thermal_notify_threshold_flush(tz, pid);
36
37 __thermal_zone_device_update(tz, THERMAL_TZ_FLUSH_THRESHOLDS);
38 }
39
40 void thermal_thresholds_exit(struct thermal_zone_device *tz)
41 {
42 thermal_thresholds_flush(tz, 0);
43 }
44
45 static int __thermal_thresholds_cmp(void *data,
46 const struct list_head *l1,
47 const struct list_head *l2)
48 {
49 struct user_threshold *t1 = container_of(l1, struct user_threshold, list_node);
50 struct user_threshold *t2 = container_of(l2, struct user_threshold, list_node);
51
52 return t1->temperature - t2->temperature;
53 }
54
55 static struct user_threshold *__thermal_thresholds_find(const struct list_head *thresholds,
56 int temperature)
57 {
58 struct user_threshold *t;
59
60 list_for_each_entry(t, thresholds, list_node)
61 if (t->temperature == temperature)
62 return t;
63
64 return NULL;
65 }
66
67 static bool __thermal_threshold_is_crossed(struct user_threshold *threshold, int temperature,
68 int last_temperature, int direction,
69 int *low, int *high)
70 {
71
72 if (temperature >= threshold->temperature) {
73 if (threshold->temperature > *low &&
74 THERMAL_THRESHOLD_WAY_DOWN & threshold->direction)
75 *low = threshold->temperature;
76
77 if (last_temperature < threshold->temperature &&
78 threshold->direction & direction)
79 return true;
80 } else {
81 if (threshold->temperature < *high && THERMAL_THRESHOLD_WAY_UP
82 & threshold->direction)
83 *high = threshold->temperature;
84
85 if (last_temperature >= threshold->temperature &&
86 threshold->direction & direction)
87 return true;
88 }
89
90 return false;
91 }
92
93 static bool thermal_thresholds_handle_raising(struct list_head *thresholds, int temperature,
94 int last_temperature, int *low, int *high)
95 {
96 struct user_threshold *t;
97
98 list_for_each_entry(t, thresholds, list_node) {
99 if (__thermal_threshold_is_crossed(t, temperature, last_temperature,
100 THERMAL_THRESHOLD_WAY_UP, low, high))
101 return true;
102 }
103
104 return false;
105 }
106
107 static bool thermal_thresholds_handle_dropping(struct list_head *thresholds, int temperature,
108 int last_temperature, int *low, int *high)
109 {
110 struct user_threshold *t;
111
112 list_for_each_entry_reverse(t, thresholds, list_node) {
113 if (__thermal_threshold_is_crossed(t, temperature, last_temperature,
114 THERMAL_THRESHOLD_WAY_DOWN, low, high))
115 return true;
116 }
117
118 return false;
119 }
120
121 void thermal_thresholds_handle(struct thermal_zone_device *tz, int *low, int *high)
122 {
123 struct list_head *thresholds = &tz->user_thresholds;
124
125 int temperature = tz->temperature;
126 int last_temperature = tz->last_temperature;
127
128 lockdep_assert_held(&tz->lock);
129
130 /*
131 * We need a second update in order to detect a threshold being crossed
132 */
133 if (last_temperature == THERMAL_TEMP_INVALID)
134 return;
135
136 /*
137 * The temperature is stable, so obviously we can not have
138 * crossed a threshold.
139 */
140 if (last_temperature == temperature)
141 return;
142
143 /*
144 * Since last update the temperature:
145 * - increased : thresholds are crossed the way up
146 * - decreased : thresholds are crossed the way down
147 */
148 if (temperature > last_temperature) {
149 if (thermal_thresholds_handle_raising(thresholds, temperature,
150 last_temperature, low, high))
> 151 thermal_notify_threshold_up(tz);
152 } else {
153 if (thermal_thresholds_handle_dropping(thresholds, temperature,
154 last_temperature, low, high))
> 155 thermal_notify_threshold_down(tz);
156 }
157 }
158
159 int thermal_thresholds_add(struct thermal_zone_device *tz,
160 int temperature, int direction, pid_t pid)
161 {
162 struct list_head *thresholds = &tz->user_thresholds;
163 struct user_threshold *t;
164
165 lockdep_assert_held(&tz->lock);
166
167 t = __thermal_thresholds_find(thresholds, temperature);
168 if (t) {
169 if (t->direction == direction)
170 return -EEXIST;
171
172 t->direction |= direction;
173 } else {
174
175 t = kmalloc(sizeof(*t), GFP_KERNEL);
176 if (!t)
177 return -ENOMEM;
178
179 INIT_LIST_HEAD(&t->list_node);
180 t->temperature = temperature;
181 t->direction = direction;
182 list_add(&t->list_node, thresholds);
183 list_sort(NULL, thresholds, __thermal_thresholds_cmp);
184 }
185
> 186 thermal_notify_threshold_add(tz, temperature, direction, pid);
187
188 __thermal_zone_device_update(tz, THERMAL_TZ_ADD_THRESHOLD);
189
190 return 0;
191 }
192
193 int thermal_thresholds_delete(struct thermal_zone_device *tz,
194 int temperature, int direction, pid_t pid)
195 {
196 struct list_head *thresholds = &tz->user_thresholds;
197 struct user_threshold *t;
198
199 lockdep_assert_held(&tz->lock);
200
201 t = __thermal_thresholds_find(thresholds, temperature);
202 if (!t)
203 return -ENOENT;
204
205 if (t->direction == direction) {
206 list_del(&t->list_node);
207 kfree(t);
208 } else {
209 t->direction &= ~direction;
210 }
211
> 212 thermal_notify_threshold_delete(tz, temperature, direction, pid);
213
214 __thermal_zone_device_update(tz, THERMAL_TZ_DEL_THRESHOLD);
215
216 return 0;
217 }
218
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-09-07 3:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 7:36 [PATCH v3 0/6] Add thermal user thresholds support Daniel Lezcano
2024-09-06 7:36 ` [PATCH v3 1/6] thermal/core: Add " Daniel Lezcano
2024-09-06 7:36 ` [PATCH v3 2/6] thermal/core: Connect the threshold with the core Daniel Lezcano
2024-09-06 7:36 ` [PATCH v3 3/6] thermal/netlink: Add the commands and the events for the thresholds Daniel Lezcano
2024-09-07 3:19 ` kernel test robot [this message]
2024-09-07 5:03 ` kernel test robot
2024-09-06 7:36 ` [PATCH v3 4/6] tools/lib/thermal: Make more generic the command encoding function Daniel Lezcano
2024-09-06 7:36 ` [PATCH v3 5/6] tools/lib/thermal: Add the threshold netlink ABI Daniel Lezcano
2024-09-06 7:36 ` [PATCH v3 6/6] tools/thermal/thermal-engine: Take into account the thresholds API Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202409071156.H2PINAke-lkp@intel.com \
--to=lkp@intel.com \
--cc=daniel.lezcano@linaro.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.