[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202209031108.Eko3xQp8-lkp@intel.com>
Date: Sat, 3 Sep 2022 11:18:12 +0800
From: kernel test robot <lkp@...el.com>
To: Abel Vesa <abel.vesa@...aro.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Amol Maheshwari <amahesh@....qualcomm.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Ekansh Gupta <quic_ekagupt@...cinc.com>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-arm-msm@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
devicetree@...r.kernel.org
Subject: Re: [PATCH v2 07/10] misc: fastrpc: Add support for audiopd
Hi Abel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on robh/for-next linus/master v6.0-rc3 next-20220901]
[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/Abel-Vesa/misc-fastrpc-Add-audiopd-support/20220902-235842
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 4ec7ac90ff399b7d9af81cc8afd430a22786c61b
config: s390-randconfig-r033-20220902
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c55b41d5199d2394dd6cdb8f52180d8b81d809d4)
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/intel-lab-lkp/linux/commit/7036272dbe486564afd86e31ca0abf48aa1535ed
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Abel-Vesa/misc-fastrpc-Add-audiopd-support/20220902-235842
git checkout 7036272dbe486564afd86e31ca0abf48aa1535ed
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/misc/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
In file included from drivers/misc/fastrpc.c:7:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/iosys-map.h:10:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from drivers/misc/fastrpc.c:7:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/iosys-map.h:10:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:573: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:35:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from drivers/misc/fastrpc.c:7:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/iosys-map.h:10:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:584: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:594: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:604: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:692: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:700: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:708: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:717: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:726: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:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/misc/fastrpc.c:1251:12: warning: format specifies type 'unsigned int' but the argument has type 'struct qcom_scm_vmperm *' [-Wformat]
perms, fl->cctx->vmperms, fl->cctx->vmcount);
^~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg'
dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
_dev_printk(level, dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
13 warnings generated.
vim +1251 drivers/misc/fastrpc.c
1198
1199 static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
1200 char __user *argp)
1201 {
1202 struct fastrpc_init_create_static init;
1203 struct fastrpc_invoke_args *args;
1204 struct fastrpc_phy_page pages[1];
1205 char *name;
1206 int err;
1207 struct {
1208 int pgid;
1209 u32 namelen;
1210 u32 pageslen;
1211 } inbuf;
1212 u32 sc;
1213
1214 args = kcalloc(FASTRPC_CREATE_STATIC_PROCESS_NARGS, sizeof(*args), GFP_KERNEL);
1215 if (!args)
1216 return -ENOMEM;
1217
1218 if (copy_from_user(&init, argp, sizeof(init))) {
1219 err = -EFAULT;
1220 goto err;
1221 }
1222
1223 if (init.namelen > INIT_FILE_NAMELEN_MAX) {
1224 err = -EINVAL;
1225 goto err;
1226 }
1227
1228 name = kzalloc(init.namelen, GFP_KERNEL);
1229 if (!name) {
1230 err = -ENOMEM;
1231 goto err;
1232 }
1233
1234 if (copy_from_user(name, (void __user *)(uintptr_t)init.name, init.namelen)) {
1235 err = -EFAULT;
1236 goto err_name;
1237 }
1238
1239 if (!fl->cctx->remote_heap) {
1240 err = fastrpc_remote_heap_alloc(fl, fl->sctx->dev, init.memlen,
1241 &fl->cctx->remote_heap);
1242 if (err)
1243 goto err_name;
1244
1245 /* Map if we have any heap VMIDs associated with this ADSP Static Process. */
1246 if (fl->cctx->vmcount) {
1247 unsigned int perms = BIT(QCOM_SCM_VMID_HLOS);
1248
1249 dev_dbg(fl->sctx->dev, "Assinging memory with phys 0x%llx size 0x%llx perms 0x%x, vmperms %x, vmcount %x\n",
1250 fl->cctx->remote_heap->phys, fl->cctx->remote_heap->size,
> 1251 perms, fl->cctx->vmperms, fl->cctx->vmcount);
1252 err = qcom_scm_assign_mem(fl->cctx->remote_heap->phys,
1253 (u64)fl->cctx->remote_heap->size, &perms,
1254 fl->cctx->vmperms, fl->cctx->vmcount);
1255 if (err) {
1256 dev_err(fl->sctx->dev, "Failed to assign memory with phys 0x%llx size 0x%llx err %d",
1257 fl->cctx->remote_heap->phys, fl->cctx->remote_heap->size, err);
1258 goto err_map;
1259 }
1260 }
1261 }
1262
1263 inbuf.pgid = fl->tgid;
1264 inbuf.namelen = init.namelen;
1265 inbuf.pageslen = 0;
1266 fl->pd = USER_PD;
1267
1268 args[0].ptr = (u64)(uintptr_t)&inbuf;
1269 args[0].length = sizeof(inbuf);
1270 args[0].fd = -1;
1271
1272 args[1].ptr = (u64)(uintptr_t)name;
1273 args[1].length = inbuf.namelen;
1274 args[1].fd = -1;
1275
1276 pages[0].addr = fl->cctx->remote_heap->phys;
1277 pages[0].size = fl->cctx->remote_heap->size;
1278
1279 args[2].ptr = (u64)(uintptr_t) pages;
1280 args[2].length = sizeof(*pages);
1281 args[2].fd = -1;
1282
1283 sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_CREATE_STATIC, 3, 0);
1284
1285 err = fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE,
1286 sc, args);
1287 if (err)
1288 goto err_invoke;
1289
1290 kfree(args);
1291
1292 return 0;
1293 err_invoke:
1294 err_map:
1295 fastrpc_buf_free(fl->cctx->remote_heap);
1296 err_name:
1297 kfree(name);
1298 err:
1299 kfree(args);
1300
1301 return err;
1302 }
1303
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (127511 bytes)
Powered by blists - more mailing lists