From: kernel test robot <lkp@intel.com>
To: Yuntao Dai <d1581209858@live.com>,
jassisinghbrar@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, unicorn_wang@outlook.com,
inochiama@outlook.com, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org,
Yuntao Dai <d1581209858@live.com>
Subject: Re: [PATCH 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs
Date: Thu, 20 Jun 2024 09:27:48 +0800 [thread overview]
Message-ID: <202406200820.Wms9UPDw-lkp@intel.com> (raw)
In-Reply-To: <SYBP282MB2238F93AB57A398E322644C3C4CE2@SYBP282MB2238.AUSP282.PROD.OUTLOOK.COM>
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-rc4 next-20240619]
[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/20240618-232307
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/SYBP282MB2238F93AB57A398E322644C3C4CE2%40SYBP282MB2238.AUSP282.PROD.OUTLOOK.COM
patch subject: [PATCH 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240620/202406200820.Wms9UPDw-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200820.Wms9UPDw-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406200820.Wms9UPDw-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mailbox/cv1800b-mailbox.c:83:12: warning: cast to smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
83 | int idx = (int)chan->con_priv;
| ^~~~~~~~~~~~~~~~~~~
>> drivers/mailbox/cv1800b-mailbox.c:160:34: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
160 | mb->mbox.chans[idx].con_priv = (void *)idx;
| ^~~~~~~~~~~
2 warnings generated.
vim +83 drivers/mailbox/cv1800b-mailbox.c
79
80 static int cv1800b_mbox_send_data(struct mbox_chan *chan, void *data)
81 {
82 struct cv1800b_mbox *mbox = dev_get_drvdata(chan->mbox->dev);
> 83 int idx = (int)chan->con_priv;
84 u8 en, valid;
85 u64 *addr = (u64 *)(mbox->mbox_base + MAILBOX_CONTEXT_OFFSET) + idx;
86
87 memcpy_toio(addr, data, 8);
88
89 valid = 1 << idx;
90 writeb(valid, mbox->mbox_base + MBOX_SET_CLR_REG(mbox->sendto));
91 en = readb(mbox->mbox_base + MBOX_EN_REG(mbox->sendto));
92 writeb(en | valid, mbox->mbox_base + MBOX_EN_REG(mbox->sendto));
93 writeb(valid, mbox->mbox_base + MBOX_SET_REG);
94
95 return 0;
96 }
97
98 static bool cv1800b_last_tx_done(struct mbox_chan *chan)
99 {
100 return true;
101 }
102
103 static const struct mbox_chan_ops cv1800b_mbox_chan_ops = {
104 .send_data = cv1800b_mbox_send_data,
105 .last_tx_done = cv1800b_last_tx_done,
106 };
107
108 static const struct of_device_id cv1800b_mbox_of_match[] = {
109 { .compatible = "sophgo,cv1800b-mailbox", },
110 {},
111 };
112 MODULE_DEVICE_TABLE(of, cv1800b_mbox_of_match);
113
114 static int cv1800b_mbox_probe(struct platform_device *pdev)
115 {
116 struct device *dev = &pdev->dev;
117 struct cv1800b_mbox *mb;
118 int irq, idx, err, cpu;
119
120 if (!dev->of_node)
121 return -ENODEV;
122
123 mb = devm_kzalloc(dev, sizeof(*mb), GFP_KERNEL);
124 if (!mb)
125 return -ENOMEM;
126
127 mb->mbox_base = devm_of_iomap(dev, dev->of_node, 0, NULL);
128 if (IS_ERR(mb->mbox_base))
129 return dev_err_probe(dev, PTR_ERR(mb->mbox_base),
130 "Failed to map resource\n");
131
132 err = of_property_read_s32(dev->of_node, "sendto", &cpu);
133 if (err)
134 return dev_err_probe(dev, err,
135 "Failed to find <sendto> in of_node\n");
136
137 mb->sendto = cpu;
138
139 err = of_property_read_s32(dev->of_node, "recvid", &cpu);
140 if (err) {
141 return dev_err_probe(dev, err,
142 "Failed to find <recvid> in of_node\n");
143 }
144 mb->recvid = cpu;
145
146 mb->mbox.dev = dev;
147 mb->mbox.num_chans = MAILBOX_MAX_CHAN;
148 mb->mbox.chans = mb->chans;
149 mb->mbox.ops = &cv1800b_mbox_chan_ops;
150 mb->mbox.txdone_poll = true;
151
152 irq = platform_get_irq_byname(pdev, "mailbox");
153 err = devm_request_threaded_irq(dev, irq, cv1800b_mbox_irq,
154 cv1800b_mbox_isr, IRQF_ONESHOT,
155 dev_name(&pdev->dev), mb);
156 if (err < 0)
157 return dev_err_probe(dev, err, "Failed to register irq\n");
158
159 for (idx = 0; idx < MAILBOX_MAX_CHAN; idx++)
> 160 mb->mbox.chans[idx].con_priv = (void *)idx;
161
162 err = devm_mbox_controller_register(dev, &mb->mbox);
163 if (err)
164 return dev_err_probe(dev, err, "Failed to register mailbox\n");
165
166 platform_set_drvdata(pdev, mb);
167 return 0;
168 }
169
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Yuntao Dai <d1581209858@live.com>,
jassisinghbrar@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, unicorn_wang@outlook.com,
inochiama@outlook.com, paul.walmsley@sifive.com,
palmer@dabbelt.com, aou@eecs.berkeley.edu
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org,
Yuntao Dai <d1581209858@live.com>
Subject: Re: [PATCH 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs
Date: Thu, 20 Jun 2024 09:27:48 +0800 [thread overview]
Message-ID: <202406200820.Wms9UPDw-lkp@intel.com> (raw)
In-Reply-To: <SYBP282MB2238F93AB57A398E322644C3C4CE2@SYBP282MB2238.AUSP282.PROD.OUTLOOK.COM>
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-rc4 next-20240619]
[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/20240618-232307
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/SYBP282MB2238F93AB57A398E322644C3C4CE2%40SYBP282MB2238.AUSP282.PROD.OUTLOOK.COM
patch subject: [PATCH 3/3] mailbox: sophgo: add mailbox driver for cv18x SoCs
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240620/202406200820.Wms9UPDw-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240620/202406200820.Wms9UPDw-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406200820.Wms9UPDw-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mailbox/cv1800b-mailbox.c:83:12: warning: cast to smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
83 | int idx = (int)chan->con_priv;
| ^~~~~~~~~~~~~~~~~~~
>> drivers/mailbox/cv1800b-mailbox.c:160:34: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
160 | mb->mbox.chans[idx].con_priv = (void *)idx;
| ^~~~~~~~~~~
2 warnings generated.
vim +83 drivers/mailbox/cv1800b-mailbox.c
79
80 static int cv1800b_mbox_send_data(struct mbox_chan *chan, void *data)
81 {
82 struct cv1800b_mbox *mbox = dev_get_drvdata(chan->mbox->dev);
> 83 int idx = (int)chan->con_priv;
84 u8 en, valid;
85 u64 *addr = (u64 *)(mbox->mbox_base + MAILBOX_CONTEXT_OFFSET) + idx;
86
87 memcpy_toio(addr, data, 8);
88
89 valid = 1 << idx;
90 writeb(valid, mbox->mbox_base + MBOX_SET_CLR_REG(mbox->sendto));
91 en = readb(mbox->mbox_base + MBOX_EN_REG(mbox->sendto));
92 writeb(en | valid, mbox->mbox_base + MBOX_EN_REG(mbox->sendto));
93 writeb(valid, mbox->mbox_base + MBOX_SET_REG);
94
95 return 0;
96 }
97
98 static bool cv1800b_last_tx_done(struct mbox_chan *chan)
99 {
100 return true;
101 }
102
103 static const struct mbox_chan_ops cv1800b_mbox_chan_ops = {
104 .send_data = cv1800b_mbox_send_data,
105 .last_tx_done = cv1800b_last_tx_done,
106 };
107
108 static const struct of_device_id cv1800b_mbox_of_match[] = {
109 { .compatible = "sophgo,cv1800b-mailbox", },
110 {},
111 };
112 MODULE_DEVICE_TABLE(of, cv1800b_mbox_of_match);
113
114 static int cv1800b_mbox_probe(struct platform_device *pdev)
115 {
116 struct device *dev = &pdev->dev;
117 struct cv1800b_mbox *mb;
118 int irq, idx, err, cpu;
119
120 if (!dev->of_node)
121 return -ENODEV;
122
123 mb = devm_kzalloc(dev, sizeof(*mb), GFP_KERNEL);
124 if (!mb)
125 return -ENOMEM;
126
127 mb->mbox_base = devm_of_iomap(dev, dev->of_node, 0, NULL);
128 if (IS_ERR(mb->mbox_base))
129 return dev_err_probe(dev, PTR_ERR(mb->mbox_base),
130 "Failed to map resource\n");
131
132 err = of_property_read_s32(dev->of_node, "sendto", &cpu);
133 if (err)
134 return dev_err_probe(dev, err,
135 "Failed to find <sendto> in of_node\n");
136
137 mb->sendto = cpu;
138
139 err = of_property_read_s32(dev->of_node, "recvid", &cpu);
140 if (err) {
141 return dev_err_probe(dev, err,
142 "Failed to find <recvid> in of_node\n");
143 }
144 mb->recvid = cpu;
145
146 mb->mbox.dev = dev;
147 mb->mbox.num_chans = MAILBOX_MAX_CHAN;
148 mb->mbox.chans = mb->chans;
149 mb->mbox.ops = &cv1800b_mbox_chan_ops;
150 mb->mbox.txdone_poll = true;
151
152 irq = platform_get_irq_byname(pdev, "mailbox");
153 err = devm_request_threaded_irq(dev, irq, cv1800b_mbox_irq,
154 cv1800b_mbox_isr, IRQF_ONESHOT,
155 dev_name(&pdev->dev), mb);
156 if (err < 0)
157 return dev_err_probe(dev, err, "Failed to register irq\n");
158
159 for (idx = 0; idx < MAILBOX_MAX_CHAN; idx++)
> 160 mb->mbox.chans[idx].con_priv = (void *)idx;
161
162 err = devm_mbox_controller_register(dev, &mb->mbox);
163 if (err)
164 return dev_err_probe(dev, err, "Failed to register mailbox\n");
165
166 platform_set_drvdata(pdev, mb);
167 return 0;
168 }
169
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-06-20 1:28 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 15:03 [PATCH 0/3] riscv: sophgo: add mailbox support for cv18x SoCs Yuntao Dai
2024-06-18 15:03 ` Yuntao Dai
2024-06-18 15:12 ` [PATCH 1/3] dt-bindings: mailbox: add Sophgo cv18x SoCs mailbox Yuntao Dai
2024-06-18 15:12 ` Yuntao Dai
2024-06-18 15:38 ` Conor Dooley
2024-06-18 15:38 ` Conor Dooley
2024-06-19 14:33 ` 韵涛 代
2024-06-19 14:33 ` 韵涛 代
2024-06-19 18:07 ` Conor Dooley
2024-06-19 18:07 ` Conor Dooley
2024-06-18 16:54 ` Rob Herring (Arm)
2024-06-18 16:54 ` Rob Herring (Arm)
2024-06-19 14:40 ` 韵涛 代
2024-06-19 14:40 ` 韵涛 代
2024-06-18 22:33 ` Inochi Amaoto
2024-06-18 22:33 ` Inochi Amaoto
2024-06-19 14:42 ` 韵涛 代
2024-06-19 14:42 ` 韵涛 代
2024-06-18 22:45 ` Inochi Amaoto
2024-06-18 22:45 ` Inochi Amaoto
[not found] ` <IA1PR20MB4953CE25C805EB66EFFDC36DBBCE2@IA1PR20MB4953.namprd20.prod.outlook.c om>
2024-07-14 16:04 ` Yuntao Dai
2024-07-14 16:04 ` Yuntao Dai
2024-06-18 23:21 ` kernel test robot
2024-06-18 23:21 ` kernel test robot
2024-06-18 15:12 ` [PATCH 2/3] riscv: dts: add mailbox for Sophgo cv18x SoCs Yuntao Dai
2024-06-18 15:12 ` Yuntao Dai
2024-06-18 15:12 ` [PATCH 3/3] mailbox: sophgo: add mailbox driver for " Yuntao Dai
2024-06-18 15:12 ` Yuntao Dai
2024-06-19 18:15 ` kernel test robot
2024-06-19 18:15 ` kernel test robot
2024-06-20 1:27 ` kernel test robot [this message]
2024-06-20 1:27 ` kernel test robot
2024-06-21 0:21 ` kernel test robot
2024-06-21 0:21 ` kernel test robot
2024-06-21 13:37 ` kernel test robot
2024-06-21 13:37 ` kernel test robot
2024-07-02 15:08 ` Junhui Liu
2024-07-02 15:08 ` Junhui Liu
2024-07-14 16:09 ` Yuntao Dai
2024-07-14 16:09 ` Yuntao Dai
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=202406200820.Wms9UPDw-lkp@intel.com \
--to=lkp@intel.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=d1581209858@live.com \
--cc=devicetree@vger.kernel.org \
--cc=inochiama@outlook.com \
--cc=jassisinghbrar@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=unicorn_wang@outlook.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.