drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:489:21: sparse: expected unsigned long long

From: kernel test robot
Date: Wed Aug 26 2020 - 10:18:33 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2ac69819ba9e3d8d550bb5d2d2df74848e556812
commit: 4ff7d1488a8496fddcfdf40c42489eaa64892f3e octeontx2-pf: Error handling support
date: 7 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 7 months ago
config: powerpc-randconfig-s031-20200826 (attached as .config)
compiler: powerpc64le-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
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout 4ff7d1488a8496fddcfdf40c42489eaa64892f3e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc

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


sparse warnings: (new ones prefixed by >>)

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:489:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long long [usertype] *ptr @@ got void [noderef] <asn:2> * @@
>> drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:489:21: sparse: expected unsigned long long [usertype] *ptr
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:489:21: sparse: got void [noderef] <asn:2> *
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:514:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long long [usertype] *ptr @@ got void [noderef] <asn:2> * @@
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:514:21: sparse: expected unsigned long long [usertype] *ptr
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:514:21: sparse: got void [noderef] <asn:2> *

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4ff7d1488a8496fddcfdf40c42489eaa64892f3e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4ff7d1488a8496fddcfdf40c42489eaa64892f3e
vim +489 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

165475779ba1d47 Sunil Goutham 2020-01-27 480
4ff7d1488a8496f Geetha sowjanya 2020-01-27 481 static irqreturn_t otx2_q_intr_handler(int irq, void *data)
4ff7d1488a8496f Geetha sowjanya 2020-01-27 482 {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 483 struct otx2_nic *pf = data;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 484 u64 val, *ptr;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 485 u64 qidx = 0;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 486
4ff7d1488a8496f Geetha sowjanya 2020-01-27 487 /* CQ */
4ff7d1488a8496f Geetha sowjanya 2020-01-27 488 for (qidx = 0; qidx < pf->qset.cq_cnt; qidx++) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 @489 ptr = otx2_get_regaddr(pf, NIX_LF_CQ_OP_INT);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 490 val = otx2_atomic64_add((qidx << 44), ptr);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 491
4ff7d1488a8496f Geetha sowjanya 2020-01-27 492 otx2_write64(pf, NIX_LF_CQ_OP_INT, (qidx << 44) |
4ff7d1488a8496f Geetha sowjanya 2020-01-27 493 (val & NIX_CQERRINT_BITS));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 494 if (!(val & (NIX_CQERRINT_BITS | BIT_ULL(42))))
4ff7d1488a8496f Geetha sowjanya 2020-01-27 495 continue;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 496
4ff7d1488a8496f Geetha sowjanya 2020-01-27 497 if (val & BIT_ULL(42)) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 498 netdev_err(pf->netdev, "CQ%lld: error reading NIX_LF_CQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 499 qidx, otx2_read64(pf, NIX_LF_ERR_INT));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 500 } else {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 501 if (val & BIT_ULL(NIX_CQERRINT_DOOR_ERR))
4ff7d1488a8496f Geetha sowjanya 2020-01-27 502 netdev_err(pf->netdev, "CQ%lld: Doorbell error",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 503 qidx);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 504 if (val & BIT_ULL(NIX_CQERRINT_CQE_FAULT))
4ff7d1488a8496f Geetha sowjanya 2020-01-27 505 netdev_err(pf->netdev, "CQ%lld: Memory fault on CQE write to LLC/DRAM",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 506 qidx);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 507 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 508
4ff7d1488a8496f Geetha sowjanya 2020-01-27 509 schedule_work(&pf->reset_task);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 510 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 511
4ff7d1488a8496f Geetha sowjanya 2020-01-27 512 /* SQ */
4ff7d1488a8496f Geetha sowjanya 2020-01-27 513 for (qidx = 0; qidx < pf->hw.tx_queues; qidx++) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 514 ptr = otx2_get_regaddr(pf, NIX_LF_SQ_OP_INT);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 515 val = otx2_atomic64_add((qidx << 44), ptr);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 516 otx2_write64(pf, NIX_LF_SQ_OP_INT, (qidx << 44) |
4ff7d1488a8496f Geetha sowjanya 2020-01-27 517 (val & NIX_SQINT_BITS));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 518
4ff7d1488a8496f Geetha sowjanya 2020-01-27 519 if (!(val & (NIX_SQINT_BITS | BIT_ULL(42))))
4ff7d1488a8496f Geetha sowjanya 2020-01-27 520 continue;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 521
4ff7d1488a8496f Geetha sowjanya 2020-01-27 522 if (val & BIT_ULL(42)) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 523 netdev_err(pf->netdev, "SQ%lld: error reading NIX_LF_SQ_OP_INT, NIX_LF_ERR_INT 0x%llx\n",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 524 qidx, otx2_read64(pf, NIX_LF_ERR_INT));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 525 } else {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 526 if (val & BIT_ULL(NIX_SQINT_LMT_ERR)) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 527 netdev_err(pf->netdev, "SQ%lld: LMT store error NIX_LF_SQ_OP_ERR_DBG:0x%llx",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 528 qidx,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 529 otx2_read64(pf,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 530 NIX_LF_SQ_OP_ERR_DBG));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 531 otx2_write64(pf, NIX_LF_SQ_OP_ERR_DBG,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 532 BIT_ULL(44));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 533 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 534 if (val & BIT_ULL(NIX_SQINT_MNQ_ERR)) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 535 netdev_err(pf->netdev, "SQ%lld: Meta-descriptor enqueue error NIX_LF_MNQ_ERR_DGB:0x%llx\n",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 536 qidx,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 537 otx2_read64(pf, NIX_LF_MNQ_ERR_DBG));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 538 otx2_write64(pf, NIX_LF_MNQ_ERR_DBG,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 539 BIT_ULL(44));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 540 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 541 if (val & BIT_ULL(NIX_SQINT_SEND_ERR)) {
4ff7d1488a8496f Geetha sowjanya 2020-01-27 542 netdev_err(pf->netdev, "SQ%lld: Send error, NIX_LF_SEND_ERR_DBG 0x%llx",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 543 qidx,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 544 otx2_read64(pf,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 545 NIX_LF_SEND_ERR_DBG));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 546 otx2_write64(pf, NIX_LF_SEND_ERR_DBG,
4ff7d1488a8496f Geetha sowjanya 2020-01-27 547 BIT_ULL(44));
4ff7d1488a8496f Geetha sowjanya 2020-01-27 548 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 549 if (val & BIT_ULL(NIX_SQINT_SQB_ALLOC_FAIL))
4ff7d1488a8496f Geetha sowjanya 2020-01-27 550 netdev_err(pf->netdev, "SQ%lld: SQB allocation failed",
4ff7d1488a8496f Geetha sowjanya 2020-01-27 551 qidx);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 552 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 553
4ff7d1488a8496f Geetha sowjanya 2020-01-27 554 schedule_work(&pf->reset_task);
4ff7d1488a8496f Geetha sowjanya 2020-01-27 555 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 556
4ff7d1488a8496f Geetha sowjanya 2020-01-27 557 return IRQ_HANDLED;
4ff7d1488a8496f Geetha sowjanya 2020-01-27 558 }
4ff7d1488a8496f Geetha sowjanya 2020-01-27 559

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip