linux-arm-kernel.lists.infradead.org archive mirror
 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 v20 5/7] firmware: drivers: imx: adds miscdev
Date: Thu, 4 Dec 2025 12:28:05 +0800	[thread overview]
Message-ID: <202512041241.yDXC2vpg-lkp@intel.com> (raw)
In-Reply-To: <20251203-imx-se-if-v20-5-a04a25c4255f@nxp.com>

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


  reply	other threads:[~2025-12-04  4:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  6:48 [PATCH v20 0/7] firmware: imx: driver for NXP secure-enclave Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 1/7] Documentation/firmware: add imx/se to other_interfaces Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 2/7] dt-bindings: arm: fsl: add imx-se-fw binding doc Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 3/7] firmware: imx: add driver for NXP EdgeLock Enclave Pankaj Gupta
2025-12-03  7:20   ` Krzysztof Kozlowski
2025-12-03 16:59     ` Frank Li
2025-12-03 17:42       ` Krzysztof Kozlowski
2025-12-12  9:07         ` [EXT] " Pankaj Gupta
2025-12-03 18:02   ` Randy Dunlap
2025-12-12  9:05     ` [EXT] " Pankaj Gupta
2025-12-09  8:08   ` Dan Carpenter
2025-12-12  9:04     ` [EXT] " Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 4/7] firmware: imx: device context dedicated to priv Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 5/7] firmware: drivers: imx: adds miscdev Pankaj Gupta
2025-12-04  4:28   ` kernel test robot [this message]
2025-12-03  6:48 ` [PATCH v20 6/7] arm64: dts: imx8ulp: add secure enclave node Pankaj Gupta
2025-12-03  6:48 ` [PATCH v20 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=202512041241.yDXC2vpg-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;
as well as URLs for NNTP newsgroup(s).