Re: [PATCH v2] Adding i2c-cp2615: i2c support for Silicon Labs' CP2615 Digital Audio Bridge
by kernel test robot
Hi "Bence,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v5.12-rc3 next-20210317]
[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]
url: https://github.com/0day-ci/linux/commits/Bence-Cs-k-s/Adding-i2c-cp2615-i...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-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://github.com/0day-ci/linux/commit/c8c005a08175789b1874e69abf4c6da69...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bence-Cs-k-s/Adding-i2c-cp2615-i2c-support-for-Silicon-Labs-CP2615-Digital-Audio-Bridge/20210317-181539
git checkout c8c005a08175789b1874e69abf4c6da690d5b323
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
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/i2c/busses/i2c-cp2615.c:82:5: warning: no previous prototype for 'cp2615_init_iop_msg' [-Wmissing-prototypes]
82 | int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg, const void *data, size_t data_len)
| ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:99:5: warning: no previous prototype for 'cp2615_init_i2c_msg' [-Wmissing-prototypes]
99 | int cp2615_init_i2c_msg(struct cp2615_iop_msg *ret, const struct cp2615_i2c_transfer *data)
| ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:105:5: warning: no previous prototype for 'cp2615_check_status' [-Wmissing-prototypes]
105 | int cp2615_check_status(enum cp2615_i2c_status status)
| ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c: In function 'cp2615_i2c_probe':
>> drivers/i2c/busses/i2c-cp2615.c:247:2: warning: 'strncpy' specified bound 48 equals destination size [-Wstringop-truncation]
247 | strncpy(adap->name, usbdev->serial, sizeof(adap->name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
vim +/strncpy +247 drivers/i2c/busses/i2c-cp2615.c
231
232 static int
233 cp2615_i2c_probe(struct usb_interface *usbif, const struct usb_device_id *id)
234 {
235 int ret = 0;
236 struct i2c_adapter *adap;
237 struct usb_device *usbdev = interface_to_usbdev(usbif);
238
239 ret = usb_set_interface(usbdev, IOP_IFN, IOP_ALTSETTING);
240 if (ret)
241 return ret;
242
243 adap = devm_kzalloc(&usbif->dev, sizeof(struct i2c_adapter), GFP_KERNEL);
244 if (!adap)
245 return -ENOMEM;
246
> 247 strncpy(adap->name, usbdev->serial, sizeof(adap->name));
248 adap->owner = THIS_MODULE;
249 adap->dev.parent = &usbif->dev;
250 adap->dev.of_node = usbif->dev.of_node;
251 adap->timeout = HZ;
252 adap->algo = &cp2615_i2c_algo;
253 adap->quirks = &cp2615_i2c_quirks;
254 adap->algo_data = usbif;
255
256 ret = i2c_add_adapter(adap);
257 if (ret)
258 return ret;
259
260 usb_set_intfdata(usbif, adap);
261 return ret;
262 }
263
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-next:master 3779/5053] drivers/thermal/thermal_core.c:1020 __thermal_cooling_device_register() warn: possible memory leak of 'cdev'
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: fa903833ae344e4f4d798a8b85ba3ef0c5ce96c9
commit: 58483761810087e5ffdf36e84ac1bf26df909097 [3779/5053] thermal/drivers/core: Use a char pointer for the cooling device name
config: x86_64-randconfig-m001-20210317 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/thermal/thermal_core.c:1020 __thermal_cooling_device_register() warn: possible memory leak of 'cdev'
vim +/cdev +1020 drivers/thermal/thermal_core.c
a116b5d44f1445 drivers/thermal/thermal_core.c Eduardo Valentin 2013-09-26 956 static struct thermal_cooling_device *
a116b5d44f1445 drivers/thermal/thermal_core.c Eduardo Valentin 2013-09-26 957 __thermal_cooling_device_register(struct device_node *np,
f991de53a8abef drivers/thermal/thermal_core.c Jean-Francois Dagenais 2019-04-18 958 const char *type, void *devdata,
caca8b803520b0 drivers/thermal/thermal_sys.c Joe Perches 2012-03-21 959 const struct thermal_cooling_device_ops *ops)
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 960 {
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 961 struct thermal_cooling_device *cdev;
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 962 struct thermal_zone_device *pos = NULL;
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 963 int ret;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 964
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 965 if (!ops || !ops->get_max_state || !ops->get_cur_state ||
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 966 !ops->set_cur_state)
3e6fda5c115982 drivers/thermal/thermal.c Thomas Sujith 2008-02-15 967 return ERR_PTR(-EINVAL);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 968
95e3ed1513494a drivers/thermal/thermal_core.c Eduardo Valentin 2016-11-07 969 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 970 if (!cdev)
3e6fda5c115982 drivers/thermal/thermal.c Thomas Sujith 2008-02-15 971 return ERR_PTR(-ENOMEM);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 972
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 973 ret = ida_simple_get(&thermal_cdev_ida, 0, 0, GFP_KERNEL);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 974 if (ret < 0)
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 975 goto out_kfree_cdev;
^^^^^^^^^^^^^^^^^^^^
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 976 cdev->id = ret;
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 977
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 978 cdev->type = kstrdup(type ? type : "", GFP_KERNEL);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 979 if (!cdev->type) {
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 980 ret = -ENOMEM;
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 981 goto out_ida_remove;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 982 }
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 983
f4a821ce6ed419 drivers/thermal/thermal_sys.c Zhang Rui 2012-07-24 984 mutex_init(&cdev->lock);
b5e4ae620b0627 drivers/thermal/thermal_sys.c Zhang Rui 2012-06-27 985 INIT_LIST_HEAD(&cdev->thermal_instances);
a116b5d44f1445 drivers/thermal/thermal_core.c Eduardo Valentin 2013-09-26 986 cdev->np = np;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 987 cdev->ops = ops;
5ca0cce5622bf4 drivers/thermal/thermal_core.c Ni Wade 2014-02-17 988 cdev->updated = false;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 989 cdev->device.class = &thermal_class;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 990 cdev->devdata = devdata;
8ea229511e06f9 drivers/thermal/thermal_core.c Viresh Kumar 2018-04-02 991 thermal_cooling_device_setup_sysfs(cdev);
354655ea9714e5 drivers/thermal/thermal_sys.c Kay Sievers 2009-01-06 992 dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 993 ret = device_register(&cdev->device);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 994 if (ret)
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 995 goto out_kfree_type;
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 996
7e8ee1e9d7561f drivers/thermal/thermal_sys.c Durgadoss R 2012-09-18 997 /* Add 'this' new cdev to the global cdev list */
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 998 mutex_lock(&thermal_list_lock);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 999 list_add(&cdev->node, &thermal_cdev_list);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1000 mutex_unlock(&thermal_list_lock);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1001
7e8ee1e9d7561f drivers/thermal/thermal_sys.c Durgadoss R 2012-09-18 1002 /* Update binding information for 'this' new cdev */
7e8ee1e9d7561f drivers/thermal/thermal_sys.c Durgadoss R 2012-09-18 1003 bind_cdev(cdev);
7e8ee1e9d7561f drivers/thermal/thermal_sys.c Durgadoss R 2012-09-18 1004
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 1005 mutex_lock(&thermal_list_lock);
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 1006 list_for_each_entry(pos, &thermal_tz_list, node)
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 1007 if (atomic_cmpxchg(&pos->need_update, 1, 0))
0e70f466fb910a drivers/thermal/thermal_core.c Srinivas Pandruvada 2016-08-26 1008 thermal_zone_device_update(pos,
0e70f466fb910a drivers/thermal/thermal_core.c Srinivas Pandruvada 2016-08-26 1009 THERMAL_EVENT_UNSPECIFIED);
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 1010 mutex_unlock(&thermal_list_lock);
4511f7166a2deb drivers/thermal/thermal_core.c Chen Yu 2015-10-30 1011
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1012 return cdev;
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1013
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1014 out_kfree_type:
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1015 kfree(cdev->type);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1016 put_device(&cdev->device);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1017 out_ida_remove:
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1018 ida_simple_remove(&thermal_cdev_ida, cdev->id);
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 1019 out_kfree_cdev:
Presumably there was supposed to be a kfree(cdev) here. ;)
58483761810087 drivers/thermal/thermal_core.c Daniel Lezcano 2021-03-14 @1020 return ERR_PTR(ret);
203d3d4aa48233 drivers/thermal/thermal.c Zhang Rui 2008-01-17 1021 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[weiny2:tip-pks-v4.8-5.12-rc 9/17] kernel/entry/common.c:383:26: error: use of undeclared identifier 'INIT_PKRS_VALUE'
by kernel test robot
tree: https://github.com/weiny2/linux-kernel.git tip-pks-v4.8-5.12-rc
head: fae3081ca82909d3bbe51a7942ab30f333b41f9d
commit: 5ea6a032eb2a6cd0a8000029d03ad4581ed3c276 [9/17] x86/entry: Preserve PKRS MSR across exceptions
config: s390-randconfig-r022-20210317 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8ef111222a3dd12a9175f69c3bff598c46e8bdf7)
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
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/weiny2/linux-kernel/commit/5ea6a032eb2a6cd0a8000029d03...
git remote add weiny2 https://github.com/weiny2/linux-kernel.git
git fetch --no-tags weiny2 tip-pks-v4.8-5.12-rc
git checkout 5ea6a032eb2a6cd0a8000029d03ad4581ed3c276
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from kernel/entry/common.c:4:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from kernel/entry/common.c:4:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from kernel/entry/common.c:4:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from kernel/entry/common.c:4:
In file included from include/linux/entry-common.h:6:
In file included from include/linux/tracehook.h:50:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:26:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:80:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> kernel/entry/common.c:383:26: error: use of undeclared identifier 'INIT_PKRS_VALUE'
pkrs_save_set_irq(regs, INIT_PKRS_VALUE);
^
kernel/entry/common.c:468:26: error: use of undeclared identifier 'INIT_PKRS_VALUE'
pkrs_save_set_irq(regs, INIT_PKRS_VALUE);
^
20 warnings and 2 errors generated.
vim +/INIT_PKRS_VALUE +383 kernel/entry/common.c
319
320 noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs)
321 {
322 irqentry_state_t ret = {
323 .exit_rcu = false,
324 };
325
326 if (user_mode(regs)) {
327 irqentry_enter_from_user_mode(regs);
328 return ret;
329 }
330
331 /*
332 * If this entry hit the idle task invoke rcu_irq_enter() whether
333 * RCU is watching or not.
334 *
335 * Interrupts can nest when the first interrupt invokes softirq
336 * processing on return which enables interrupts.
337 *
338 * Scheduler ticks in the idle task can mark quiescent state and
339 * terminate a grace period, if and only if the timer interrupt is
340 * not nested into another interrupt.
341 *
342 * Checking for rcu_is_watching() here would prevent the nesting
343 * interrupt to invoke rcu_irq_enter(). If that nested interrupt is
344 * the tick then rcu_flavor_sched_clock_irq() would wrongfully
345 * assume that it is the first interupt and eventually claim
346 * quiescent state and end grace periods prematurely.
347 *
348 * Unconditionally invoke rcu_irq_enter() so RCU state stays
349 * consistent.
350 *
351 * TINY_RCU does not support EQS, so let the compiler eliminate
352 * this part when enabled.
353 */
354 if (!IS_ENABLED(CONFIG_TINY_RCU) && is_idle_task(current)) {
355 /*
356 * If RCU is not watching then the same careful
357 * sequence vs. lockdep and tracing is required
358 * as in irqentry_enter_from_user_mode().
359 */
360 lockdep_hardirqs_off(CALLER_ADDR0);
361 rcu_irq_enter();
362 instrumentation_begin();
363 trace_hardirqs_off_finish();
364 instrumentation_end();
365
366 ret.exit_rcu = true;
367 goto done;
368 }
369
370 /*
371 * If RCU is watching then RCU only wants to check whether it needs
372 * to restart the tick in NOHZ mode. rcu_irq_enter_check_tick()
373 * already contains a warning when RCU is not watching, so no point
374 * in having another one here.
375 */
376 lockdep_hardirqs_off(CALLER_ADDR0);
377 instrumentation_begin();
378 rcu_irq_enter_check_tick();
379 trace_hardirqs_off_finish();
380 instrumentation_end();
381
382 done:
> 383 pkrs_save_set_irq(regs, INIT_PKRS_VALUE);
384 return ret;
385 }
386
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH 2/3] drivers/perf: convert sysfs scnprintf family to sysfs_emit_at
by kernel test robot
Hi Qi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.12-rc3 next-20210317]
[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]
url: https://github.com/0day-ci/linux/commits/Qi-Liu/drivers-perf-convert-sysf...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1df27313f50a57497c1faeb6a6ae4ca939c85a7d
config: arm64-randconfig-r003-20210317 (attached as .config)
compiler: aarch64-linux-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://github.com/0day-ci/linux/commit/81a69a2f7fa73d0c41d699d6c6993c259...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qi-Liu/drivers-perf-convert-sysfs-sprintf-snprintf-scnprintf-to-sysfs_emit/20210317-174750
git checkout 81a69a2f7fa73d0c41d699d6c6993c2594001241
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
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/perf/arm-ccn.c: In function 'arm_ccn_pmu_event_show':
>> drivers/perf/arm-ccn.c:345:32: warning: passing argument 2 of 'sysfs_emit' makes pointer from integer without a cast [-Wint-conversion]
345 | res += sysfs_emit(buf + res, res, ",xp=?,vc=?");
| ^~~
| |
| ssize_t {aka long int}
In file included from include/linux/kobject.h:20,
from include/linux/irqdesc.h:6,
from include/linux/irq.h:584,
from include/asm-generic/hardirq.h:17,
from arch/arm64/include/asm/hardirq.h:17,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from drivers/perf/arm-ccn.c:10:
include/linux/sysfs.h:335:39: note: expected 'const char *' but argument is of type 'ssize_t' {aka 'long int'}
335 | int sysfs_emit(char *buf, const char *fmt, ...);
| ~~~~~~~~~~~~^~~
vim +/sysfs_emit +345 drivers/perf/arm-ccn.c
274
275 #define CCN_EVENT_ATTR(_name) \
276 __ATTR(_name, S_IRUGO, arm_ccn_pmu_event_show, NULL)
277
278 /*
279 * Events defined in TRM for MN, HN-I and SBSX are actually watchpoints set on
280 * their ports in XP they are connected to. For the sake of usability they are
281 * explicitly defined here (and translated into a relevant watchpoint in
282 * arm_ccn_pmu_event_init()) so the user can easily request them without deep
283 * knowledge of the flit format.
284 */
285
286 #define CCN_EVENT_MN(_name, _def, _mask) { .attr = CCN_EVENT_ATTR(mn_##_name), \
287 .type = CCN_TYPE_MN, .event = CCN_EVENT_WATCHPOINT, \
288 .num_ports = CCN_NUM_XP_PORTS, .num_vcs = CCN_NUM_VCS, \
289 .def = _def, .mask = _mask, }
290
291 #define CCN_EVENT_HNI(_name, _def, _mask) { \
292 .attr = CCN_EVENT_ATTR(hni_##_name), .type = CCN_TYPE_HNI, \
293 .event = CCN_EVENT_WATCHPOINT, .num_ports = CCN_NUM_XP_PORTS, \
294 .num_vcs = CCN_NUM_VCS, .def = _def, .mask = _mask, }
295
296 #define CCN_EVENT_SBSX(_name, _def, _mask) { \
297 .attr = CCN_EVENT_ATTR(sbsx_##_name), .type = CCN_TYPE_SBSX, \
298 .event = CCN_EVENT_WATCHPOINT, .num_ports = CCN_NUM_XP_PORTS, \
299 .num_vcs = CCN_NUM_VCS, .def = _def, .mask = _mask, }
300
301 #define CCN_EVENT_HNF(_name, _event) { .attr = CCN_EVENT_ATTR(hnf_##_name), \
302 .type = CCN_TYPE_HNF, .event = _event, }
303
304 #define CCN_EVENT_XP(_name, _event) { .attr = CCN_EVENT_ATTR(xp_##_name), \
305 .type = CCN_TYPE_XP, .event = _event, \
306 .num_ports = CCN_NUM_XP_PORTS, .num_vcs = CCN_NUM_VCS, }
307
308 /*
309 * RN-I & RN-D (RN-D = RN-I + DVM) nodes have different type ID depending
310 * on configuration. One of them is picked to represent the whole group,
311 * as they all share the same event types.
312 */
313 #define CCN_EVENT_RNI(_name, _event) { .attr = CCN_EVENT_ATTR(rni_##_name), \
314 .type = CCN_TYPE_RNI_3P, .event = _event, }
315
316 #define CCN_EVENT_SBAS(_name, _event) { .attr = CCN_EVENT_ATTR(sbas_##_name), \
317 .type = CCN_TYPE_SBAS, .event = _event, }
318
319 #define CCN_EVENT_CYCLES(_name) { .attr = CCN_EVENT_ATTR(_name), \
320 .type = CCN_TYPE_CYCLES }
321
322
323 static ssize_t arm_ccn_pmu_event_show(struct device *dev,
324 struct device_attribute *attr, char *buf)
325 {
326 struct arm_ccn *ccn = pmu_to_arm_ccn(dev_get_drvdata(dev));
327 struct arm_ccn_pmu_event *event = container_of(attr,
328 struct arm_ccn_pmu_event, attr);
329 ssize_t res;
330
331 res = sysfs_emit(buf, "type=0x%x", event->type);
332 if (event->event)
333 res += sysfs_emit_at(buf + res, res, ",event=0x%x",
334 event->event);
335 if (event->def)
336 res += sysfs_emit_at(buf + res, res, ",%s", event->def);
337 if (event->mask)
338 res += sysfs_emit_at(buf + res, res, ",mask=0x%x", event->mask);
339
340 /* Arguments required by an event */
341 switch (event->type) {
342 case CCN_TYPE_CYCLES:
343 break;
344 case CCN_TYPE_XP:
> 345 res += sysfs_emit(buf + res, res, ",xp=?,vc=?");
346 if (event->event == CCN_EVENT_WATCHPOINT)
347 res += sysfs_emit_at(buf + res, res,
348 ",port=?,dir=?,cmp_l=?,cmp_h=?,mask=?");
349 else
350 res += sysfs_emit_at(buf + res, res, ",bus=?");
351
352 break;
353 case CCN_TYPE_MN:
354 res += sysfs_emit_at(buf + res, res, ",node=%d", ccn->mn_id);
355 break;
356 default:
357 res += sysfs_emit_at(buf + res, res, ",node=?");
358 break;
359 }
360
361 res += sysfs_emit_at(buf + res, res, "\n");
362
363 return res;
364 }
365
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [RFC PATCH v4 13/19] dyndbg+module: expose ddebug_sites to modules
by kernel test robot
Hi Jim,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on tip/x86/core]
[also build test ERROR on jeyu/modules-next tip/x86/vdso efi/next drm-intel/for-linux-next kbuild/for-next linus/master v5.12-rc3 next-20210317]
[cannot apply to asm-generic/master]
[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]
url: https://github.com/0day-ci/linux/commits/Jim-Cromie/dyndbg-split-struct-_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git f935178b5c1c32ff803b15892a8ba85a1280cb01
config: mips-randconfig-r015-20210317 (attached as .config)
compiler: mipsel-linux-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://github.com/0day-ci/linux/commit/5e967879ab4f65ac82fbc4ee3593aa31c...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jim-Cromie/dyndbg-split-struct-_ddebug-move-display-fields-to-new-_ddebug_site/20210317-155358
git checkout 5e967879ab4f65ac82fbc4ee3593aa31c801cc84
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
kernel/module.c: In function 'dynamic_debug_setup':
>> kernel/module.c:2788:27: warning: passing argument 2 of 'ddebug_add_module' makes integer from pointer without a cast [-Wint-conversion]
2788 | ddebug_add_module(debug, sites, num, mod->name);
| ^~~~~
| |
| struct _ddebug_site *
In file included from kernel/module.c:57:
include/linux/dynamic_debug.h:206:71: note: expected 'unsigned int' but argument is of type 'struct _ddebug_site *'
206 | static inline int ddebug_add_module(struct _ddebug *tab, unsigned int n,
| ~~~~~~~~~~~~~^
>> kernel/module.c:2788:34: warning: passing argument 3 of 'ddebug_add_module' makes pointer from integer without a cast [-Wint-conversion]
2788 | ddebug_add_module(debug, sites, num, mod->name);
| ^~~
| |
| unsigned int
In file included from kernel/module.c:57:
include/linux/dynamic_debug.h:207:21: note: expected 'const char *' but argument is of type 'unsigned int'
207 | const char *modname)
| ~~~~~~~~~~~~^~~~~~~
>> kernel/module.c:2788:2: error: too many arguments to function 'ddebug_add_module'
2788 | ddebug_add_module(debug, sites, num, mod->name);
| ^~~~~~~~~~~~~~~~~
In file included from kernel/module.c:57:
include/linux/dynamic_debug.h:206:19: note: declared here
206 | static inline int ddebug_add_module(struct _ddebug *tab, unsigned int n,
| ^~~~~~~~~~~~~~~~~
kernel/module.c: At top level:
kernel/module.c:4678:6: warning: no previous prototype for 'module_layout' [-Wmissing-prototypes]
4678 | void module_layout(struct module *mod,
| ^~~~~~~~~~~~~
vim +/ddebug_add_module +2788 kernel/module.c
2782
2783 static void dynamic_debug_setup(struct module *mod, struct _ddebug *debug,
2784 struct _ddebug_site *sites, unsigned int num)
2785 {
2786 if (!debug)
2787 return;
> 2788 ddebug_add_module(debug, sites, num, mod->name);
2789 }
2790
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v2] Adding i2c-cp2615: i2c support for Silicon Labs' CP2615 Digital Audio Bridge
by kernel test robot
Hi "Bence,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v5.12-rc3 next-20210317]
[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]
url: https://github.com/0day-ci/linux/commits/Bence-Cs-k-s/Adding-i2c-cp2615-i...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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://github.com/0day-ci/linux/commit/c8c005a08175789b1874e69abf4c6da69...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bence-Cs-k-s/Adding-i2c-cp2615-i2c-support-for-Silicon-Labs-CP2615-Digital-Audio-Bridge/20210317-181539
git checkout c8c005a08175789b1874e69abf4c6da690d5b323
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
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/i2c/busses/i2c-cp2615.c:82:5: warning: no previous prototype for 'cp2615_init_iop_msg' [-Wmissing-prototypes]
82 | int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg, const void *data, size_t data_len)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-cp2615.c:99:5: warning: no previous prototype for 'cp2615_init_i2c_msg' [-Wmissing-prototypes]
99 | int cp2615_init_i2c_msg(struct cp2615_iop_msg *ret, const struct cp2615_i2c_transfer *data)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-cp2615.c:105:5: warning: no previous prototype for 'cp2615_check_status' [-Wmissing-prototypes]
105 | int cp2615_check_status(enum cp2615_i2c_status status)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-cp2615.c:269:1: warning: data definition has no type or storage class
269 | MODULE_DEVICE_TABLE(usb, id_table);
| ^~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:269:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
>> drivers/i2c/busses/i2c-cp2615.c:269:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:11:
>> include/linux/device/driver.h:263:1: warning: data definition has no type or storage class
263 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:263:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]
263 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from drivers/i2c/busses/i2c-cp2615.c:9:
>> include/linux/export.h:19:30: warning: parameter names (without types) in function declaration
19 | #define THIS_MODULE ((struct module *)0)
| ^~~~~~
include/linux/usb.h:1290:30: note: in expansion of macro 'THIS_MODULE'
1290 | usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
| ^~~~~~~~~~~
include/linux/device/driver.h:261:9: note: in expansion of macro 'usb_register'
261 | return __register(&(__driver) , ##__VA_ARGS__); \
| ^~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:11:
include/linux/device/driver.h:268:1: warning: data definition has no type or storage class
268 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:268:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int]
268 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
In file included from include/linux/linkage.h:7,
from include/linux/kernel.h:7,
from drivers/i2c/busses/i2c-cp2615.c:9:
>> include/linux/export.h:19:30: warning: parameter names (without types) in function declaration
19 | #define THIS_MODULE ((struct module *)0)
| ^~~~~~
include/linux/usb.h:1290:30: note: in expansion of macro 'THIS_MODULE'
1290 | usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
| ^~~~~~~~~~~
include/linux/device/driver.h:261:9: note: in expansion of macro 'usb_register'
261 | return __register(&(__driver) , ##__VA_ARGS__); \
| ^~~~~~~~~~
include/linux/usb.h:1303:2: note: in expansion of macro 'module_driver'
1303 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:280:15: error: expected declaration specifiers or '...' before string constant
280 | MODULE_AUTHOR("Bence Csókás <bence98(a)sch.bme.hu>");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:281:20: error: expected declaration specifiers or '...' before string constant
281 | MODULE_DESCRIPTION("CP2615 I2C bus driver");
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:282:16: error: expected declaration specifiers or '...' before string constant
282 | MODULE_LICENSE("GPL");
| ^~~~~
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:11:
drivers/i2c/busses/i2c-cp2615.c:278:19: warning: 'cp2615_i2c_driver_init' defined but not used [-Wunused-function]
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
259 | static int __init __driver##_init(void) \
| ^~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:278:1: note: in expansion of macro 'module_usb_driver'
278 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/cp2615_init_iop_msg +82 drivers/i2c/busses/i2c-cp2615.c
81
> 82 int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg, const void *data, size_t data_len)
83 {
84 if (data_len > MAX_IOP_PAYLOAD_SIZE)
85 return -EFBIG;
86
87 if (ret) {
88 ret->preamble = 0x2A2A;
89 ret->length = htons(data_len+6);
90 ret->msg = htons(msg);
91 if(data && data_len)
92 memcpy(&ret->data, data, data_len);
93 return 0;
94 } else {
95 return -EINVAL;
96 }
97 }
98
> 99 int cp2615_init_i2c_msg(struct cp2615_iop_msg *ret, const struct cp2615_i2c_transfer *data)
100 {
101 return cp2615_init_iop_msg(ret, iop_DoI2cTransfer, data, 4 + data->write_len);
102 }
103
104 /* Translates status codes to Linux errno's */
> 105 int cp2615_check_status(enum cp2615_i2c_status status)
106 {
107 switch (status) {
108 case CP2615_SUCCESS:
109 return 0;
110 case CP2615_BUS_ERROR:
111 return -ECOMM;
112 case CP2615_BUS_BUSY:
113 return -EAGAIN;
114 case CP2615_TIMEOUT:
115 return -ETIMEDOUT;
116 case CP2615_INVALID_PARAM:
117 return -EINVAL;
118 case CP2615_CFG_LOCKED:
119 return -EPERM;
120 }
121 /* Unknown error code */
122 return -EPROTO;
123 }
124
125
126 static int
127 cp2615_i2c_send(struct usb_interface *usbif, struct cp2615_i2c_transfer *i2c_w)
128 {
129 struct cp2615_iop_msg *msg = kzalloc(sizeof(struct cp2615_iop_msg), GFP_KERNEL);
130 struct usb_device *usbdev = interface_to_usbdev(usbif);
131 int res = cp2615_init_i2c_msg(msg, i2c_w);
132 if (!res)
133 res = usb_bulk_msg(usbdev, usb_sndbulkpipe(usbdev, IOP_EP_OUT), msg, ntohs(msg->length), NULL, 0);
134 kfree(msg);
135 return res;
136 }
137
138 static int
139 cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf)
140 {
141 struct cp2615_iop_msg *msg = kzalloc(sizeof(struct cp2615_iop_msg), GFP_KERNEL);
142 struct cp2615_i2c_transfer_result *i2c_r = (struct cp2615_i2c_transfer_result*) &msg->data;
143 struct usb_device *usbdev = interface_to_usbdev(usbif);
144 int res = usb_bulk_msg(usbdev, usb_rcvbulkpipe(usbdev, IOP_EP_IN), msg, sizeof(struct cp2615_iop_msg), NULL, 0);
145 if (res < 0)
146 return res;
147
148 if (msg->msg != htons(iop_I2cTransferResult) || i2c_r->tag != tag)
149 return -EIO;
150
151 res = cp2615_check_status(i2c_r->status);
152 if (res < 0)
153 return res;
154
155 memcpy(buf, &i2c_r->data, i2c_r->read_len);
156 kfree(msg);
157 return 0;
158 }
159
160 static int
161 cp2615_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
162 {
163 struct usb_interface *usbif = adap->algo_data;
164 int i = 0, ret = 0;
165 struct i2c_msg *msg;
166 struct cp2615_i2c_transfer i2c_w = {0};
167 dev_dbg(&usbif->dev, "Doing %d I2C transactions\n", num);
168
169 for(; !ret && i < num; i++) {
170 msg = &msgs[i];
171
172 i2c_w.tag = 0xdd;
173 i2c_w.i2caddr = i2c_8bit_addr_from_msg(msg);
174 if (msg->flags & I2C_M_RD) {
175 i2c_w.read_len = msg->len;
176 i2c_w.write_len = 0;
177 } else {
178 i2c_w.read_len = 0;
179 i2c_w.write_len = msg->len;
180 memcpy(&i2c_w.data, msg->buf, i2c_w.write_len);
181 }
182 ret = cp2615_i2c_send(usbif, &i2c_w);
183 if (ret)
184 break;
185 ret = cp2615_i2c_recv(usbif, i2c_w.tag, msg->buf);
186 }
187 if (ret < 0)
188 return ret;
189 return i;
190 }
191
192 static u32
193 cp2615_i2c_func(struct i2c_adapter *adap)
194 {
195 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
196 }
197
198 static const struct i2c_algorithm cp2615_i2c_algo = {
199 .master_xfer = cp2615_i2c_master_xfer,
200 .functionality = cp2615_i2c_func,
201 };
202
203 /*
204 * This chip has some limitations: one is that the USB endpoint
205 * can only receive 64 bytes/transfer, that leaves 54 bytes for
206 * the I2C transfer. On top of that, EITHER read_len OR write_len
207 * may be zero, but not both. If both are non-zero, the adapter
208 * issues a write followed by a read. And the chip does not
209 * support repeated START between the write and read phases.
210 *
211 * FIXME: There in no quirk flag for specifying that the adapter
212 * does not support empty transfers, or that it cannot emit a
213 * START condition between the combined phases.
214 */
215 struct i2c_adapter_quirks cp2615_i2c_quirks = {
216 .max_write_len = MAX_I2C_SIZE,
217 .max_read_len = MAX_I2C_SIZE,
218 .flags = I2C_AQ_COMB_WRITE_THEN_READ,
219 .max_comb_1st_msg_len = MAX_I2C_SIZE,
220 .max_comb_2nd_msg_len = MAX_I2C_SIZE
221 };
222
223 static void
224 cp2615_i2c_remove(struct usb_interface *usbif)
225 {
226 struct i2c_adapter *adap = usb_get_intfdata(usbif);
227
228 usb_set_intfdata(usbif, NULL);
229 i2c_del_adapter(adap);
230 }
231
232 static int
233 cp2615_i2c_probe(struct usb_interface *usbif, const struct usb_device_id *id)
234 {
235 int ret = 0;
236 struct i2c_adapter *adap;
237 struct usb_device *usbdev = interface_to_usbdev(usbif);
238
239 ret = usb_set_interface(usbdev, IOP_IFN, IOP_ALTSETTING);
240 if (ret)
241 return ret;
242
243 adap = devm_kzalloc(&usbif->dev, sizeof(struct i2c_adapter), GFP_KERNEL);
244 if (!adap)
245 return -ENOMEM;
246
247 strncpy(adap->name, usbdev->serial, sizeof(adap->name));
248 adap->owner = THIS_MODULE;
249 adap->dev.parent = &usbif->dev;
250 adap->dev.of_node = usbif->dev.of_node;
251 adap->timeout = HZ;
252 adap->algo = &cp2615_i2c_algo;
253 adap->quirks = &cp2615_i2c_quirks;
254 adap->algo_data = usbif;
255
256 ret = i2c_add_adapter(adap);
257 if (ret)
258 return ret;
259
260 usb_set_intfdata(usbif, adap);
261 return ret;
262 }
263
264 static const struct usb_device_id id_table[] = {
265 { USB_DEVICE(CP2615_VID, CP2615_PID) },
266 { }
267 };
268
> 269 MODULE_DEVICE_TABLE(usb, id_table);
270
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[intel-linux-intel-lts:4.19/android 16527/19720] drivers/cpufreq/cpufreq_times.c:354:5: warning: no previous prototype for 'cpufreq_table_get_closed_index'
by kernel test robot
Hi Junxiao,
FYI, the error/warning still remains.
tree: https://github.com/intel/linux-intel-lts.git 4.19/android
head: 918b1786ca6f6f34c11a6038a2c2be6d54e1455e
commit: 045c4cc9854e44be23f27501c397c8d1783a0708 [16527/19720] cpufreq statistics: support cpufreq driver without freq table
config: arm-randconfig-r014-20210317 (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://github.com/intel/linux-intel-lts/commit/045c4cc9854e44be23f27501c...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android
git checkout 045c4cc9854e44be23f27501c397c8d1783a0708
# 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/cpufreq/cpufreq_times.c:354:5: warning: no previous prototype for 'cpufreq_table_get_closed_index' [-Wmissing-prototypes]
354 | int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/cpufreq/cpufreq_times.c:367:6: warning: no previous prototype for 'cpufreq_times_create_policy_no_freq_table' [-Wmissing-prototypes]
367 | void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/cpufreq/cpufreq_times.c:511:37: warning: 'uid_time_in_state_fops' defined but not used [-Wunused-const-variable=]
511 | static const struct file_operations uid_time_in_state_fops = {
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/cpufreq_table_get_closed_index +354 drivers/cpufreq/cpufreq_times.c
350
351 #define CPU_FREQ_STEPS 100000
352 // Suppose all cores have same freq count
353 static int all_freq_count;
> 354 int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
355 {
356 int i;
357 unsigned int rounded_freq;
358
359 rounded_freq = freq + CPU_FREQ_STEPS / 2;
360 for (i = 0; i < all_freq_count; i++) {
361 if ((rounded_freq - all_freqs[cpu]->freq_table[i]) / CPU_FREQ_STEPS == 0)
362 return i;
363 }
364 return -1;
365 }
366
> 367 void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
368 {
369 int cpu, index, i;
370 unsigned int count = 0;
371 struct cpu_freqs *freqs;
372 void *tmp;
373
374 if (all_freqs[policy->cpu])
375 return;
376
377 count = (policy->max - policy->min) / CPU_FREQ_STEPS + 1;
378 if ((policy->max - policy->min) % CPU_FREQ_STEPS)
379 count++;
380
381 if (count > 100)
382 return;
383
384 tmp = kzalloc(sizeof(*freqs) + sizeof(freqs->freq_table[0]) * count,
385 GFP_KERNEL);
386 if (!tmp)
387 return;
388
389 freqs = tmp;
390 freqs->max_state = count;
391 all_freq_count = count;
392
393 freqs->freq_table[0] = policy->min;
394 freqs->freq_table[count - 1] = policy->max;
395 for (i = 1; i < count - 1; i++)
396 freqs->freq_table[i] = policy->min + i * CPU_FREQ_STEPS;
397 freqs->offset = next_offset;
398 WRITE_ONCE(next_offset, freqs->offset + count);
399 for_each_cpu(cpu, policy->related_cpus)
400 all_freqs[cpu] = freqs;
401
402 index = cpufreq_table_get_closed_index(policy->cpu, policy->cur);
403 if (index >= 0)
404 WRITE_ONCE(freqs->last_index, index);
405 }
406
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[hch-misc:remove-ide 1/11] block/blk-mq-debugfs.c:293:44: error: 'RQF_ALLOCED' undeclared here (not in a function)
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git remove-ide
head: 0c48559a863f1782d3ee2d77adf3a7740b43f39f
commit: 10455e3e7e8a75cef5bac97611bf82a0a116a85e [1/11] block: remove RQF_ALLOCED
config: m68k-randconfig-r031-20210317 (attached as .config)
compiler: m68k-linux-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
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc remove-ide
git checkout 10455e3e7e8a75cef5bac97611bf82a0a116a85e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:12,
from block/blk-mq-debugfs.c:6:
>> block/blk-mq-debugfs.c:293:44: error: 'RQF_ALLOCED' undeclared here (not in a function)
293 | #define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
| ^~~~
include/linux/log2.h:158:23: note: in definition of macro 'ilog2'
158 | __builtin_constant_p(n) ? \
| ^
block/blk-mq-debugfs.c:305:2: note: in expansion of macro 'RQF_NAME'
305 | RQF_NAME(ALLOCED),
| ^~~~~~~~
>> include/linux/log2.h:157:1: error: array index in initializer not of integer type
157 | ( \
| ^
block/blk-mq-debugfs.c:293:25: note: in expansion of macro 'ilog2'
293 | #define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
| ^~~~~
block/blk-mq-debugfs.c:305:2: note: in expansion of macro 'RQF_NAME'
305 | RQF_NAME(ALLOCED),
| ^~~~~~~~
include/linux/log2.h:157:1: note: (near initialization for 'rqf_name')
157 | ( \
| ^
block/blk-mq-debugfs.c:293:25: note: in expansion of macro 'ilog2'
293 | #define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
| ^~~~~
block/blk-mq-debugfs.c:305:2: note: in expansion of macro 'RQF_NAME'
305 | RQF_NAME(ALLOCED),
| ^~~~~~~~
vim +/RQF_ALLOCED +293 block/blk-mq-debugfs.c
8658dca8bd5666 Bart Van Assche 2017-04-26 292
1a435111f8eb30 Omar Sandoval 2017-05-04 @293 #define RQF_NAME(name) [ilog2((__force u32)RQF_##name)] = #name
8658dca8bd5666 Bart Van Assche 2017-04-26 294 static const char *const rqf_name[] = {
85ba3effc5a083 Jens Axboe 2018-01-12 295 RQF_NAME(STARTED),
1a435111f8eb30 Omar Sandoval 2017-05-04 296 RQF_NAME(SOFTBARRIER),
1a435111f8eb30 Omar Sandoval 2017-05-04 297 RQF_NAME(FLUSH_SEQ),
1a435111f8eb30 Omar Sandoval 2017-05-04 298 RQF_NAME(MIXED_MERGE),
1a435111f8eb30 Omar Sandoval 2017-05-04 299 RQF_NAME(MQ_INFLIGHT),
1a435111f8eb30 Omar Sandoval 2017-05-04 300 RQF_NAME(DONTPREP),
1a435111f8eb30 Omar Sandoval 2017-05-04 301 RQF_NAME(FAILED),
1a435111f8eb30 Omar Sandoval 2017-05-04 302 RQF_NAME(QUIET),
1a435111f8eb30 Omar Sandoval 2017-05-04 303 RQF_NAME(ELVPRIV),
1a435111f8eb30 Omar Sandoval 2017-05-04 304 RQF_NAME(IO_STAT),
1a435111f8eb30 Omar Sandoval 2017-05-04 305 RQF_NAME(ALLOCED),
1a435111f8eb30 Omar Sandoval 2017-05-04 306 RQF_NAME(PM),
1a435111f8eb30 Omar Sandoval 2017-05-04 307 RQF_NAME(HASHED),
1a435111f8eb30 Omar Sandoval 2017-05-04 308 RQF_NAME(STATS),
1a435111f8eb30 Omar Sandoval 2017-05-04 309 RQF_NAME(SPECIAL_PAYLOAD),
5d75d3f2e736d6 Jens Axboe 2018-01-10 310 RQF_NAME(ZONE_WRITE_LOCKED),
76a86f9d027b34 Jens Axboe 2018-01-10 311 RQF_NAME(MQ_POLL_SLEPT),
8658dca8bd5666 Bart Van Assche 2017-04-26 312 };
1a435111f8eb30 Omar Sandoval 2017-05-04 313 #undef RQF_NAME
8658dca8bd5666 Bart Van Assche 2017-04-26 314
:::::: The code at line 293 was first introduced by commit
:::::: 1a435111f8eb30b370e3891caebb1d1ca61f41ec blk-mq-debugfs: clean up flag definitions
:::::: TO: Omar Sandoval <osandov(a)fb.com>
:::::: CC: Jens Axboe <axboe(a)fb.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months