[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202512041241.yDXC2vpg-lkp@intel.com>
Date: Thu, 4 Dec 2025 12:28:05 +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 v20 5/7] firmware: drivers: imx: adds miscdev
Hi Pankaj,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 4a26e7032d7d57c998598c08a034872d6f0d3945]
url: https://github.com/intel-lab-lkp/linux/commits/Pankaj-Gupta/Documentation-firmware-add-imx-se-to-other_interfaces/20251203-145202
base: 4a26e7032d7d57c998598c08a034872d6f0d3945
patch link: https://lore.kernel.org/r/20251203-imx-se-if-v20-5-a04a25c4255f%40nxp.com
patch subject: [PATCH v20 5/7] firmware: drivers: imx: adds miscdev
config: arm64-randconfig-r132-20251204 (https://download.01.org/0day-ci/archive/20251204/202512041241.yDXC2vpg-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 734a912d0f025559fcf76bde9aaaeb0383c1625a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251204/202512041241.yDXC2vpg-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/202512041241.yDXC2vpg-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/imx/se_ctrl.c:517:40: sparse: sparse: cast removes address space '__user' of expression
drivers/firmware/imx/se_ctrl.c:745:48: sparse: sparse: cast removes address space '__user' of expression
vim +/__user +517 drivers/firmware/imx/se_ctrl.c
491
492 static int se_ioctl_cmd_snd_rcv_rsp_handler(struct se_if_device_ctx *dev_ctx,
493 u64 arg)
494 {
495 struct se_ioctl_cmd_snd_rcv_rsp_info cmd_snd_rcv_rsp_info = {0};
496 struct se_api_msg *tx_msg __free(kfree) = NULL;
497 struct se_api_msg *rx_msg __free(kfree) = NULL;
498 struct se_if_priv *priv = dev_ctx->priv;
499 int err = 0;
500
501 if (copy_from_user(&cmd_snd_rcv_rsp_info, (u8 __user *)arg,
502 sizeof(cmd_snd_rcv_rsp_info))) {
503 dev_err(priv->dev,
504 "%s: Failed to copy cmd_snd_rcv_rsp_info from user.",
505 dev_ctx->devname);
506 err = -EFAULT;
507 goto exit;
508 }
509
510 if (cmd_snd_rcv_rsp_info.tx_buf_sz < SE_MU_HDR_SZ) {
511 dev_err(priv->dev, "%s: User buffer too small(%d < %d)",
512 dev_ctx->devname, cmd_snd_rcv_rsp_info.tx_buf_sz, SE_MU_HDR_SZ);
513 err = -ENOSPC;
514 goto exit;
515 }
516
> 517 err = se_chk_tx_msg_hdr(priv, (struct se_msg_hdr *)cmd_snd_rcv_rsp_info.tx_buf);
518 if (err)
519 goto exit;
520
521 rx_msg = kzalloc(cmd_snd_rcv_rsp_info.rx_buf_sz, GFP_KERNEL);
522 if (!rx_msg) {
523 err = -ENOMEM;
524 goto exit;
525 }
526
527 tx_msg = memdup_user(cmd_snd_rcv_rsp_info.tx_buf,
528 cmd_snd_rcv_rsp_info.tx_buf_sz);
529 if (IS_ERR(tx_msg)) {
530 err = PTR_ERR(tx_msg);
531 goto exit;
532 }
533
534 if (tx_msg->header.tag != priv->if_defs->cmd_tag) {
535 err = -EINVAL;
536 goto exit;
537 }
538
539 if (tx_msg->header.ver == priv->if_defs->fw_api_ver &&
540 get_load_fw_instance(priv)->is_fw_tobe_loaded) {
541 err = se_load_firmware(priv);
542 if (err) {
543 dev_err(priv->dev, "Could not send msg as FW is not loaded.");
544 err = -EPERM;
545 goto exit;
546 }
547 }
548 set_se_rcv_msg_timeout(priv, SE_RCV_MSG_LONG_TIMEOUT);
549
550 err = ele_msg_send_rcv(dev_ctx, tx_msg, cmd_snd_rcv_rsp_info.tx_buf_sz,
551 rx_msg, cmd_snd_rcv_rsp_info.rx_buf_sz);
552 if (err < 0)
553 goto exit;
554
555 dev_dbg(priv->dev, "%s: %s %s.", dev_ctx->devname, __func__,
556 "message received, start transmit to user");
557
558 /* We may need to copy the output data to user before
559 * delivering the completion message.
560 */
561 err = se_dev_ctx_cpy_out_data(dev_ctx);
562 if (err < 0)
563 goto exit;
564
565 /* Copy data from the buffer */
566 print_hex_dump_debug("to user ", DUMP_PREFIX_OFFSET, 4, 4, rx_msg,
567 cmd_snd_rcv_rsp_info.rx_buf_sz, false);
568
569 if (copy_to_user(cmd_snd_rcv_rsp_info.rx_buf, rx_msg,
570 cmd_snd_rcv_rsp_info.rx_buf_sz)) {
571 dev_err(priv->dev, "%s: Failed to copy to user.", dev_ctx->devname);
572 err = -EFAULT;
573 }
574
575 exit:
576
577 /* shared memory is allocated before this IOCTL */
578 se_dev_ctx_shared_mem_cleanup(dev_ctx);
579
580 if (copy_to_user((void __user *)arg, &cmd_snd_rcv_rsp_info,
581 sizeof(cmd_snd_rcv_rsp_info))) {
582 dev_err(priv->dev, "%s: Failed to copy cmd_snd_rcv_rsp_info from user.",
583 dev_ctx->devname);
584 err = -EFAULT;
585 }
586
587 return err;
588 }
589
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists