From: kernel test robot <lkp@intel.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [robh:ethos-v3 5/5] drivers/accel/ethosu/ethosu_drv.c:210:9: error: implicit declaration of function 'FIELD_GET'
Date: Sun, 17 Aug 2025 02:27:58 +0800 [thread overview]
Message-ID: <202508170258.0PD98SOg-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git ethos-v3
head: 74531049aaf7feda960f5e7d701a417dd7620b2c
commit: 74531049aaf7feda960f5e7d701a417dd7620b2c [5/5] renaming
config: xtensa-randconfig-r073-20250817 (https://download.01.org/0day-ci/archive/20250817/202508170258.0PD98SOg-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250817/202508170258.0PD98SOg-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/202508170258.0PD98SOg-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/accel/ethosu/ethosu_drv.c: In function 'ethosu_is_u65':
>> drivers/accel/ethosu/ethosu_drv.c:210:9: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
return FIELD_GET(ID_ARCH_MAJOR_MASK, ethosudev->npu_info.id) == 1;
^~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/accel/ethosu/ethosu_drv.c:10:
drivers/accel/ethosu/ethosu_drv.c: In function 'ethosu_init':
>> drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 6 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 7 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
drivers/accel/ethosu/ethosu_drv.c:328:3: warning: format '%ld' expects argument of type 'long int', but argument 8 has type 'int' [-Wformat=]
"Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:110:16: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~
include/linux/dev_printk.h:160:51: note: in expansion of macro 'dev_fmt'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~
drivers/accel/ethosu/ethosu_drv.c:327:2: note: in expansion of macro 'dev_info'
dev_info(ethosudev->base.dev,
^~~~~~~~
cc1: some warnings being treated as errors
--
drivers/accel/ethosu/ethosu_gem.c: In function 'feat_matrix_length':
>> drivers/accel/ethosu/ethosu_gem.c:222:3: error: a label can only be part of a statement and a declaration is not a statement
u32 element_size = BIT((fm->precision >> 1) & 0x3);
^~~
drivers/accel/ethosu/ethosu_gem.c: In function 'ethosu_gem_cmdstream_copy_and_validate':
drivers/accel/ethosu/ethosu_gem.c:393:4: error: a label can only be part of a statement and a declaration is not a statement
u64 srclen = dma_length(info, &st.dma, &st.dma.src);
^~~
>> drivers/accel/ethosu/ethosu_gem.c:394:4: error: expected expression before 'u64'
u64 dstlen = dma_length(info, &st.dma, &st.dma.dst);
^~~
In file included from include/linux/device.h:15,
from include/linux/dma-mapping.h:5,
from include/linux/dma-buf.h:21,
from include/drm/drm_gem.h:38,
from include/drm/drm_gem_dma_helper.h:7,
from drivers/accel/ethosu/ethosu_gem.h:8,
from drivers/accel/ethosu/ethosu_gem.c:10:
>> drivers/accel/ethosu/ethosu_gem.c:400:44: error: 'dstlen' undeclared (first use in this function); did you mean 'strlen'?
st.dma.dst.region, st.dma.dst.offset, dstlen);
^~~~~~
include/linux/dev_printk.h:110:23: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~~~~~~~~~
drivers/accel/ethosu/ethosu_gem.c:398:4: note: in expansion of macro 'dev_info'
dev_info(ddev->dev, "cmd: DMA SRC:%d:0x%llx+0x%llx DST:%d:0x%llx+0x%llx\n",
^~~~~~~~
drivers/accel/ethosu/ethosu_gem.c:400:44: note: each undeclared identifier is reported only once for each function it appears in
st.dma.dst.region, st.dma.dst.offset, dstlen);
^~~~~~
include/linux/dev_printk.h:110:23: note: in definition of macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
^~~~~~~~~~~
drivers/accel/ethosu/ethosu_gem.c:398:4: note: in expansion of macro 'dev_info'
dev_info(ddev->dev, "cmd: DMA SRC:%d:0x%llx+0x%llx DST:%d:0x%llx+0x%llx\n",
^~~~~~~~
vim +/FIELD_GET +210 drivers/accel/ethosu/ethosu_drv.c
207
208 static bool ethosu_is_u65(const struct ethosu_device *ethosudev)
209 {
> 210 return FIELD_GET(ID_ARCH_MAJOR_MASK, ethosudev->npu_info.id) == 1;
211 }
212
213 #define AXI_LIMIT_CFG 0x1f3f0002
214
215 static int ethosu_reset(struct ethosu_device *ethosudev)
216 {
217 int ret;
218 u32 reg;
219
220 writel_relaxed(RESET_PENDING_CSL, ethosudev->regs + NPU_REG_RESET);
221 ret = readl_poll_timeout(ethosudev->regs + NPU_REG_STATUS, reg,
222 !FIELD_GET(STATUS_RESET_STATUS, reg),
223 USEC_PER_MSEC, USEC_PER_SEC);
224 if (ret)
225 return ret;
226
227 if (!FIELD_GET(PROT_ACTIVE_CSL, readl_relaxed(ethosudev->regs + NPU_REG_PROT))) {
228 dev_warn(ethosudev->base.dev, "Could not reset to non-secure mode (PROT = %x)\n",
229 readl_relaxed(ethosudev->regs + NPU_REG_PROT));
230 }
231
232 if (ethosu_is_u65(ethosudev)) {
233 /* Assign region 2 to AXI M0, everything else to AXI M1*/
234 writel_relaxed(0x0000aa8a, ethosudev->regs + NPU_REG_REGIONCFG);
235 writel_relaxed(AXI_LIMIT_CFG, ethosudev->regs + NPU_REG_AXILIMIT0);
236 writel_relaxed(AXI_LIMIT_CFG, ethosudev->regs + NPU_REG_AXILIMIT1);
237 writel_relaxed(AXI_LIMIT_CFG, ethosudev->regs + NPU_REG_AXILIMIT2);
238 writel_relaxed(AXI_LIMIT_CFG, ethosudev->regs + NPU_REG_AXILIMIT3);
239 }
240
241 if (ethosudev->sram)
242 memset_io(ethosudev->sram, 0, ethosudev->npu_info.sram_size);
243
244 return 0;
245 }
246
247 static int ethosu_device_resume(struct device *dev)
248 {
249 struct ethosu_device *ethosudev = dev_get_drvdata(dev);
250 int ret;
251
252 ret = clk_prepare_enable(ethosudev->core_clk);
253 if (ret)
254 return ret;
255
256 ret = clk_prepare_enable(ethosudev->apb_clk);
257 if (ret)
258 goto err_disable_core_clk;
259
260 ret = ethosu_reset(ethosudev);
261 if (!ret)
262 return 0;
263
264 err_disable_core_clk:
265 clk_disable_unprepare(ethosudev->core_clk);
266 return ret;
267 }
268
269 static int ethosu_device_suspend(struct device *dev)
270 {
271 struct ethosu_device *ethosudev = dev_get_drvdata(dev);
272
273 clk_disable_unprepare(ethosudev->apb_clk);
274 clk_disable_unprepare(ethosudev->core_clk);
275 return 0;
276 }
277
278 static int ethosu_sram_init(struct ethosu_device *ethosudev)
279 {
280 ethosudev->npu_info.sram_size = 0;
281
282 ethosudev->srampool = of_gen_pool_get(ethosudev->base.dev->of_node, "sram", 0);
283 if (!ethosudev->srampool)
284 return 0;
285
286 ethosudev->npu_info.sram_size = gen_pool_size(ethosudev->srampool);
287
288 ethosudev->sram = (void __iomem *)gen_pool_dma_alloc(ethosudev->srampool,
289 ethosudev->npu_info.sram_size,
290 ðosudev->sramphys);
291 if (!ethosudev->sram) {
292 dev_err(ethosudev->base.dev, "failed to allocate from SRAM pool\n");
293 return -ENOMEM;
294 }
295
296 return 0;
297 }
298
299 static int ethosu_init(struct ethosu_device *ethosudev)
300 {
301 int ret;
302 u32 id, config;
303
304 ret = devm_pm_runtime_enable(ethosudev->base.dev);
305 if (ret)
306 return ret;
307
308 ret = pm_runtime_resume_and_get(ethosudev->base.dev);
309 if (ret)
310 return ret;
311
312 pm_runtime_set_autosuspend_delay(ethosudev->base.dev, 50);
313 pm_runtime_use_autosuspend(ethosudev->base.dev);
314
315 /* If PM is disabled, we need to call ethosu_device_resume() manually. */
316 if (!IS_ENABLED(CONFIG_PM)) {
317 ret = ethosu_device_resume(ethosudev->base.dev);
318 if (ret)
319 return ret;
320 }
321
322 ethosudev->npu_info.id = id = readl_relaxed(ethosudev->regs + NPU_REG_ID);
323 ethosudev->npu_info.config = config = readl_relaxed(ethosudev->regs + NPU_REG_CONFIG);
324
325 ethosu_sram_init(ethosudev);
326
327 dev_info(ethosudev->base.dev,
> 328 "Ethos-U NPU, arch v%ld.%ld.%ld, rev r%ldp%ld, cmd stream ver%ld, %d MACs, %dKB SRAM\n",
329 FIELD_GET(ID_ARCH_MAJOR_MASK, id),
330 FIELD_GET(ID_ARCH_MINOR_MASK, id),
331 FIELD_GET(ID_ARCH_PATCH_MASK, id),
332 FIELD_GET(ID_VER_MAJOR_MASK, id),
333 FIELD_GET(ID_VER_MINOR_MASK, id),
334 FIELD_GET(CONFIG_CMD_STREAM_VER_MASK, config),
335 1 << FIELD_GET(CONFIG_MACS_PER_CC_MASK, config),
336 ethosudev->npu_info.sram_size / 1024);
337
338 return 0;
339 }
340
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-08-16 18:28 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=202508170258.0PD98SOg-lkp@intel.com \
--to=lkp@intel.com \
--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.