tree:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-5.9.y
head: f022ed13f4d94a0b1bf5ec9e1f08e964f6878d55
commit: fc5382d70826c92e90d9efa90a4c671efe15f268 [967/1457] coresight: Make sysfs
functional on topologies with per core sink
config: arm-randconfig-r033-20201115 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.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://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-5.9.y
git checkout fc5382d70826c92e90d9efa90a4c671efe15f268
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/hwtracing/coresight/coresight-etm-perf.c: In function 'etm_setup_aux':
> drivers/hwtracing/coresight/coresight-etm-perf.c:226:37: warning:
passing argument 1 of 'coresight_get_enabled_sink' makes pointer from integer
without a cast [-Wint-conversion]
226 | sink =
coresight_get_enabled_sink(true);
| ^~~~
| |
| int
In file included from drivers/hwtracing/coresight/coresight-etm-perf.h:11,
from drivers/hwtracing/coresight/coresight-etm-perf.c:21:
drivers/hwtracing/coresight/coresight-priv.h:152:1: note: expected 'struct
coresight_device *' but argument is of type 'int'
152 | coresight_get_enabled_sink(struct coresight_device *source);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/coresight_get_enabled_sink +226 drivers/hwtracing/coresight/coresight-etm-perf.c
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 206
840018668ce2d96 Mathieu Poirier 2019-01-31 207 static void *etm_setup_aux(struct
perf_event *event, void **pages,
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 208 int nr_pages, bool overwrite)
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 209 {
2264439258870ed Mathieu Poirier 2019-01-31 210 u32 id;
840018668ce2d96 Mathieu Poirier 2019-01-31 211 int cpu = event->cpu;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 212 cpumask_t *mask;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 213 struct coresight_device *sink;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 214 struct etm_event_data *event_data =
NULL;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 215
840018668ce2d96 Mathieu Poirier 2019-01-31 216 event_data = alloc_event_data(cpu);
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 217 if (!event_data)
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 218 return NULL;
d755209f6afddec Suzuki K Poulose 2017-06-05 219 INIT_WORK(&event_data->work,
free_event_data);
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 220
2264439258870ed Mathieu Poirier 2019-01-31 221 /* First get the selected sink from
user space. */
2264439258870ed Mathieu Poirier 2019-01-31 222 if (event->attr.config2) {
2264439258870ed Mathieu Poirier 2019-01-31 223 id = (u32)event->attr.config2;
2264439258870ed Mathieu Poirier 2019-01-31 224 sink = coresight_get_sink_by_id(id);
2264439258870ed Mathieu Poirier 2019-01-31 225 } else {
d52c9750f150111 Mathieu Poirier 2016-11-29 @226 sink =
coresight_get_enabled_sink(true);
2264439258870ed Mathieu Poirier 2019-01-31 227 }
2264439258870ed Mathieu Poirier 2019-01-31 228
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 229 mask = &event_data->mask;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 230
f9d81a657bb833e Suzuki K Poulose 2018-09-20 231 /*
f9d81a657bb833e Suzuki K Poulose 2018-09-20 232 * Setup the path for each CPU in a
trace session. We try to build
f9d81a657bb833e Suzuki K Poulose 2018-09-20 233 * trace path for each CPU in the mask.
If we don't find an ETM
f9d81a657bb833e Suzuki K Poulose 2018-09-20 234 * for the CPU or fail to build a path,
we clear the CPU from the
f9d81a657bb833e Suzuki K Poulose 2018-09-20 235 * mask and continue with the rest. If
ever we try to trace on those
f9d81a657bb833e Suzuki K Poulose 2018-09-20 236 * CPUs, we can handle it and fail the
session.
f9d81a657bb833e Suzuki K Poulose 2018-09-20 237 */
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 238 for_each_cpu(cpu, mask) {
5ecabe4a76e8cdb Suzuki K Poulose 2018-09-20 239 struct list_head *path;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 240 struct coresight_device *csdev;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 241
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 242 csdev = per_cpu(csdev_src, cpu);
f9d81a657bb833e Suzuki K Poulose 2018-09-20 243 /*
f9d81a657bb833e Suzuki K Poulose 2018-09-20 244 * If there is no ETM associated with
this CPU clear it from
f9d81a657bb833e Suzuki K Poulose 2018-09-20 245 * the mask and continue with the
rest. If ever we try to trace
f9d81a657bb833e Suzuki K Poulose 2018-09-20 246 * on this CPU, we handle it
accordingly.
f9d81a657bb833e Suzuki K Poulose 2018-09-20 247 */
f9d81a657bb833e Suzuki K Poulose 2018-09-20 248 if (!csdev) {
f9d81a657bb833e Suzuki K Poulose 2018-09-20 249 cpumask_clear_cpu(cpu, mask);
f9d81a657bb833e Suzuki K Poulose 2018-09-20 250 continue;
f9d81a657bb833e Suzuki K Poulose 2018-09-20 251 }
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 252
bbfb8f3e4e3f10c Mike Leach 2020-07-16 253 /*
bbfb8f3e4e3f10c Mike Leach 2020-07-16 254 * No sink provided - look for a
default sink for one of the
bbfb8f3e4e3f10c Mike Leach 2020-07-16 255 * devices. At present we only support
topology where all CPUs
bbfb8f3e4e3f10c Mike Leach 2020-07-16 256 * use the same sink [N:1], so only
need to find one sink. The
bbfb8f3e4e3f10c Mike Leach 2020-07-16 257 * coresight_build_path later will
remove any CPU that does not
bbfb8f3e4e3f10c Mike Leach 2020-07-16 258 * attach to the sink, or if we have
not found a sink.
bbfb8f3e4e3f10c Mike Leach 2020-07-16 259 */
bbfb8f3e4e3f10c Mike Leach 2020-07-16 260 if (!sink)
bbfb8f3e4e3f10c Mike Leach 2020-07-16 261 sink =
coresight_find_default_sink(csdev);
bbfb8f3e4e3f10c Mike Leach 2020-07-16 262
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 263 /*
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 264 * Building a path doesn't enable
it, it simply builds a
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 265 * list of devices from source to sink
that can be
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 266 * referenced later when the path is
actually needed.
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 267 */
5ecabe4a76e8cdb Suzuki K Poulose 2018-09-20 268 path = coresight_build_path(csdev,
sink);
f9d81a657bb833e Suzuki K Poulose 2018-09-20 269 if (IS_ERR(path)) {
f9d81a657bb833e Suzuki K Poulose 2018-09-20 270 cpumask_clear_cpu(cpu, mask);
f9d81a657bb833e Suzuki K Poulose 2018-09-20 271 continue;
f9d81a657bb833e Suzuki K Poulose 2018-09-20 272 }
5ecabe4a76e8cdb Suzuki K Poulose 2018-09-20 273
5ecabe4a76e8cdb Suzuki K Poulose 2018-09-20 274 *etm_event_cpu_path_ptr(event_data,
cpu) = path;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 275 }
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 276
bbfb8f3e4e3f10c Mike Leach 2020-07-16 277 /* no sink found for any CPU - cannot
trace */
bbfb8f3e4e3f10c Mike Leach 2020-07-16 278 if (!sink)
bbfb8f3e4e3f10c Mike Leach 2020-07-16 279 goto err;
bbfb8f3e4e3f10c Mike Leach 2020-07-16 280
f9d81a657bb833e Suzuki K Poulose 2018-09-20 281 /* If we don't have any CPUs ready
for tracing, abort */
f9d81a657bb833e Suzuki K Poulose 2018-09-20 282 cpu = cpumask_first(mask);
f9d81a657bb833e Suzuki K Poulose 2018-09-20 283 if (cpu >= nr_cpu_ids)
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 284 goto err;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 285
02d5c897a091f8e Mathieu Poirier 2019-04-25 286 if (!sink_ops(sink)->alloc_buffer ||
!sink_ops(sink)->free_buffer)
02d5c897a091f8e Mathieu Poirier 2019-04-25 287 goto err;
02d5c897a091f8e Mathieu Poirier 2019-04-25 288
f9d81a657bb833e Suzuki K Poulose 2018-09-20 289 /* Allocate the sink buffer for this
session */
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 290 event_data->snk_config =
a0f08a6a9fee0ce Mathieu Poirier 2019-04-25 291 sink_ops(sink)->alloc_buffer(sink,
event, pages,
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 292 nr_pages, overwrite);
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 293 if (!event_data->snk_config)
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 294 goto err;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 295
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 296 out:
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 297 return event_data;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 298
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 299 err:
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 300 etm_free_aux(event_data);
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 301 event_data = NULL;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 302 goto out;
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 303 }
0bcbf2e30ff2271 Mathieu Poirier 2016-02-17 304
:::::: The code at line 226 was first introduced by commit
:::::: d52c9750f150111dc7f73e4036f6948b20c9f8c3 coresight: reset "enable_sink"
flag when need be
:::::: TO: Mathieu Poirier <mathieu.poirier(a)linaro.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org