[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202601220225.eSj782As-lkp@intel.com>
Date: Thu, 22 Jan 2026 03:16:16 +0800
From: kernel test robot <lkp@...el.com>
To: Pankaj Gupta <pankaj.gupta@....com>, Jonathan Corbet <corbet@....net>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
Frank Li <Frank.Li@....com>
Subject: Re: [PATCH v24 5/7] firmware: drivers: imx: adds miscdev
Hi Pankaj,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 6c790212c588fddeb0d852f2790840753bb604b1]
url: https://github.com/intel-lab-lkp/linux/commits/Pankaj-Gupta/Documentation-firmware-add-imx-se-to-other_interfaces/20260121-171044
base: 6c790212c588fddeb0d852f2790840753bb604b1
patch link: https://lore.kernel.org/r/20260121-imx-se-if-v24-5-c5222df51cc2%40nxp.com
patch subject: [PATCH v24 5/7] firmware: drivers: imx: adds miscdev
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20260122/202601220225.eSj782As-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260122/202601220225.eSj782As-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601220225.eSj782As-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/firmware/imx/se_ctrl.c: In function 'se_ioctl_cmd_snd_rcv_rsp_handler':
>> drivers/firmware/imx/se_ctrl.c:504:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
504 | if (copy_from_user(&cmd_snd_rcv_rsp_info, (u8 __user *)arg,
| ^
drivers/firmware/imx/se_ctrl.c:585:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
585 | if (copy_to_user((void __user *)arg, &cmd_snd_rcv_rsp_info,
| ^
drivers/firmware/imx/se_ctrl.c: In function 'se_ioctl_get_mu_info':
drivers/firmware/imx/se_ctrl.c:619:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
619 | if (copy_to_user((u8 __user *)arg, &if_info, sizeof(if_info))) {
| ^
drivers/firmware/imx/se_ctrl.c: In function 'se_ioctl_setup_iobuf_handler':
drivers/firmware/imx/se_ctrl.c:640:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
640 | if (copy_from_user(&io, (u8 __user *)arg, sizeof(io))) {
| ^
drivers/firmware/imx/se_ctrl.c:702:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
702 | if (copy_to_user((u8 __user *)arg, &io, sizeof(io))) {
| ^
drivers/firmware/imx/se_ctrl.c: In function 'se_ioctl_get_se_soc_info_handler':
drivers/firmware/imx/se_ctrl.c:720:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
720 | err = copy_to_user((u8 __user *)arg, (u8 *)(&soc_info), sizeof(soc_info));
| ^
vim +504 drivers/firmware/imx/se_ctrl.c
496
497 static int se_ioctl_cmd_snd_rcv_rsp_handler(struct se_if_device_ctx *dev_ctx,
498 u64 arg)
499 {
500 struct se_ioctl_cmd_snd_rcv_rsp_info cmd_snd_rcv_rsp_info = {0};
501 struct se_if_priv *priv = dev_ctx->priv;
502 int err = 0;
503
> 504 if (copy_from_user(&cmd_snd_rcv_rsp_info, (u8 __user *)arg,
505 sizeof(cmd_snd_rcv_rsp_info))) {
506 dev_err(priv->dev,
507 "%s: Failed to copy cmd_snd_rcv_rsp_info from user.",
508 dev_ctx->devname);
509 err = -EFAULT;
510 goto exit;
511 }
512
513 if (cmd_snd_rcv_rsp_info.tx_buf_sz < SE_MU_HDR_SZ) {
514 dev_err(priv->dev, "%s: User buffer too small(%d < %d)",
515 dev_ctx->devname, cmd_snd_rcv_rsp_info.tx_buf_sz, SE_MU_HDR_SZ);
516 err = -ENOSPC;
517 goto exit;
518 }
519
520 err = se_chk_tx_msg_hdr(priv, (struct se_msg_hdr *)cmd_snd_rcv_rsp_info.tx_buf);
521 if (err)
522 goto exit;
523
524 struct se_api_msg *rx_msg __free(kfree) =
525 kzalloc(cmd_snd_rcv_rsp_info.rx_buf_sz, GFP_KERNEL);
526 if (!rx_msg) {
527 err = -ENOMEM;
528 goto exit;
529 }
530
531 struct se_api_msg *tx_msg __free(kfree) =
532 memdup_user(cmd_snd_rcv_rsp_info.tx_buf,
533 cmd_snd_rcv_rsp_info.tx_buf_sz);
534 if (IS_ERR(tx_msg)) {
535 err = PTR_ERR(tx_msg);
536 goto exit;
537 }
538
539 if (tx_msg->header.tag != priv->if_defs->cmd_tag) {
540 err = -EINVAL;
541 goto exit;
542 }
543
544 if (tx_msg->header.ver == priv->if_defs->fw_api_ver &&
545 get_load_fw_instance(priv)->is_fw_tobe_loaded) {
546 err = se_load_firmware(priv);
547 if (err) {
548 dev_err(priv->dev, "Could not send msg as FW is not loaded.");
549 err = -EPERM;
550 goto exit;
551 }
552 }
553 set_se_rcv_msg_timeout(priv, SE_RCV_MSG_LONG_TIMEOUT);
554
555 err = ele_msg_send_rcv(dev_ctx, tx_msg, cmd_snd_rcv_rsp_info.tx_buf_sz,
556 rx_msg, cmd_snd_rcv_rsp_info.rx_buf_sz);
557 if (err < 0)
558 goto exit;
559
560 dev_dbg(priv->dev, "%s: %s %s.", dev_ctx->devname, __func__,
561 "message received, start transmit to user");
562
563 /* We may need to copy the output data to user before
564 * delivering the completion message.
565 */
566 err = se_dev_ctx_cpy_out_data(dev_ctx);
567 if (err < 0)
568 goto exit;
569
570 /* Copy data from the buffer */
571 print_hex_dump_debug("to user ", DUMP_PREFIX_OFFSET, 4, 4, rx_msg,
572 cmd_snd_rcv_rsp_info.rx_buf_sz, false);
573
574 if (copy_to_user(cmd_snd_rcv_rsp_info.rx_buf, rx_msg,
575 cmd_snd_rcv_rsp_info.rx_buf_sz)) {
576 dev_err(priv->dev, "%s: Failed to copy to user.", dev_ctx->devname);
577 err = -EFAULT;
578 }
579
580 exit:
581
582 /* shared memory is allocated before this IOCTL */
583 se_dev_ctx_shared_mem_cleanup(dev_ctx);
584
585 if (copy_to_user((void __user *)arg, &cmd_snd_rcv_rsp_info,
586 sizeof(cmd_snd_rcv_rsp_info))) {
587 dev_err(priv->dev, "%s: Failed to copy cmd_snd_rcv_rsp_info from user.",
588 dev_ctx->devname);
589 err = -EFAULT;
590 }
591
592 return err;
593 }
594
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists