Re: [PATCH v2 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs

From: kernel test robot
Date: Mon Jul 15 2024 - 05:10:10 EST


Hi Yuntao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.10 next-20240715]
[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/Yuntao-Dai/dt-bindings-mailbox-add-Sophgo-cv18x-SoCs-mailbox/20240715-003952
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/SYBP282MB2238F93565D20F0A5F3EEB6BC4A02%40SYBP282MB2238.AUSP282.PROD.OUTLOOK.COM
patch subject: [PATCH v2 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs
config: powerpc-randconfig-r113-20240715 (https://download.01.org/0day-ci/archive/20240715/202407151649.ExTr3xXL-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20240715/202407151649.ExTr3xXL-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407151649.ExTr3xXL-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/mailbox/cv1800-mailbox.c:56:62: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *data @@ got unsigned long long [noderef] [usertype] __iomem * @@
drivers/mailbox/cv1800-mailbox.c:56:62: sparse: expected void *data
drivers/mailbox/cv1800-mailbox.c:56:62: sparse: got unsigned long long [noderef] [usertype] __iomem *
>> drivers/mailbox/cv1800-mailbox.c:78:25: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/mailbox/cv1800-mailbox.c:78:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long long [noderef] [usertype] __iomem *addr @@ got unsigned long long [usertype] * @@
drivers/mailbox/cv1800-mailbox.c:78:22: sparse: expected unsigned long long [noderef] [usertype] __iomem *addr
drivers/mailbox/cv1800-mailbox.c:78:22: sparse: got unsigned long long [usertype] *
drivers/mailbox/cv1800-mailbox.c:102:17: sparse: sparse: cast removes address space '__iomem' of expression
drivers/mailbox/cv1800-mailbox.c:102:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned long long [noderef] [usertype] __iomem *addr @@ got unsigned long long [usertype] * @@
drivers/mailbox/cv1800-mailbox.c:102:14: sparse: expected unsigned long long [noderef] [usertype] __iomem *addr
drivers/mailbox/cv1800-mailbox.c:102:14: sparse: got unsigned long long [usertype] *

vim +56 drivers/mailbox/cv1800-mailbox.c

47
48 static irqreturn_t cv1800_mbox_isr(int irq, void *dev_id)
49 {
50 struct cv1800_mbox *mbox = (struct cv1800_mbox *)dev_id;
51 size_t i;
52
53 for (i = 0; i < MAILBOX_MAX_CHAN; i++) {
54 if (mbox->content[i] && mbox->chans[i].cl) {
55 mbox_chan_received_data(&mbox->chans[i],
> 56 mbox->content[i]);
57 mbox->content[i] = NULL;
58 return IRQ_HANDLED;
59 }
60 }
61 return IRQ_NONE;
62 }
63
64 static irqreturn_t cv1800_mbox_irq(int irq, void *dev_id)
65 {
66 struct cv1800_mbox *mbox = (struct cv1800_mbox *)dev_id;
67 u64 __iomem *addr;
68 u8 set, valid;
69 size_t i;
70
71 set = readb(mbox->mbox_base + MBOX_SET_INT_REG(RECV_CPU));
72
73 if (!set)
74 return IRQ_NONE;
75
76 for (i = 0; i < MAILBOX_MAX_CHAN; i++) {
77 valid = set & (1 << i);
> 78 addr = (u64 *)(mbox->mbox_base + MAILBOX_CONTEXT_OFFSET) + i;
79 if (valid) {
80 mbox->content[i] = addr;
81 writeb(valid,
82 mbox->mbox_base + MBOX_SET_CLR_REG(RECV_CPU));
83 writeb(~valid, mbox->mbox_base + MBOX_EN_REG(RECV_CPU));
84 return IRQ_WAKE_THREAD;
85 }
86 }
87
88 return IRQ_NONE;
89 }
90

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki