public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Pankaj Gupta <pankaj.gupta@nxp.com>,
	Jonathan Corbet <corbet@lwn.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH v24 5/7] firmware: drivers: imx: adds miscdev
Date: Thu, 22 Jan 2026 03:16:16 +0800	[thread overview]
Message-ID: <202601220225.eSj782As-lkp@intel.com> (raw)
In-Reply-To: <20260121-imx-se-if-v24-5-c5222df51cc2@nxp.com>

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@intel.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


  reply	other threads:[~2026-01-21 19:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  8:55 [PATCH v24 0/7] firmware: imx: driver for NXP secure-enclave Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 1/7] Documentation/firmware: add imx/se to other_interfaces Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 3/7] firmware: imx: add driver for NXP EdgeLock Enclave Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 4/7] firmware: imx: device context dedicated to priv Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 5/7] firmware: drivers: imx: adds miscdev Pankaj Gupta
2026-01-21 19:16   ` kernel test robot [this message]
2026-01-21  8:55 ` [PATCH v24 6/7] arm64: dts: imx8ulp: add secure enclave node Pankaj Gupta
2026-01-21  8:55 ` [PATCH v24 7/7] arm64: dts: imx8ulp-evk: add reserved memory property Pankaj Gupta

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=202601220225.eSj782As-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pankaj.gupta@nxp.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox