From: kernel test robot <lkp@intel.com>
To: Luo bin <luobin9@huawei.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:570:21: sparse: sparse: cast to restricted __be32
Date: Wed, 11 Nov 2020 06:21:17 +0800 [thread overview]
Message-ID: <202011110615.OyTZH2D6-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4837 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: eccc876724927ff3b9ff91f36f7b6b159e948f0c
commit: 088c5f0d1a7c7f01e668d9d2d75e7d93b43b7690 hinic: add generating mailbox random index support
date: 3 months ago
config: arm64-randconfig-s031-20201110 (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
# apt-get install sparse
# sparse version: v0.6.3-76-gf680124b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=088c5f0d1a7c7f01e668d9d2d75e7d93b43b7690
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 088c5f0d1a7c7f01e668d9d2d75e7d93b43b7690
# 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=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:570:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:648:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:648:54: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:648:54: sparse: got unsigned char [usertype] *
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:671:58: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got unsigned char [usertype] * @@
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:671:58: sparse: expected void volatile [noderef] __iomem *addr
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:671:58: sparse: got unsigned char [usertype] *
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:723:22: sparse: sparse: cast to restricted __be64
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:1164:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned char [usertype] *data @@ got void [noderef] __iomem * @@
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:1164:25: sparse: expected unsigned char [usertype] *data
drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c:1164:25: sparse: got void [noderef] __iomem *
vim +570 drivers/net/ethernet/huawei/hinic/hinic_hw_mbox.c
541
542 static bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func,
543 u8 *header)
544 {
545 struct hinic_hwdev *hwdev = func_to_func->hwdev;
546 struct hinic_mbox_work *mbox_work = NULL;
547 u64 mbox_header = *((u64 *)header);
548 u16 offset, src;
549 u32 random_id;
550 int vf_in_pf;
551
552 src = HINIC_MBOX_HEADER_GET(mbox_header, SRC_GLB_FUNC_IDX);
553
554 if (IS_PF_OR_PPF_SRC(src) || !func_to_func->support_vf_random)
555 return true;
556
557 if (!HINIC_IS_PPF(hwdev->hwif)) {
558 offset = hinic_glb_pf_vf_offset(hwdev->hwif);
559 vf_in_pf = src - offset;
560
561 if (vf_in_pf < 1 || vf_in_pf > hwdev->nic_cap.max_vf) {
562 dev_warn(&hwdev->hwif->pdev->dev,
563 "Receive vf id(0x%x) is invalid, vf id should be from 0x%x to 0x%x\n",
564 src, offset + 1,
565 hwdev->nic_cap.max_vf + offset);
566 return false;
567 }
568 }
569
> 570 random_id = be32_to_cpu(*(u32 *)(header + MBOX_SEG_LEN +
571 MBOX_HEADER_SZ));
572
573 if (random_id == func_to_func->vf_mbx_rand_id[src] ||
574 random_id == func_to_func->vf_mbx_old_rand_id[src])
575 return true;
576
577 dev_warn(&hwdev->hwif->pdev->dev,
578 "The mailbox random id(0x%x) of func_id(0x%x) doesn't match with pf reservation(0x%x)\n",
579 random_id, src, func_to_func->vf_mbx_rand_id[src]);
580
581 mbox_work = kzalloc(sizeof(*mbox_work), GFP_KERNEL);
582 if (!mbox_work)
583 return false;
584
585 mbox_work->func_to_func = func_to_func;
586 mbox_work->src_func_idx = src;
587
588 INIT_WORK(&mbox_work->work, update_random_id_work_handler);
589 queue_work(func_to_func->workq, &mbox_work->work);
590
591 return false;
592 }
593
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40507 bytes --]
next reply other threads:[~2020-11-10 22:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 22:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-03 5:58 kernel test robot
2020-09-02 3:33 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011110615.OyTZH2D6-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luobin9@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®