All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [robh:imx93-ethos-v2 5/24] drivers/accel/ethos/ethos_gem.c:175:44: error: use of undeclared identifier 'srclen'
Date: Tue, 1 Jul 2025 23:02:26 +0800	[thread overview]
Message-ID: <202507012232.PNa1KAOw-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git imx93-ethos-v2
head:   e2533aabd58e39b5a86438a8884e75b665fd885c
commit: b4e21041a4d0a52c49e6bfd738499e9113ec725a [5/24] drm: ethos: Rework cmdstream DMA validation
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20250701/202507012232.PNa1KAOw-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250701/202507012232.PNa1KAOw-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/202507012232.PNa1KAOw-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/accel/ethos/ethos_gem.c:170:4: error: expected expression
     170 |                         u64 srclen = dma_length(info, st.dma.mode, st.dma.size0, st.dma.size1, &st.dma.src);
         |                         ^
>> drivers/accel/ethos/ethos_gem.c:175:44: error: use of undeclared identifier 'srclen'
     175 |                                  st.dma.src.region, st.dma.src.offset, srclen,
         |                                                                        ^
   2 errors generated.


vim +/srclen +175 drivers/accel/ethos/ethos_gem.c

   150	
   151	static int ethos_gem_cmdstream_validate(struct drm_device *ddev,
   152						struct ethos_gem_object *bo, u32 size)
   153	{
   154		struct ethos_validated_cmdstream_info *info;
   155		u32 *cmds = bo->base.vaddr;
   156		struct cmd_state st = {};
   157		int i;
   158	
   159		info = kzalloc(sizeof(*info), GFP_KERNEL);
   160		if (!info)
   161			return -ENOMEM;
   162		info->cmd_size = size;
   163	
   164		for (i = 0; i < size/4; i++, cmds++) {
   165			u16 cmd = *cmds;
   166			u16 param = *cmds >> 16;
   167	
   168			switch(cmd) {
   169			case 0x10: // NPU_OP_DMA_START
 > 170				u64 srclen = dma_length(info, st.dma.mode, st.dma.size0, st.dma.size1, &st.dma.src);
   171				u64 dstlen = dma_length(info, st.dma.mode, st.dma.size0, st.dma.size1, &st.dma.dst);
   172				if (st.dma.dst.region >= 0)
   173					info->output_region[st.dma.dst.region] = true;
   174				dev_info(ddev->dev, "cmdstream: DMA SRC:%d:%llx+%llx DST:%d:%llx+%llx\n",
 > 175					 st.dma.src.region, st.dma.src.offset, srclen,
   176					 st.dma.dst.region, st.dma.dst.offset, dstlen);
   177				break;
   178			case 0x130: // NPU_SET_DMA0_SRC_REGION
   179				if (param & 0x100)
   180					st.dma.src.region = -1;
   181				else
   182					st.dma.src.region = param & 0x7;
   183				st.dma.mode = (param >> 9) & 0x3;
   184				break;
   185			case 0x131: // NPU_SET_DMA0_DST_REGION
   186				if (param & 0x100)
   187					st.dma.dst.region = -1;
   188				else
   189					st.dma.dst.region = param & 0x7;
   190				break;
   191			case 0x132: // NPU_SET_DMA0_SIZE0
   192				st.dma.size0 = param;
   193				break;
   194			case 0x133: // NPU_SET_DMA0_SIZE1
   195				st.dma.size1 = param;
   196				break;
   197			case 0x4033: // NPU_SET_DMA0_SRC_STRIDE0
   198				st.dma.src.stride[0] = (s64)cmd_to_addr(cmds);
   199				break;
   200			case 0x4034: // NPU_SET_DMA0_SRC_STRIDE1
   201				st.dma.src.stride[1] = (s64)cmd_to_addr(cmds);
   202				break;
   203			case 0x4035: // NPU_SET_DMA0_DST_STRIDE0
   204				st.dma.dst.stride[0] = (s64)cmd_to_addr(cmds);
   205				break;
   206			case 0x4036: // NPU_SET_DMA0_DST_STRIDE1
   207				st.dma.dst.stride[1] = (s64)cmd_to_addr(cmds);
   208				break;
   209			case 0x4030: // NPU_SET_DMA0_SRC
   210				st.dma.src.offset = cmd_to_addr(cmds);
   211				break;
   212			case 0x4031: // NPU_SET_DMA0_DST
   213				st.dma.dst.offset = cmd_to_addr(cmds);
   214				break;
   215			case 0x4032: // NPU_SET_DMA0_LEN
   216				st.dma.src.len = st.dma.dst.len = cmd_to_addr(cmds);
   217				break;
   218			default:
   219				break;
   220			}
   221	
   222			if (cmd & 0x4000) {
   223				i++;
   224				cmds++;
   225			}
   226		}
   227	
   228		for (i = 0; i < NPU_BASEP_REGION_MAX; i++) {
   229			if (!info->region_size[i])
   230				continue;
   231			dev_info(ddev->dev, "region %d max size: %llx\n",
   232					i, info->region_size[i]);
   233		}
   234	
   235		bo->info = info;
   236		return 0;
   237	}
   238	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-07-01 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202507012232.PNa1KAOw-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.