drivers/usb/cdns3/drd.c:332:17: sparse: sparse: too many warnings
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce
commit: 70d8b9e5e63d212019ba3f6823c8ec3d2df87645 usb: cdns3: make signed 1 bit bitfields unsigned
date: 8 weeks ago
config: arc-randconfig-s001-20200518 (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout 70d8b9e5e63d212019ba3f6823c8ec3d2df87645
# save the attached .config to linux build tree
make C=1 ARCH=arc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/usb/cdns3/drd.c:182:23: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:182:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:182:23: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:182:23: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:195:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:195:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:195:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:199:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:199:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:199:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:219:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:219:9: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:219:9: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:284:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:284:15: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:284:15: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:303:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:303:9: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:303:9: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:326:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_legacy_regs *otg_v0_regs @@ got void struct cdns3_otg_legacy_regs *otg_v0_regs @@
drivers/usb/cdns3/drd.c:326:27: sparse: expected struct cdns3_otg_legacy_regs *otg_v0_regs
drivers/usb/cdns3/drd.c:326:27: sparse: got void [noderef] <asn:2> *[assigned] regs
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:327:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:327:14: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:327:14: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:330:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_common_regs *otg_regs @@ got void struct cdns3_otg_common_regs *otg_regs @@
drivers/usb/cdns3/drd.c:330:32: sparse: expected struct cdns3_otg_common_regs *otg_regs
drivers/usb/cdns3/drd.c:330:32: sparse: got void [noderef] <asn:2> *[assigned] regs
drivers/usb/cdns3/drd.c:331:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:331:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:331:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:332:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:332:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:332:17: sparse: got restricted __le32 *
drivers/usb/cdns3/drd.c:332:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got [noderef] <asn:2> *addr @@
drivers/usb/cdns3/drd.c:332:17: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/usb/cdns3/drd.c:332:17: sparse: got restricted __le32 *
>> drivers/usb/cdns3/drd.c:332:17: sparse: sparse: too many warnings
vim +332 drivers/usb/cdns3/drd.c
7733f6c32e36ff Pawel Laszczak 2019-08-26 306
7733f6c32e36ff Pawel Laszczak 2019-08-26 307 int cdns3_drd_init(struct cdns3 *cdns)
7733f6c32e36ff Pawel Laszczak 2019-08-26 308 {
7733f6c32e36ff Pawel Laszczak 2019-08-26 309 void __iomem *regs;
7733f6c32e36ff Pawel Laszczak 2019-08-26 310 int ret = 0;
7733f6c32e36ff Pawel Laszczak 2019-08-26 311 u32 state;
7733f6c32e36ff Pawel Laszczak 2019-08-26 312
7733f6c32e36ff Pawel Laszczak 2019-08-26 313 regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res);
7733f6c32e36ff Pawel Laszczak 2019-08-26 314 if (IS_ERR(regs))
7733f6c32e36ff Pawel Laszczak 2019-08-26 315 return PTR_ERR(regs);
7733f6c32e36ff Pawel Laszczak 2019-08-26 316
7733f6c32e36ff Pawel Laszczak 2019-08-26 317 /* Detection of DRD version. Controller has been released
7733f6c32e36ff Pawel Laszczak 2019-08-26 318 * in two versions. Both are similar, but they have same changes
7733f6c32e36ff Pawel Laszczak 2019-08-26 319 * in register maps.
7733f6c32e36ff Pawel Laszczak 2019-08-26 320 * The first register in old version is command register and it's read
7733f6c32e36ff Pawel Laszczak 2019-08-26 321 * only, so driver should read 0 from it. On the other hand, in v1
7733f6c32e36ff Pawel Laszczak 2019-08-26 322 * the first register contains device ID number which is not set to 0.
7733f6c32e36ff Pawel Laszczak 2019-08-26 323 * Driver uses this fact to detect the proper version of
7733f6c32e36ff Pawel Laszczak 2019-08-26 324 * controller.
7733f6c32e36ff Pawel Laszczak 2019-08-26 325 */
7733f6c32e36ff Pawel Laszczak 2019-08-26 326 cdns->otg_v0_regs = regs;
7733f6c32e36ff Pawel Laszczak 2019-08-26 327 if (!readl(&cdns->otg_v0_regs->cmd)) {
7733f6c32e36ff Pawel Laszczak 2019-08-26 328 cdns->version = CDNS3_CONTROLLER_V0;
7733f6c32e36ff Pawel Laszczak 2019-08-26 329 cdns->otg_v1_regs = NULL;
7733f6c32e36ff Pawel Laszczak 2019-08-26 330 cdns->otg_regs = regs;
7733f6c32e36ff Pawel Laszczak 2019-08-26 331 writel(1, &cdns->otg_v0_regs->simulate);
7733f6c32e36ff Pawel Laszczak 2019-08-26 @332 dev_info(cdns->dev, "DRD version v0 (%08x)\n",
7733f6c32e36ff Pawel Laszczak 2019-08-26 333 readl(&cdns->otg_v0_regs->version));
7733f6c32e36ff Pawel Laszczak 2019-08-26 334 } else {
7733f6c32e36ff Pawel Laszczak 2019-08-26 335 cdns->otg_v0_regs = NULL;
7733f6c32e36ff Pawel Laszczak 2019-08-26 336 cdns->otg_v1_regs = regs;
7733f6c32e36ff Pawel Laszczak 2019-08-26 337 cdns->otg_regs = (void *)&cdns->otg_v1_regs->cmd;
7733f6c32e36ff Pawel Laszczak 2019-08-26 338 cdns->version = CDNS3_CONTROLLER_V1;
7733f6c32e36ff Pawel Laszczak 2019-08-26 339 writel(1, &cdns->otg_v1_regs->simulate);
7733f6c32e36ff Pawel Laszczak 2019-08-26 340 dev_info(cdns->dev, "DRD version v1 (ID: %08x, rev: %08x)\n",
7733f6c32e36ff Pawel Laszczak 2019-08-26 341 readl(&cdns->otg_v1_regs->did),
7733f6c32e36ff Pawel Laszczak 2019-08-26 342 readl(&cdns->otg_v1_regs->rid));
7733f6c32e36ff Pawel Laszczak 2019-08-26 343 }
7733f6c32e36ff Pawel Laszczak 2019-08-26 344
7733f6c32e36ff Pawel Laszczak 2019-08-26 345 state = OTGSTS_STRAP(readl(&cdns->otg_regs->sts));
7733f6c32e36ff Pawel Laszczak 2019-08-26 346
7733f6c32e36ff Pawel Laszczak 2019-08-26 347 /* Update dr_mode according to STRAP configuration. */
7733f6c32e36ff Pawel Laszczak 2019-08-26 348 cdns->dr_mode = USB_DR_MODE_OTG;
7733f6c32e36ff Pawel Laszczak 2019-08-26 349 if (state == OTGSTS_STRAP_HOST) {
7733f6c32e36ff Pawel Laszczak 2019-08-26 350 dev_dbg(cdns->dev, "Controller strapped to HOST\n");
7733f6c32e36ff Pawel Laszczak 2019-08-26 351 cdns->dr_mode = USB_DR_MODE_HOST;
7733f6c32e36ff Pawel Laszczak 2019-08-26 352 } else if (state == OTGSTS_STRAP_GADGET) {
7733f6c32e36ff Pawel Laszczak 2019-08-26 353 dev_dbg(cdns->dev, "Controller strapped to PERIPHERAL\n");
7733f6c32e36ff Pawel Laszczak 2019-08-26 354 cdns->dr_mode = USB_DR_MODE_PERIPHERAL;
7733f6c32e36ff Pawel Laszczak 2019-08-26 355 }
7733f6c32e36ff Pawel Laszczak 2019-08-26 356
7733f6c32e36ff Pawel Laszczak 2019-08-26 357 ret = devm_request_threaded_irq(cdns->dev, cdns->otg_irq,
7733f6c32e36ff Pawel Laszczak 2019-08-26 358 cdns3_drd_irq,
7733f6c32e36ff Pawel Laszczak 2019-08-26 359 cdns3_drd_thread_irq,
7733f6c32e36ff Pawel Laszczak 2019-08-26 360 IRQF_SHARED,
7733f6c32e36ff Pawel Laszczak 2019-08-26 361 dev_name(cdns->dev), cdns);
7733f6c32e36ff Pawel Laszczak 2019-08-26 362
7733f6c32e36ff Pawel Laszczak 2019-08-26 363 if (ret) {
7733f6c32e36ff Pawel Laszczak 2019-08-26 364 dev_err(cdns->dev, "couldn't get otg_irq\n");
7733f6c32e36ff Pawel Laszczak 2019-08-26 365 return ret;
7733f6c32e36ff Pawel Laszczak 2019-08-26 366 }
7733f6c32e36ff Pawel Laszczak 2019-08-26 367
7733f6c32e36ff Pawel Laszczak 2019-08-26 368 state = readl(&cdns->otg_regs->sts);
7733f6c32e36ff Pawel Laszczak 2019-08-26 369 if (OTGSTS_OTG_NRDY(state) != 0) {
7733f6c32e36ff Pawel Laszczak 2019-08-26 370 dev_err(cdns->dev, "Cadence USB3 OTG device not ready\n");
7733f6c32e36ff Pawel Laszczak 2019-08-26 371 return -ENODEV;
7733f6c32e36ff Pawel Laszczak 2019-08-26 372 }
7733f6c32e36ff Pawel Laszczak 2019-08-26 373
7733f6c32e36ff Pawel Laszczak 2019-08-26 374 return ret;
7733f6c32e36ff Pawel Laszczak 2019-08-26 375 }
7733f6c32e36ff Pawel Laszczak 2019-08-26 376
:::::: The code at line 332 was first introduced by commit
:::::: 7733f6c32e36ff9d7adadf40001039bf219b1cbe usb: cdns3: Add Cadence USB3 DRD Driver
:::::: TO: Pawel Laszczak <pawell(a)cadence.com>
:::::: CC: Felipe Balbi <felipe.balbi(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[sashal-linux-stable:queue-4.14 70/79] Warning: ffffffff819d7582: 0f ff 48 8d ud0 -0x73(%rax),%ecx
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.14
head: 7a7ddea1b419e20931152e388252c661b6fca95c
commit: cd2ac280c3cfcb76e71439deb9928a10e029f1dc [70/79] pnp: Use list_for_each_entry() instead of open coding
config: x86_64-randconfig-a013-20200517 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout cd2ac280c3cfcb76e71439deb9928a10e029f1dc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> Warning: ffffffff819d7582: 0f ff 48 8d ud0 -0x73(%rax),%ecx
Warning: objdump says 4 bytes, but insn_get_length() says 2
Warning: arch/x86/tools/test_get_len found difference at <memcpy_page_flushcache>:ffffffff819d6b20
--
>> Warning: ffffffff819d79ab: 0f ff 48 8d ud0 -0x73(%rax),%ecx
Warning: objdump says 4 bytes, but insn_get_length() says 2
Warning: arch/x86/tools/test_get_len found difference at <memcpy_page_flushcache>:ffffffff819d6b20
--
>> Warning: ffffffff819d85ac: 0f ff 49 8d ud0 -0x73(%rcx),%ecx
Warning: objdump says 4 bytes, but insn_get_length() says 2
Warning: arch/x86/tools/test_get_len found difference at <memcpy_page_flushcache>:ffffffff819d6b20
--
>> Warning: ffffffff819d7111: 0f ff 48 8d ud0 -0x73(%rax),%ecx
Warning: objdump says 4 bytes, but insn_get_length() says 2
Warning: arch/x86/tools/test_get_len found difference at <memcpy_page_flushcache>:ffffffff819d6b20
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-sof-driver:pr/2088 2/10] drivers/soundwire/qcom.c:792:35: error: passing argument 1 of 'sdw_master_device_add' from incompatible pointer type
by kbuild test robot
tree: https://github.com/thesofproject/linux pr/2088
head: 46485377528ea8f4848509ce24481fa0ff22d285
commit: f64b7f7b8f06956ed2dcd5c617b6c71f5b117c07 [2/10] soundwire: use a single API to add/delete master device
config: arm64-sof-customedconfig-nobloat-imx-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f64b7f7b8f06956ed2dcd5c617b6c71f5b117c07
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/soundwire/qcom.c: In function 'qcom_swrm_probe':
>> drivers/soundwire/qcom.c:792:35: error: passing argument 1 of 'sdw_master_device_add' from incompatible pointer type [-Werror=incompatible-pointer-types]
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^~~
| |
| struct device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:43: note: expected 'struct sdw_bus *' but argument is of type 'struct device *'
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ~~~~~~~~~~~~~~~~^~~
drivers/soundwire/qcom.c:793:10: error: passing argument 2 of 'sdw_master_device_add' from incompatible pointer type [-Werror=incompatible-pointer-types]
793 | dev->fwnode,
| ~~~^~~~~~~~
| |
| struct fwnode_handle *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:63: note: expected 'struct device *' but argument is of type 'struct fwnode_handle *'
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ~~~~~~~~~~~~~~~^~~~~~
>> drivers/soundwire/qcom.c:792:13: error: too many arguments to function 'sdw_master_device_add'
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:22:5: note: declared here
22 | int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/soundwire/qcom.c:792:11: warning: assignment to 'struct sdw_master_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
792 | ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
| ^
>> drivers/soundwire/qcom.c:864:34: error: passing argument 1 of 'sdw_master_device_del' from incompatible pointer type [-Werror=incompatible-pointer-types]
864 | err = sdw_master_device_del(ctrl->md);
| ~~~~^~~~
| |
| struct sdw_master_device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:24:43: note: expected 'struct sdw_bus *' but argument is of type 'struct sdw_master_device *'
24 | int sdw_master_device_del(struct sdw_bus *bus);
| ~~~~~~~~~~~~~~~~^~~
drivers/soundwire/qcom.c: In function 'qcom_swrm_remove':
drivers/soundwire/qcom.c:878:2: error: implicit declaration of function 'sdw_delete_bus_master' [-Werror=implicit-function-declaration]
878 | sdw_delete_bus_master(&ctrl->bus);
| ^~~~~~~~~~~~~~~~~~~~~
drivers/soundwire/qcom.c:879:34: error: passing argument 1 of 'sdw_master_device_del' from incompatible pointer type [-Werror=incompatible-pointer-types]
879 | err = sdw_master_device_del(ctrl->md);
| ~~~~^~~~
| |
| struct sdw_master_device *
In file included from drivers/soundwire/qcom.c:20:
drivers/soundwire/bus.h:24:43: note: expected 'struct sdw_bus *' but argument is of type 'struct sdw_master_device *'
24 | int sdw_master_device_del(struct sdw_bus *bus);
| ~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/sdw_master_device_add +792 drivers/soundwire/qcom.c
02efb49aa805cee Srinivas Kandagatla 2020-01-13 743
02efb49aa805cee Srinivas Kandagatla 2020-01-13 744 static int qcom_swrm_probe(struct platform_device *pdev)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 745 {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 746 struct device *dev = &pdev->dev;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 747 struct sdw_master_prop *prop;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 748 struct sdw_bus_params *params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 749 struct qcom_swrm_ctrl *ctrl;
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 750 int ret, err;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 751 u32 val;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 752
02efb49aa805cee Srinivas Kandagatla 2020-01-13 753 ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 754 if (!ctrl)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 755 return -ENOMEM;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 756
02efb49aa805cee Srinivas Kandagatla 2020-01-13 757 if (dev->parent->bus == &slimbus_bus) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 758 ctrl->reg_read = qcom_swrm_abh_reg_read;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 759 ctrl->reg_write = qcom_swrm_ahb_reg_write;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 760 ctrl->regmap = dev_get_regmap(dev->parent, NULL);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 761 if (!ctrl->regmap)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 762 return -EINVAL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 763 } else {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 764 /* Only WCD based SoundWire controller is supported */
02efb49aa805cee Srinivas Kandagatla 2020-01-13 765 return -ENOTSUPP;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 766 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 767
02efb49aa805cee Srinivas Kandagatla 2020-01-13 768 ctrl->irq = of_irq_get(dev->of_node, 0);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 769 if (ctrl->irq < 0) {
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 770 ret = ctrl->irq;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 771 goto err_init;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 772 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 773
02efb49aa805cee Srinivas Kandagatla 2020-01-13 774 ctrl->hclk = devm_clk_get(dev, "iface");
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 775 if (IS_ERR(ctrl->hclk)) {
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 776 ret = PTR_ERR(ctrl->hclk);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 777 goto err_init;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 778 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 779
02efb49aa805cee Srinivas Kandagatla 2020-01-13 780 clk_prepare_enable(ctrl->hclk);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 781
02efb49aa805cee Srinivas Kandagatla 2020-01-13 782 ctrl->dev = dev;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 783 dev_set_drvdata(&pdev->dev, ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 784 spin_lock_init(&ctrl->comp_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 785 mutex_init(&ctrl->port_lock);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 786 INIT_WORK(&ctrl->slave_work, qcom_swrm_slave_wq);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 787
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 788 /*
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 789 * add sdw_master_device.
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 790 * For the Qualcomm implementation there is no driver.
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 791 */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 @792 ctrl->md = sdw_master_device_add(dev, /* platform device is parent */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 793 dev->fwnode,
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 794 NULL, /* no link ops */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 795 0, /* only one link supported */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 796 NULL); /* no context */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 797 if (IS_ERR(ctrl->md)) {
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 798 dev_err(dev, "Could not create sdw_master_device\n");
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 799 ret = PTR_ERR(ctrl->md);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 800 goto err_clk;
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 801 }
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 802
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 803 /* add bus handle */
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 804 ctrl->md->bus = &ctrl->bus;
3a4d863b21f4e30 Pierre-Louis Bossart 2020-04-09 805
02efb49aa805cee Srinivas Kandagatla 2020-01-13 806 ctrl->bus.ops = &qcom_swrm_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 807 ctrl->bus.port_ops = &qcom_swrm_port_ops;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 808 ctrl->bus.compute_params = &qcom_swrm_compute_params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 809
02efb49aa805cee Srinivas Kandagatla 2020-01-13 810 ret = qcom_swrm_get_port_config(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 811 if (ret)
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 812 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 813
02efb49aa805cee Srinivas Kandagatla 2020-01-13 814 params = &ctrl->bus.params;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 815 params->max_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 816 params->curr_dr_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 817 params->col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 818 params->row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 819 ctrl->reg_read(ctrl, SWRM_MCP_STATUS, &val);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 820 params->curr_bank = val & SWRM_MCP_STATUS_BANK_NUM_MASK;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 821 params->next_bank = !params->curr_bank;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 822
02efb49aa805cee Srinivas Kandagatla 2020-01-13 823 prop = &ctrl->bus.prop;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 824 prop->max_clk_freq = DEFAULT_CLK_FREQ;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 825 prop->num_clk_gears = 0;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 826 prop->num_clk_freq = MAX_FREQ_NUM;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 827 prop->clk_freq = &qcom_swrm_freq_tbl[0];
02efb49aa805cee Srinivas Kandagatla 2020-01-13 828 prop->default_col = SWRM_DEFAULT_COL;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 829 prop->default_row = SWRM_DEFAULT_ROWS;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 830
02efb49aa805cee Srinivas Kandagatla 2020-01-13 831 ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &ctrl->version);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 832
02efb49aa805cee Srinivas Kandagatla 2020-01-13 833 ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 834 qcom_swrm_irq_handler,
4f1738f4c24b448 Samuel Zou 2020-05-06 835 IRQF_TRIGGER_RISING |
4f1738f4c24b448 Samuel Zou 2020-05-06 836 IRQF_ONESHOT,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 837 "soundwire", ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 838 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 839 dev_err(dev, "Failed to request soundwire irq\n");
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 840 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 841 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 842
3694409e4558025 Pierre-Louis Bossart 2020-04-24 843 ret = sdw_bus_master_add(&ctrl->bus);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 844 if (ret) {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 845 dev_err(dev, "Failed to register Soundwire controller (%d)\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 846 ret);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 847 goto err_md;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 848 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 849
02efb49aa805cee Srinivas Kandagatla 2020-01-13 850 qcom_swrm_init(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 851 ret = qcom_swrm_register_dais(ctrl);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 852 if (ret)
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 853 goto err_master_add;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 854
02efb49aa805cee Srinivas Kandagatla 2020-01-13 855 dev_info(dev, "Qualcomm Soundwire controller v%x.%x.%x Registered\n",
02efb49aa805cee Srinivas Kandagatla 2020-01-13 856 (ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
02efb49aa805cee Srinivas Kandagatla 2020-01-13 857 ctrl->version & 0xffff);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 858
02efb49aa805cee Srinivas Kandagatla 2020-01-13 859 return 0;
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 860
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 861 err_master_add:
3694409e4558025 Pierre-Louis Bossart 2020-04-24 862 sdw_bus_master_delete(&ctrl->bus);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 863 err_md:
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 @864 err = sdw_master_device_del(ctrl->md);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 865 if (err < 0) /* log but return initial status */
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 866 dev_err(dev, "master device del failed %d\n", err);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 867 err_clk:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 868 clk_disable_unprepare(ctrl->hclk);
0edb6d574e13a08 Pierre-Louis Bossart 2020-03-20 869 err_init:
02efb49aa805cee Srinivas Kandagatla 2020-01-13 870 return ret;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 871 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 872
:::::: The code at line 792 was first introduced by commit
:::::: 5156c376c827fdcb7526d5eec54616f3612e2423 soundwire: qcom: add sdw_master_device support
:::::: TO: Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com>
:::::: CC: Pierre Bossart <pierre-louis.bossart(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Remove WALNUT hacks in serio/i8042 (was Re: ld.lld: error: undefined symbol: kb_cs)
by Michael Ellerman
[ Cc += linuxppc-dev ]
Nathan Chancellor <natechancellor(a)gmail.com> writes:
> On Thu, May 14, 2020 at 08:13:48AM +0800, kbuild test robot wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head: 24085f70a6e1b0cb647ec92623284641d8270637
>> commit: 5990cdee689c6885b27c6d969a3d58b09002b0bc lib/mpi: Fix building for powerpc with clang
>
> I am certain that this patch did nothing to cause this... Maybe exposed
> it but not the root cause.
>
>> date: 3 weeks ago
>> config: powerpc-randconfig-r034-20200514 (attached as .config)
>> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 310d32cb80a611e6384a921e85607fea05841f26)
>> reproduce:
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # install powerpc cross compiling tool for clang build
>> # apt-get install binutils-powerpc-linux-gnu
>> git checkout 5990cdee689c6885b27c6d969a3d58b09002b0bc
>> # save the attached .config to linux build tree
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kbuild test robot <lkp(a)intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>> >> ld.lld: error: undefined symbol: kb_cs
>> >>> referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced 45 more times
>> --
>> >> ld.lld: error: undefined symbol: kb_data
>> >>> referenced by i8042.c:309 (drivers/input/serio/i8042.c:309)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced by i8042-ppcio.h:33 (drivers/input/serio/i8042-ppcio.h:33)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced by i8042.c:319 (drivers/input/serio/i8042.c:319)
>> >>> input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
>> >>> referenced 15 more times
>
> kb_cs and kb_data are declared as extern void pointers when
> CONFIG_WALNUT is set, which this config does. However, it looks like
> the definitions of these variables were removed in
> commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc"),
> way back in 2.6.27-rc1... So presumably, this has been broken for 12
> years and nobody noticed?
Hmm, nice. 12 years is a pretty typical time frame for finding bugs in
the powerpc tree ... o_O
Our ppc40x_defconfig has CONFIG_SERIO=m, but explicitly disables
CONFIG_SERIO_I8042. And walnut_defconfig disables CONFIG_SERIO.
So I guess it has a PS2 controller but most folks didn't use it?
> Probably means there is a good amount of dead
> code that can be removed, or we could just avoid ever selecting this
> driver with CONFIG_WALNUT (if it does not actually work without the
> special handling from i8042-ppcio.h) while removing the dead code.
I'm inclined to let the driver be selected, rather than carry a wart for
it. I doubt anyone will ever turn it on explicitly, and if they do they
can have fun debugging it.
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 924c541a9260..59b2f655e39e 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -138,7 +138,7 @@ config PPC
> select ARCH_HAVE_NMI_SAFE_CMPXCHG
> select ARCH_KEEP_MEMBLOCK
> select ARCH_MIGHT_HAVE_PC_PARPORT
> - select ARCH_MIGHT_HAVE_PC_SERIO
> + select ARCH_MIGHT_HAVE_PC_SERIO if !WALNUT
> select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
> select ARCH_SUPPORTS_ATOMIC_RMW
> select ARCH_USE_BUILTIN_BSWAP
So I'd drop this hunk.
> diff --git a/drivers/input/serio/i8042-ppcio.h b/drivers/input/serio/i8042-ppcio.h
> deleted file mode 100644
> index 391f94d9e47d..000000000000
> --- a/drivers/input/serio/i8042-ppcio.h
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -#ifndef _I8042_PPCIO_H
> -#define _I8042_PPCIO_H
> -
> -
> -#if defined(CONFIG_WALNUT)
> -
> -#define I8042_KBD_IRQ 25
> -#define I8042_AUX_IRQ 26
> -
> -#define I8042_KBD_PHYS_DESC "walnutps2/serio0"
> -#define I8042_AUX_PHYS_DESC "walnutps2/serio1"
> -#define I8042_MUX_PHYS_DESC "walnutps2/serio%d"
> -
> -extern void *kb_cs;
> -extern void *kb_data;
> -
> -#define I8042_COMMAND_REG (*(int *)kb_cs)
> -#define I8042_DATA_REG (*(int *)kb_data)
> -
> -static inline int i8042_read_data(void)
> -{
> - return readb(kb_data);
> -}
> -
> -static inline int i8042_read_status(void)
> -{
> - return readb(kb_cs);
> -}
> -
> -static inline void i8042_write_data(int val)
> -{
> - writeb(val, kb_data);
> -}
> -
> -static inline void i8042_write_command(int val)
> -{
> - writeb(val, kb_cs);
> -}
> -
> -static inline int i8042_platform_init(void)
> -{
> - i8042_reset = I8042_RESET_ALWAYS;
> - return 0;
> -}
> -
> -static inline void i8042_platform_exit(void)
> -{
> -}
> -
> -#else
> -
> -#include "i8042-io.h"
> -
> -#endif
> -
> -#endif /* _I8042_PPCIO_H */
> diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
> index 38dc27ad3c18..eb376700dfff 100644
> --- a/drivers/input/serio/i8042.h
> +++ b/drivers/input/serio/i8042.h
> @@ -17,8 +17,6 @@
> #include "i8042-ip22io.h"
> #elif defined(CONFIG_SNI_RM)
> #include "i8042-snirm.h"
> -#elif defined(CONFIG_PPC)
> -#include "i8042-ppcio.h"
> #elif defined(CONFIG_SPARC)
> #include "i8042-sparcio.h"
> #elif defined(CONFIG_X86) || defined(CONFIG_IA64)
#elif defined(CONFIG_UNICORE32)
#include "i8042-unicore32io.h"
#else
#include "i8042-io.h"
#endif
The rest of the context is ^
Which makes it clear that your removal of the entire file results in no
change when WALNUT=n.
I'm not sure if anyone really maintains that code, but this is all PPC
really so I think we could merge it.
Do you want to send a proper SOB'ed patch?
cheers
2 years, 4 months
Re: [PATCH v7 2/2] mtd: rawnand: Add NAND controller support on Intel LGM SoC
by kbuild test robot
Hi "Ramuthevar,Vadivel,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on arm-soc/for-next linus/master linux/master v5.7-rc5 next-20200514]
[cannot apply to mtd/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Ramuthevar-Vadivel-MuruganX/mtd-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/mtd/nand/raw/intel-nand-controller.c:441:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __be32 [assignedunsigned int val @@
>> drivers/mtd/nand/raw/intel-nand-controller.c:441:24: sparse: expected unsigned int val
>> drivers/mtd/nand/raw/intel-nand-controller.c:441:24: sparse: got restricted __be32 [assigned] [usertype] reg
drivers/mtd/nand/raw/intel-nand-controller.c:444:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got restricted __be32 [assignedunsigned int val @@
drivers/mtd/nand/raw/intel-nand-controller.c:444:24: sparse: expected unsigned int val
drivers/mtd/nand/raw/intel-nand-controller.c:444:24: sparse: got restricted __be32 [assigned] [usertype] reg
vim +441 drivers/mtd/nand/raw/intel-nand-controller.c
420
421 static int ebu_nand_write_page_hwecc(struct nand_chip *chip, const u8 *buf,
422 int oob_required, int page)
423 {
424 struct mtd_info *mtd = nand_to_mtd(chip);
425 struct ebu_nand_controller *ebu_host = nand_get_controller_data(chip);
426 void __iomem *int_sta = ebu_host->hsnand + HSNAND_INT_STA;
427 int ret, val, x;
428 __be32 reg;
429
430 ebu_nand_trigger(ebu_host, page, NAND_CMD_SEQIN);
431
432 ret = ebu_dma_start(ebu_host, DMA_MEM_TO_DEV, buf, mtd->writesize);
433 if (ret)
434 return ret;
435
436 if (oob_required) {
437 const u8 *pdata;
438
439 pdata = chip->oob_poi;
440 reg = cpu_to_be32(*pdata++);
> 441 writel(reg, ebu_host->hsnand + HSNAND_CMSG_0);
442
443 reg = cpu_to_be32(*pdata);
444 writel(reg, ebu_host->hsnand + HSNAND_CMSG_1);
445 }
446
447 ret = readl_poll_timeout_atomic(int_sta, val,
448 !(val & HSNAND_INT_STA_WR_C), 10, 1000);
449 if (ret)
450 return -EIO;
451
452 x = readl(ebu_host->hsnand + HSNAND_CTL);
453 x &= ~HSNAND_CTL_GO;
454 writel(x, ebu_host->hsnand + HSNAND_CTL);
455
456 return 0;
457 }
458
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-sof-driver:pr/2088 1/10] drivers/soundwire/qcom.c:881:2: error: implicit declaration of function 'sdw_delete_bus_master'
by kbuild test robot
tree: https://github.com/thesofproject/linux pr/2088
head: 46485377528ea8f4848509ce24481fa0ff22d285
commit: 3694409e455802505a693315171036dfb80650e4 [1/10] soundwire: bus: rename sdw_bus_master_add/delete
config: arm64-sof-customedconfig-nobloat-imx-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 3694409e455802505a693315171036dfb80650e4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/soundwire/qcom.c: In function 'qcom_swrm_remove':
>> drivers/soundwire/qcom.c:881:2: error: implicit declaration of function 'sdw_delete_bus_master' [-Werror=implicit-function-declaration]
881 | sdw_delete_bus_master(&ctrl->bus);
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/sdw_delete_bus_master +881 drivers/soundwire/qcom.c
02efb49aa805cee Srinivas Kandagatla 2020-01-13 875
02efb49aa805cee Srinivas Kandagatla 2020-01-13 876 static int qcom_swrm_remove(struct platform_device *pdev)
02efb49aa805cee Srinivas Kandagatla 2020-01-13 877 {
02efb49aa805cee Srinivas Kandagatla 2020-01-13 878 struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(&pdev->dev);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 879 int err;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 880
02efb49aa805cee Srinivas Kandagatla 2020-01-13 @881 sdw_delete_bus_master(&ctrl->bus);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 882 err = sdw_master_device_del(ctrl->md);
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 883 if (err < 0)
5156c376c827fdc Pierre-Louis Bossart 2020-03-17 884 dev_err(&pdev->dev, "master device del failed %d\n", err);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 885 clk_disable_unprepare(ctrl->hclk);
02efb49aa805cee Srinivas Kandagatla 2020-01-13 886
02efb49aa805cee Srinivas Kandagatla 2020-01-13 887 return 0;
02efb49aa805cee Srinivas Kandagatla 2020-01-13 888 }
02efb49aa805cee Srinivas Kandagatla 2020-01-13 889
:::::: The code at line 881 was first introduced by commit
:::::: 02efb49aa805cee643a643ab61a1118c2fd08b80 soundwire: qcom: add support for SoundWire controller
:::::: TO: Srinivas Kandagatla <srinivas.kandagatla(a)linaro.org>
:::::: CC: Vinod Koul <vkoul(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[linux-next:master 9231/9662] arch/s390/include/asm/pgtable.h:1279:21: sparse: sparse: context imbalance in 'debug_vm_pgtable' - unexpected unlock
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: bdecf38f228bcca73b31ada98b5b7ba1215eb9c9
commit: b707bb13bbeb3348aba518731fa96d3f4ad335ba [9231/9662] mm/debug: add tests validating architecture page table helpers
config: s390-randconfig-s002-20200518 (attached as .config)
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout b707bb13bbeb3348aba518731fa96d3f4ad335ba
# save the attached .config to linux build tree
make C=1 ARCH=s390 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/s390/include/asm/pgtable.h:1279:21: sparse: sparse: context imbalance in 'debug_vm_pgtable' - unexpected unlock
vim +/debug_vm_pgtable +1279 arch/s390/include/asm/pgtable.h
^1da177e4c3f415 include/asm-s390/pgtable.h Linus Torvalds 2005-04-16 1278
190a1d722a59725 include/asm-s390/pgtable.h Martin Schwidefsky 2007-10-22 @1279 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
^1da177e4c3f415 include/asm-s390/pgtable.h Linus Torvalds 2005-04-16 1280 {
d1874a0c2805fcf arch/s390/include/asm/pgtable.h Martin Schwidefsky 2019-04-23 1281 if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) >= _REGION_ENTRY_TYPE_R3)
d1874a0c2805fcf arch/s390/include/asm/pgtable.h Martin Schwidefsky 2019-04-23 1282 return (pmd_t *) pud_deref(*pud) + pmd_index(address);
d1874a0c2805fcf arch/s390/include/asm/pgtable.h Martin Schwidefsky 2019-04-23 1283 return (pmd_t *) pud;
d1874a0c2805fcf arch/s390/include/asm/pgtable.h Martin Schwidefsky 2019-04-23 1284 }
1aea9b3f921003f arch/s390/include/asm/pgtable.h Martin Schwidefsky 2017-04-24 1285
:::::: The code at line 1279 was first introduced by commit
:::::: 190a1d722a59725706daf832bc8a511ed62f249d [S390] 4level-fixup cleanup
:::::: TO: Martin Schwidefsky <schwidefsky(a)de.ibm.com>
:::::: CC: Martin Schwidefsky <schwidefsky(a)de.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
[habanaai:habanalabs-next 32/37] drivers/misc/habanalabs/gaudi/gaudi.c:5907 gaudi_print_ecc_info() warn: ignoring unreachable code.
by Dan Carpenter
tree: https://github.com/HabanaAI/linux.git habanalabs-next
head: 65c6a55c2a047806fa0fc365bc32bbe6b2aebd7b
commit: 389aaa2864706e8aa53576642d95761c90861171 [32/37] habanalabs: add gaudi asic-dependent code
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/misc/habanalabs/gaudi/gaudi.c:5907 gaudi_print_ecc_info() warn: ignoring unreachable code.
# https://github.com/HabanaAI/linux/commit/389aaa2864706e8aa53576642d95761c...
git remote add habanaai https://github.com/HabanaAI/linux.git
git remote update habanaai
git checkout 389aaa2864706e8aa53576642d95761c90861171
vim +5907 drivers/misc/habanalabs/gaudi/gaudi.c
389aaa2864706e Oded Gabbay 2020-05-11 5869 static void gaudi_print_ecc_info(struct hl_device *hdev, u16 event_type)
389aaa2864706e Oded Gabbay 2020-05-11 5870 {
389aaa2864706e Oded Gabbay 2020-05-11 5871 u64 block_address;
389aaa2864706e Oded Gabbay 2020-05-11 5872 u8 index;
389aaa2864706e Oded Gabbay 2020-05-11 5873 int num_memories;
389aaa2864706e Oded Gabbay 2020-05-11 5874 char desc[32];
389aaa2864706e Oded Gabbay 2020-05-11 5875 bool derr;
389aaa2864706e Oded Gabbay 2020-05-11 5876 bool disable_clock_gating;
389aaa2864706e Oded Gabbay 2020-05-11 5877
389aaa2864706e Oded Gabbay 2020-05-11 5878 switch (event_type) {
389aaa2864706e Oded Gabbay 2020-05-11 5879 case GAUDI_EVENT_PCIE_CORE_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5880 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_CORE");
389aaa2864706e Oded Gabbay 2020-05-11 5881 block_address = mmPCIE_CORE_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5882 num_memories = 51;
389aaa2864706e Oded Gabbay 2020-05-11 5883 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5884 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5885 break;
389aaa2864706e Oded Gabbay 2020-05-11 5886 case GAUDI_EVENT_PCIE_CORE_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5887 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_CORE");
389aaa2864706e Oded Gabbay 2020-05-11 5888 block_address = mmPCIE_CORE_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5889 num_memories = 51;
389aaa2864706e Oded Gabbay 2020-05-11 5890 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5891 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5892 break;
389aaa2864706e Oded Gabbay 2020-05-11 5893 case GAUDI_EVENT_PCIE_IF_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5894 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_WRAP");
389aaa2864706e Oded Gabbay 2020-05-11 5895 block_address = mmPCIE_WRAP_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5896 num_memories = 11;
389aaa2864706e Oded Gabbay 2020-05-11 5897 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5898 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5899 break;
389aaa2864706e Oded Gabbay 2020-05-11 5900 case GAUDI_EVENT_PCIE_IF_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5901 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_WRAP");
389aaa2864706e Oded Gabbay 2020-05-11 5902 block_address = mmPCIE_WRAP_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5903 num_memories = 11;
389aaa2864706e Oded Gabbay 2020-05-11 5904 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5905 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5906 break;
389aaa2864706e Oded Gabbay 2020-05-11 @5907 return;
^^^^^^
Unreachable and misleading.
389aaa2864706e Oded Gabbay 2020-05-11 5908 case GAUDI_EVENT_PCIE_PHY_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5909 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_PHY");
389aaa2864706e Oded Gabbay 2020-05-11 5910 block_address = mmPCIE_PHY_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5911 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 5912 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5913 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5914 break;
389aaa2864706e Oded Gabbay 2020-05-11 5915 case GAUDI_EVENT_PCIE_PHY_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5916 snprintf(desc, ARRAY_SIZE(desc), "%s", "PCIE_PHY");
389aaa2864706e Oded Gabbay 2020-05-11 5917 block_address = mmPCIE_PHY_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 5918 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 5919 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5920 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5921 break;
389aaa2864706e Oded Gabbay 2020-05-11 5922 case GAUDI_EVENT_TPC0_SERR ... GAUDI_EVENT_TPC7_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5923 index = event_type - GAUDI_EVENT_TPC0_SERR;
389aaa2864706e Oded Gabbay 2020-05-11 5924 block_address = mmTPC0_CFG_BASE + index * TPC_CFG_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5925 snprintf(desc, ARRAY_SIZE(desc), "%s%d", "TPC", index);
389aaa2864706e Oded Gabbay 2020-05-11 5926 num_memories = 90;
389aaa2864706e Oded Gabbay 2020-05-11 5927 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5928 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5929 break;
389aaa2864706e Oded Gabbay 2020-05-11 5930 case GAUDI_EVENT_TPC0_DERR ... GAUDI_EVENT_TPC7_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5931 index = event_type - GAUDI_EVENT_TPC0_DERR;
389aaa2864706e Oded Gabbay 2020-05-11 5932 block_address =
389aaa2864706e Oded Gabbay 2020-05-11 5933 mmTPC0_CFG_BASE + index * TPC_CFG_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5934 snprintf(desc, ARRAY_SIZE(desc), "%s%d", "TPC", index);
389aaa2864706e Oded Gabbay 2020-05-11 5935 num_memories = 90;
389aaa2864706e Oded Gabbay 2020-05-11 5936 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5937 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5938 break;
389aaa2864706e Oded Gabbay 2020-05-11 5939 case GAUDI_EVENT_MME0_ACC_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5940 case GAUDI_EVENT_MME1_ACC_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5941 case GAUDI_EVENT_MME2_ACC_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5942 case GAUDI_EVENT_MME3_ACC_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5943 index = (event_type - GAUDI_EVENT_MME0_ACC_SERR) / 4;
389aaa2864706e Oded Gabbay 2020-05-11 5944 block_address = mmMME0_ACC_BASE + index * MME_ACC_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5945 snprintf(desc, ARRAY_SIZE(desc), "MME%d_ACC", index);
389aaa2864706e Oded Gabbay 2020-05-11 5946 num_memories = 128;
389aaa2864706e Oded Gabbay 2020-05-11 5947 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5948 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5949 break;
389aaa2864706e Oded Gabbay 2020-05-11 5950 case GAUDI_EVENT_MME0_ACC_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5951 case GAUDI_EVENT_MME1_ACC_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5952 case GAUDI_EVENT_MME2_ACC_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5953 case GAUDI_EVENT_MME3_ACC_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5954 index = (event_type - GAUDI_EVENT_MME0_ACC_DERR) / 4;
389aaa2864706e Oded Gabbay 2020-05-11 5955 block_address = mmMME0_ACC_BASE + index * MME_ACC_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5956 snprintf(desc, ARRAY_SIZE(desc), "MME%d_ACC", index);
389aaa2864706e Oded Gabbay 2020-05-11 5957 num_memories = 128;
389aaa2864706e Oded Gabbay 2020-05-11 5958 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5959 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5960 break;
389aaa2864706e Oded Gabbay 2020-05-11 5961 case GAUDI_EVENT_MME0_SBAB_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5962 case GAUDI_EVENT_MME1_SBAB_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5963 case GAUDI_EVENT_MME2_SBAB_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5964 case GAUDI_EVENT_MME3_SBAB_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 5965 index = (event_type - GAUDI_EVENT_MME0_SBAB_SERR) / 4;
389aaa2864706e Oded Gabbay 2020-05-11 5966 block_address = mmMME0_SBAB_BASE + index * MME_ACC_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5967 snprintf(desc, ARRAY_SIZE(desc), "MME%d_SBAB", index);
389aaa2864706e Oded Gabbay 2020-05-11 5968 num_memories = 33;
389aaa2864706e Oded Gabbay 2020-05-11 5969 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5970 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5971 break;
389aaa2864706e Oded Gabbay 2020-05-11 5972 case GAUDI_EVENT_MME0_SBAB_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5973 case GAUDI_EVENT_MME1_SBAB_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5974 case GAUDI_EVENT_MME2_SBAB_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5975 case GAUDI_EVENT_MME3_SBAB_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 5976 index = (event_type - GAUDI_EVENT_MME0_SBAB_DERR) / 4;
389aaa2864706e Oded Gabbay 2020-05-11 5977 block_address = mmMME0_SBAB_BASE + index * MME_ACC_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5978 snprintf(desc, ARRAY_SIZE(desc), "MME%d_SBAB", index);
389aaa2864706e Oded Gabbay 2020-05-11 5979 num_memories = 33;
389aaa2864706e Oded Gabbay 2020-05-11 5980 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5981 disable_clock_gating = true;
389aaa2864706e Oded Gabbay 2020-05-11 5982 break;
389aaa2864706e Oded Gabbay 2020-05-11 5983 case GAUDI_EVENT_DMA0_SERR_ECC ... GAUDI_EVENT_DMA7_SERR_ECC:
389aaa2864706e Oded Gabbay 2020-05-11 5984 index = event_type - GAUDI_EVENT_DMA0_SERR_ECC;
389aaa2864706e Oded Gabbay 2020-05-11 5985 block_address = mmDMA0_CORE_BASE + index * DMA_CORE_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5986 snprintf(desc, ARRAY_SIZE(desc), "DMA%d_CORE", index);
389aaa2864706e Oded Gabbay 2020-05-11 5987 num_memories = 16;
389aaa2864706e Oded Gabbay 2020-05-11 5988 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 5989 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5990 break;
389aaa2864706e Oded Gabbay 2020-05-11 5991 case GAUDI_EVENT_DMA0_DERR_ECC ... GAUDI_EVENT_DMA7_DERR_ECC:
389aaa2864706e Oded Gabbay 2020-05-11 5992 index = event_type - GAUDI_EVENT_DMA0_DERR_ECC;
389aaa2864706e Oded Gabbay 2020-05-11 5993 block_address = mmDMA0_CORE_BASE + index * DMA_CORE_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 5994 snprintf(desc, ARRAY_SIZE(desc), "DMA%d_CORE", index);
389aaa2864706e Oded Gabbay 2020-05-11 5995 num_memories = 16;
389aaa2864706e Oded Gabbay 2020-05-11 5996 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 5997 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 5998 break;
389aaa2864706e Oded Gabbay 2020-05-11 5999 case GAUDI_EVENT_CPU_IF_ECC_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6000 block_address = mmCPU_IF_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6001 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6002 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 6003 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6004 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6005 break;
389aaa2864706e Oded Gabbay 2020-05-11 6006 case GAUDI_EVENT_CPU_IF_ECC_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6007 block_address = mmCPU_IF_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6008 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6009 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 6010 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6011 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6012 break;
389aaa2864706e Oded Gabbay 2020-05-11 6013 case GAUDI_EVENT_PSOC_MEM_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6014 block_address = mmPSOC_GLOBAL_CONF_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6015 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6016 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 6017 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6018 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6019 break;
389aaa2864706e Oded Gabbay 2020-05-11 6020 case GAUDI_EVENT_PSOC_MEM_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6021 block_address = mmPSOC_GLOBAL_CONF_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6022 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6023 num_memories = 4;
389aaa2864706e Oded Gabbay 2020-05-11 6024 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6025 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6026 break;
389aaa2864706e Oded Gabbay 2020-05-11 6027 case GAUDI_EVENT_PSOC_CORESIGHT_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6028 block_address = mmPSOC_CS_TRACE_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6029 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6030 num_memories = 2;
389aaa2864706e Oded Gabbay 2020-05-11 6031 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6032 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6033 break;
389aaa2864706e Oded Gabbay 2020-05-11 6034 case GAUDI_EVENT_PSOC_CORESIGHT_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6035 block_address = mmPSOC_CS_TRACE_BASE;
389aaa2864706e Oded Gabbay 2020-05-11 6036 snprintf(desc, ARRAY_SIZE(desc), "%s", "CPU");
389aaa2864706e Oded Gabbay 2020-05-11 6037 num_memories = 2;
389aaa2864706e Oded Gabbay 2020-05-11 6038 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6039 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6040 break;
389aaa2864706e Oded Gabbay 2020-05-11 6041 case GAUDI_EVENT_SRAM0_SERR ... GAUDI_EVENT_SRAM28_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6042 index = event_type - GAUDI_EVENT_SRAM0_SERR;
389aaa2864706e Oded Gabbay 2020-05-11 6043 block_address =
389aaa2864706e Oded Gabbay 2020-05-11 6044 mmSRAM_Y0_X0_BANK_BASE + index * SRAM_BANK_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 6045 snprintf(desc, ARRAY_SIZE(desc), "SRAM%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6046 num_memories = 2;
389aaa2864706e Oded Gabbay 2020-05-11 6047 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6048 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6049 break;
389aaa2864706e Oded Gabbay 2020-05-11 6050 case GAUDI_EVENT_SRAM0_DERR ... GAUDI_EVENT_SRAM28_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6051 index = event_type - GAUDI_EVENT_SRAM0_DERR;
389aaa2864706e Oded Gabbay 2020-05-11 6052 block_address =
389aaa2864706e Oded Gabbay 2020-05-11 6053 mmSRAM_Y0_X0_BANK_BASE + index * SRAM_BANK_OFFSET;
389aaa2864706e Oded Gabbay 2020-05-11 6054 snprintf(desc, ARRAY_SIZE(desc), "SRAM%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6055 num_memories = 2;
389aaa2864706e Oded Gabbay 2020-05-11 6056 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6057 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6058 break;
389aaa2864706e Oded Gabbay 2020-05-11 6059 case GAUDI_EVENT_DMA_IF0_SERR ... GAUDI_EVENT_DMA_IF3_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6060 index = event_type - GAUDI_EVENT_DMA_IF0_SERR;
389aaa2864706e Oded Gabbay 2020-05-11 6061 block_address = mmDMA_IF_W_S_BASE +
389aaa2864706e Oded Gabbay 2020-05-11 6062 index * (mmDMA_IF_E_S_BASE - mmDMA_IF_W_S_BASE);
389aaa2864706e Oded Gabbay 2020-05-11 6063 snprintf(desc, ARRAY_SIZE(desc), "DMA_IF%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6064 num_memories = 60;
389aaa2864706e Oded Gabbay 2020-05-11 6065 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6066 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6067 break;
389aaa2864706e Oded Gabbay 2020-05-11 6068 case GAUDI_EVENT_DMA_IF0_DERR ... GAUDI_EVENT_DMA_IF3_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6069 index = event_type - GAUDI_EVENT_DMA_IF0_DERR;
389aaa2864706e Oded Gabbay 2020-05-11 6070 block_address = mmDMA_IF_W_S_BASE +
389aaa2864706e Oded Gabbay 2020-05-11 6071 index * (mmDMA_IF_E_S_BASE - mmDMA_IF_W_S_BASE);
389aaa2864706e Oded Gabbay 2020-05-11 6072 snprintf(desc, ARRAY_SIZE(desc), "DMA_IF%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6073 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6074 num_memories = 60;
389aaa2864706e Oded Gabbay 2020-05-11 6075 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6076 break;
389aaa2864706e Oded Gabbay 2020-05-11 6077 case GAUDI_EVENT_HBM_0_SERR ... GAUDI_EVENT_HBM_3_SERR:
389aaa2864706e Oded Gabbay 2020-05-11 6078 index = event_type - GAUDI_EVENT_HBM_0_SERR;
389aaa2864706e Oded Gabbay 2020-05-11 6079 /* HBM Registers are at different offsets */
389aaa2864706e Oded Gabbay 2020-05-11 6080 block_address = mmHBM0_BASE + 0x8000 +
389aaa2864706e Oded Gabbay 2020-05-11 6081 index * (mmHBM1_BASE - mmHBM0_BASE);
389aaa2864706e Oded Gabbay 2020-05-11 6082 snprintf(desc, ARRAY_SIZE(desc), "HBM%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6083 derr = false;
389aaa2864706e Oded Gabbay 2020-05-11 6084 num_memories = 64;
389aaa2864706e Oded Gabbay 2020-05-11 6085 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6086 break;
389aaa2864706e Oded Gabbay 2020-05-11 6087 case GAUDI_EVENT_HBM_0_DERR ... GAUDI_EVENT_HBM_3_DERR:
389aaa2864706e Oded Gabbay 2020-05-11 6088 index = event_type - GAUDI_EVENT_HBM_0_SERR;
389aaa2864706e Oded Gabbay 2020-05-11 6089 /* HBM Registers are at different offsets */
389aaa2864706e Oded Gabbay 2020-05-11 6090 block_address = mmHBM0_BASE + 0x8000 +
389aaa2864706e Oded Gabbay 2020-05-11 6091 index * (mmHBM1_BASE - mmHBM0_BASE);
389aaa2864706e Oded Gabbay 2020-05-11 6092 snprintf(desc, ARRAY_SIZE(desc), "HBM%d", index);
389aaa2864706e Oded Gabbay 2020-05-11 6093 derr = true;
389aaa2864706e Oded Gabbay 2020-05-11 6094 num_memories = 64;
389aaa2864706e Oded Gabbay 2020-05-11 6095 disable_clock_gating = false;
389aaa2864706e Oded Gabbay 2020-05-11 6096 break;
389aaa2864706e Oded Gabbay 2020-05-11 6097 default:
389aaa2864706e Oded Gabbay 2020-05-11 6098 return;
389aaa2864706e Oded Gabbay 2020-05-11 6099 }
389aaa2864706e Oded Gabbay 2020-05-11 6100
389aaa2864706e Oded Gabbay 2020-05-11 6101 gaudi_print_ecc_info_generic(hdev, desc, block_address, num_memories,
389aaa2864706e Oded Gabbay 2020-05-11 6102 derr, disable_clock_gating);
389aaa2864706e Oded Gabbay 2020-05-11 6103 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months
Re: [next-queue RFC 2/4] ethtool: Add support for configuring frame preemption via netlink
by Dan Carpenter
Hi Vinicius,
url: https://github.com/0day-ci/linux/commits/Vinicius-Costa-Gomes/ethtool-Add...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/ethtool/preempt.c:152 ethnl_set_preempt() warn: variable dereferenced before check 'info' (see line 127)
# https://github.com/0day-ci/linux/commit/5d130ebd7a21741d4fda1c8829a32353e...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 5d130ebd7a21741d4fda1c8829a32353e10d49d5
vim +/info +152 net/ethtool/preempt.c
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 118 int ethnl_set_preempt(struct sk_buff *skb, struct genl_info *info)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 119 {
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 120 struct nlattr *tb[ETHTOOL_A_LINKINFO_MAX + 1];
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 121 struct ethtool_fp preempt = {};
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 122 struct ethnl_req_info req_info = {};
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 123 struct net_device *dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 124 bool mod = false;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 125 int ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 126
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 @127 ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb,
^^^^^^^^^^^
Unchecked dereference.
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 128 ETHTOOL_A_PREEMPT_MAX, preempt_set_policy,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 129 info->extack);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 130 if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 131 return ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 132
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 133 ret = ethnl_parse_header_dev_get(&req_info,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 134 tb[ETHTOOL_A_PREEMPT_HEADER],
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 135 genl_info_net(info), info->extack,
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 136 true);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 137 if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 138 return ret;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 139 dev = req_info.dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 140 ret = -EOPNOTSUPP;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 141 if (!dev->ethtool_ops->get_preempt ||
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 142 !dev->ethtool_ops->set_preempt)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 143 goto out_dev;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 144
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 145 rtnl_lock();
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 146 ret = ethnl_ops_begin(dev);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 147 if (ret < 0)
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 148 goto out_rtnl;
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 149
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 150 ret = dev->ethtool_ops->get_preempt(dev, &preempt);
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 151 if (ret < 0) {
5d130ebd7a2174 Vinicius Costa Gomes 2020-05-15 @152 if (info)
^^^^^^^^^
Check is too late to help.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 4 months