Re: [PATCH v3 05/13] coresight: etm3x: Update ETM3 driver to use Trace ID API

From: kernel test robot
Date: Sat Aug 13 2022 - 05:53:23 EST


Hi Mike,

I love your patch! Perhaps something to improve:

[auto build test WARNING on acme/perf/core]
[also build test WARNING on tip/perf/core atorgue-stm32/stm32-next linus/master v5.19 next-20220812]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Mike-Leach/coresight-Add-new-API-to-allocate-trace-source-ID-values/20220810-063940
base: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20220813/202208131723.4WupJz5f-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/48c9bb1ba00758132c4523dba423071440723ccd
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Mike-Leach/coresight-Add-new-API-to-allocate-trace-source-ID-values/20220810-063940
git checkout 48c9bb1ba00758132c4523dba423071440723ccd
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/hwtracing/coresight/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/hwtracing/coresight/coresight-etm3x-core.c:509:44: warning: 'struct etmv4_drvdata' declared inside parameter list will not be visible outside of this definition or declaration
509 | static int etm_set_current_trace_id(struct etmv4_drvdata *drvdata)
| ^~~~~~~~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c: In function 'etm_set_current_trace_id':
drivers/hwtracing/coresight/coresight-etm3x-core.c:517:58: error: invalid use of undefined type 'struct etmv4_drvdata'
517 | trace_id = coresight_trace_id_read_cpu_id(drvdata->cpu);
| ^~
drivers/hwtracing/coresight/coresight-etm3x-core.c:519:24: error: invalid use of undefined type 'struct etmv4_drvdata'
519 | drvdata->traceid = (u8)trace_id;
| ^~
In file included from include/linux/device.h:15,
from drivers/hwtracing/coresight/coresight-etm3x-core.c:12:
drivers/hwtracing/coresight/coresight-etm3x-core.c:523:25: error: invalid use of undefined type 'struct etmv4_drvdata'
523 | dev_err(&drvdata->csdev->dev, "Failed to set trace ID for %s on CPU%d\n",
| ^~
include/linux/dev_printk.h:110:25: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
drivers/hwtracing/coresight/coresight-etm3x-core.c:523:9: note: in expansion of macro 'dev_err'
523 | dev_err(&drvdata->csdev->dev, "Failed to set trace ID for %s on CPU%d\n",
| ^~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c:524:34: error: invalid use of undefined type 'struct etmv4_drvdata'
524 | dev_name(&drvdata->csdev->dev), drvdata->cpu);
| ^~
include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c:523:9: note: in expansion of macro 'dev_err'
523 | dev_err(&drvdata->csdev->dev, "Failed to set trace ID for %s on CPU%d\n",
| ^~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c:524:56: error: invalid use of undefined type 'struct etmv4_drvdata'
524 | dev_name(&drvdata->csdev->dev), drvdata->cpu);
| ^~
include/linux/dev_printk.h:110:37: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c:523:9: note: in expansion of macro 'dev_err'
523 | dev_err(&drvdata->csdev->dev, "Failed to set trace ID for %s on CPU%d\n",
| ^~~~~~~
drivers/hwtracing/coresight/coresight-etm3x-core.c: In function 'etm_enable_perf':
drivers/hwtracing/coresight/coresight-etm3x-core.c:547:40: error: passing argument 1 of 'etm_set_current_trace_id' from incompatible pointer type [-Werror=incompatible-pointer-types]
547 | ret = etm_set_current_trace_id(drvdata);
| ^~~~~~~
| |
| struct etm_drvdata *
drivers/hwtracing/coresight/coresight-etm3x-core.c:509:59: note: expected 'struct etmv4_drvdata *' but argument is of type 'struct etm_drvdata *'
509 | static int etm_set_current_trace_id(struct etmv4_drvdata *drvdata)
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
cc1: some warnings being treated as errors


vim +509 drivers/hwtracing/coresight/coresight-etm3x-core.c

508
> 509 static int etm_set_current_trace_id(struct etmv4_drvdata *drvdata)
510 {
511 int trace_id;
512
513 /*
514 * Set the currently allocated trace ID - perf allocates IDs
515 * as part of setup_aux for all CPUs it may use.
516 */
517 trace_id = coresight_trace_id_read_cpu_id(drvdata->cpu);
518 if (IS_VALID_ID(trace_id)) {
519 drvdata->traceid = (u8)trace_id;
520 return 0;
521 }
522
523 dev_err(&drvdata->csdev->dev, "Failed to set trace ID for %s on CPU%d\n",
524 dev_name(&drvdata->csdev->dev), drvdata->cpu);
525
526 return -EINVAL;
527 }
528

--
0-DAY CI Kernel Test Service
https://01.org/lkp