Re: [PATCH v2 1/2] x86: Add basic support for the Congatec CGEB BIOS interface

kernel test robot
2024-08-03T21:47:08Z

Hi Mary,

kernel test robot noticed the following build errors:

[auto build test ERROR on lee-mfd/for-mfd-next]
[also build test ERROR on lee-mfd/for-mfd-fixes andi-shyti/i2c/i2c-host akpm-mm/mm-everything linus/master v6.11-rc1 next-20240802]
[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/Mary-Strodl/x86-Add-basic-support-for-the-Congatec-CGEB-BIOS-interface/20240803-013725
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
patch link: https://lore.kernel.org/r/20240801160610.101859-2-mstrodl%40csh.rit.edu
patch subject: [PATCH v2 1/2] x86: Add basic support for the Congatec CGEB BIOS interface
config: x86_64-randconfig-002-20240804 (https://download.01.org/0day-ci/archive/20240804/202408040528.OmB08hFQ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240804/202408040528.OmB08hFQ-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/202408040528.OmB08hFQ-lkp@intel.com/

All errors (new ones prefixed by >>):

ld: drivers/mfd/congatec-cgeb.o: in function `cgeb_request':
>> drivers/mfd/congatec-cgeb.c:303: undefined reference to `cn_netlink_send'
>> ld: drivers/mfd/congatec-cgeb.c:312: undefined reference to `cn_netlink_send'
ld: drivers/mfd/congatec-cgeb.o: in function `cgeb_exit':
>> drivers/mfd/congatec-cgeb.c:1131: undefined reference to `cn_del_callback'
ld: drivers/mfd/congatec-cgeb.o: in function `cgeb_init':
>> drivers/mfd/congatec-cgeb.c:1054: undefined reference to `cn_add_callback'
>> ld: drivers/mfd/congatec-cgeb.c:1113: undefined reference to `cn_del_callback'

vim +303 drivers/mfd/congatec-cgeb.c

266
267 static int cgeb_request(struct cgeb_msg msg, struct cgeb_msg *out,
268 int (*callback)(struct cgeb_msg*, void*), void *user)
269 {
270 static int seq;
271 struct cn_msg *wrapper;
272 struct cgeb_request *req;
273 int err, retries = 0;
274
275 wrapper = (struct cn_msg*) kzalloc(sizeof(*wrapper) + sizeof(msg),
276 GFP_KERNEL);
277 if (!wrapper)
278 return -ENOMEM;
279
280 memset(wrapper, 0, sizeof(*wrapper));
281 memcpy(&wrapper->id, &cgeb_cn_id, sizeof(cgeb_cn_id));
282
283 wrapper->len = sizeof(msg);
284 wrapper->ack = get_random_u32();
285 memcpy(wrapper + 1, &msg, sizeof(msg));
286
287 mutex_lock(&cgeb_lock);
288
289 req = &cgeb_requests[seq];
290
291 if (req->busy) {
292 mutex_unlock(&cgeb_lock);
293 err = -EBUSY;
294 goto out;
295 }
296 wrapper->seq = seq;
297 req->busy = CGEB_REQ_ACTIVE;
298 req->ack = wrapper->ack;
299 req->out = out;
300 req->callback = callback;
301 req->user = user;
302
> 303 err = cn_netlink_send(wrapper, 0, 0, GFP_KERNEL);
304 if (err == -ESRCH) {
305 err = cgeb_helper_start();
306 if (err) {
307 pr_err("failed to execute %s\n", cgeb_helper_path);
308 pr_err("make sure that the cgeb helper is installed and"
309 " executable\n");
310 } else {
311 do {
> 312 err = cn_netlink_send(wrapper, 0, 0,
313 GFP_KERNEL);
314 if (err == -ENOBUFS)
315 err = 0;
316 if (err == -ESRCH)
317 msleep(30);
318 } while (err == -ESRCH && ++retries < 5);
319 }
320 } else if (err == -ENOBUFS)
321 err = 0;
322
323 kfree(wrapper);
324
325 if (++seq >= CGEB_REQUEST_MAX)
326 seq = 0;
327
328 mutex_unlock(&cgeb_lock);
329
330 if (err)
331 goto out;
332
333 /* Wait for a response to the request */
334 err = wait_for_completion_interruptible_timeout(
335 &req->done, msecs_to_jiffies(20000));
336 if (err == 0) {
337 pr_err("CGEB: Timed out running request of type %d!\n",
338 msg.type);
339 err = -ETIMEDOUT;
340 } else if (err > 0)
341 err = 0;
342
343 if (err)
344 goto out;
345
346 mutex_lock(&cgeb_lock);
347
348 if (req->busy != CGEB_REQ_DONE) {
349 pr_err("CGEB: BUG: Request is in a bad state?\n");
350 err = -EINVAL;
351 }
352
353 req->busy = CGEB_REQ_IDLE;
354 mutex_unlock(&cgeb_lock);
355 out:
356 return err;
357 }
358

--
0-DAY CI Kernel Test Service