2020-04-22 11:20:24

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver

Hi Scott,

I love your patch! Perhaps something to improve:

[auto build test WARNING on driver-core/driver-core-testing]
[also build test WARNING on next-20200421]
[cannot apply to char-misc/char-misc-testing kselftest/next linus/master v5.7-rc2]
[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/Scott-Branden/firmware-add-partial-read-support-in-request_firmware_into_buf/20200422-114528
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 55623260bb33e2ab849af76edf2253bc04cb241f
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-191-gc51a0382-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 <[email protected]>


sparse warnings: (new ones prefixed by >>)

>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bcm_vk_peer_log *p_ctl @@ got struct bcm_vk_peer_log *p_ctl @@
>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: expected struct bcm_vk_peer_log *p_ctl
>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: got void [noderef] <asn:2> *
>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got oderef] <asn:1> *from @@
>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: expected void const [noderef] <asn:1> *from
>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: got struct vk_image *arg
drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got oderef] <asn:1> *from @@
drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: expected void const [noderef] <asn:1> *from
>> drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: got struct vk_reset *arg
>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct vk_image *arg @@ got void [nstruct vk_image *arg @@
>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: expected struct vk_image *arg
>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: got void [noderef] <asn:1> *argp
>> drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct vk_reset *arg @@ got void [nstruct vk_reset *arg @@
>> drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: expected struct vk_reset *arg
drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: got void [noderef] <asn:1> *argp
--
>> drivers/misc/bcm-vk/bcm_vk_msg.c:507:17: sparse: sparse: cast removes address space '<asn:2>' of expression
drivers/misc/bcm-vk/bcm_vk_msg.c:707:15: sparse: sparse: cast removes address space '<asn:2>' of expression
drivers/misc/bcm-vk/bcm_vk_msg.c:715:23: sparse: sparse: cast removes address space '<asn:2>' of expression
drivers/misc/bcm-vk/bcm_vk_msg.c:871:31: sparse: sparse: cast removes address space '<asn:2>' of expression
drivers/misc/bcm-vk/bcm_vk_msg.c:899:47: sparse: sparse: cast removes address space '<asn:2>' of expression

vim +189 drivers/misc/bcm-vk/bcm_vk_dev.c

180
181 static void bcm_vk_dump_peer_log(struct bcm_vk *vk)
182 {
183 struct bcm_vk_peer_log log, *p_ctl;
184 char loc_buf[BCM_VK_PEER_LOG_LINE_MAX];
185 int cnt;
186 struct device *dev = &vk->pdev->dev;
187 uint data_offset;
188
> 189 p_ctl = vk->bar[BAR_2] + vk->peerlog_off;
190 log = *p_ctl;
191 /* do a rmb() to make sure log is updated */
192 rmb();
193
194 dev_dbg(dev, "Peer PANIC: Size 0x%x(0x%x), [Rd Wr] = [%d %d]\n",
195 log.buf_size, log.mask, log.rd_idx, log.wr_idx);
196
197 cnt = 0;
198 data_offset = vk->peerlog_off + sizeof(struct bcm_vk_peer_log);
199 while (log.rd_idx != log.wr_idx) {
200 loc_buf[cnt] = vkread8(vk, BAR_2, data_offset + log.rd_idx);
201
202 if ((loc_buf[cnt] == '\0') ||
203 (cnt == (BCM_VK_PEER_LOG_LINE_MAX - 1))) {
204 dev_err(dev, "%s", loc_buf);
205 cnt = 0;
206 } else {
207 cnt++;
208 }
209 log.rd_idx = (log.rd_idx + 1) & log.mask;
210 }
211 /* update rd idx at the end */
212 vkwrite32(vk, log.rd_idx, BAR_2, vk->peerlog_off);
213 }
214

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


2020-04-22 12:24:18

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver

On Wed, Apr 22, 2020 at 07:17:34PM +0800, kbuild test robot wrote:
> Hi Scott,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on driver-core/driver-core-testing]
> [also build test WARNING on next-20200421]
> [cannot apply to char-misc/char-misc-testing kselftest/next linus/master v5.7-rc2]
> [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/Scott-Branden/firmware-add-partial-read-support-in-request_firmware_into_buf/20200422-114528
> base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 55623260bb33e2ab849af76edf2253bc04cb241f
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.1-191-gc51a0382-dirty
> make ARCH=x86_64 allmodconfig
> make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
^^^^^^^^^^^^^^^^^^^

Sorry, you asked me about this earlier. You will need to add
-D__CHECK_ENDIAN__ to enable these Sparse warnings.

regards,
dan carpenter

2020-04-22 15:01:46

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver

On Wed, Apr 22, 2020 at 02:35:58PM +0300, Dan Carpenter wrote:
> Sorry, you asked me about this earlier. You will need to add
> -D__CHECK_ENDIAN__ to enable these Sparse warnings.

Endian checking has been enabled by default for quite a while.

2020-04-22 16:15:39

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver



On 2020-04-22 4:35 a.m., Dan Carpenter wrote:
> On Wed, Apr 22, 2020 at 07:17:34PM +0800, kbuild test robot wrote:
>> Hi Scott,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on driver-core/driver-core-testing]
>> [also build test WARNING on next-20200421]
>> [cannot apply to char-misc/char-misc-testing kselftest/next linus/master v5.7-rc2]
>> [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/Scott-Branden/firmware-add-partial-read-support-in-request_firmware_into_buf/20200422-114528
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 55623260bb33e2ab849af76edf2253bc04cb241f
>> reproduce:
>> # apt-get install sparse
>> # sparse version: v0.6.1-191-gc51a0382-dirty
>> make ARCH=x86_64 allmodconfig
>> make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
> ^^^^^^^^^^^^^^^^^^^
>
> Sorry, you asked me about this earlier. You will need to add
> -D__CHECK_ENDIAN__ to enable these Sparse warnings.
This is strange.  I ran the sparse build and thought I had fixed all the
issues.
I'll have to try again.

One other question with the sparse build.  I get many of the messages
printed but the build seems to go to the end (even without my patches
applied):
./arch/x86/include/asm/paravirt.h:333:9: error: got __inline
./arch/x86/include/asm/paravirt.h:338:9: error: Expected ( after asm
./arch/x86/include/asm/paravirt.h:338:9: error: got __inline
./arch/x86/include/asm/paravirt.h:343:9: error: Expected ( after asm
./arch/x86/include/asm/paravirt.h:343:9: error: got __inline
./arch/x86/include/asm/paravirt.h:348:9: error: Expected ( after asm
./arch/x86/include/asm/paravirt.h:348:9: error: too many errors

Any way to suppress or I am doing something wrong?  I just run the 2
make commands:

make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

> regards,
> dan carpenter
>

2020-04-22 22:03:25

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver



On 2020-04-22 9:13 a.m., Scott Branden wrote:
>
>
> On 2020-04-22 4:35 a.m., Dan Carpenter wrote:
>> On Wed, Apr 22, 2020 at 07:17:34PM +0800, kbuild test robot wrote:
>>> Hi Scott,
>>>
>>> I love your patch! Perhaps something to improve:
>>>
>>> [auto build test WARNING on driver-core/driver-core-testing]
>>> [also build test WARNING on next-20200421]
>>> [cannot apply to char-misc/char-misc-testing kselftest/next
>>> linus/master v5.7-rc2]
>>> [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/Scott-Branden/firmware-add-partial-read-support-in-request_firmware_into_buf/20200422-114528
>>> base:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
>>> 55623260bb33e2ab849af76edf2253bc04cb241f
>>> reproduce:
>>>          # apt-get install sparse
>>>          # sparse version: v0.6.1-191-gc51a0382-dirty
>>>          make ARCH=x86_64 allmodconfig
>>>          make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>>                                             ^^^^^^^^^^^^^^^^^^^
>>
>> Sorry, you asked me about this earlier.  You will need to add
>> -D__CHECK_ENDIAN__ to enable these Sparse warnings.
> This is strange.  I ran the sparse build and thought I had fixed all
> the issues.
> I'll have to try again.
>
> One other question with the sparse build.  I get many of the messages
> printed but the build seems to go to the end (even without my patches
> applied):
> ./arch/x86/include/asm/paravirt.h:333:9: error: got __inline
> ./arch/x86/include/asm/paravirt.h:338:9: error: Expected ( after asm
> ./arch/x86/include/asm/paravirt.h:338:9: error: got __inline
> ./arch/x86/include/asm/paravirt.h:343:9: error: Expected ( after asm
> ./arch/x86/include/asm/paravirt.h:343:9: error: got __inline
> ./arch/x86/include/asm/paravirt.h:348:9: error: Expected ( after asm
> ./arch/x86/include/asm/paravirt.h:348:9: error: too many errors
>
> Any way to suppress or I am doing something wrong?  I just run the 2
> make commands:
>
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
I figured out the sparse utility on ubuntu 18.04 is out of date causing
the issue.
>
>> regards,
>> dan carpenter
>>
>

2020-05-05 23:59:48

by Scott Branden

[permalink] [raw]
Subject: Re: [PATCH v3 6/7] misc: bcm-vk: add Broadcom VK driver

All the kbuild and sparse issues should be resolved in PATCH v4.

On 2020-04-22 4:17 a.m., kbuild test robot wrote:
> Hi Scott,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on driver-core/driver-core-testing]
> [also build test WARNING on next-20200421]
> [cannot apply to char-misc/char-misc-testing kselftest/next linus/master v5.7-rc2]
> [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/Scott-Branden/firmware-add-partial-read-support-in-request_firmware_into_buf/20200422-114528
> base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 55623260bb33e2ab849af76edf2253bc04cb241f
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.1-191-gc51a0382-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 <[email protected]>
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bcm_vk_peer_log *p_ctl @@ got struct bcm_vk_peer_log *p_ctl @@
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: expected struct bcm_vk_peer_log *p_ctl
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:189:15: sparse: got void [noderef] <asn:2> *
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got oderef] <asn:1> *from @@
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: expected void const [noderef] <asn:1> *from
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:685:36: sparse: got struct vk_image *arg
> drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] <asn:1> *from @@ got oderef] <asn:1> *from @@
> drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: expected void const [noderef] <asn:1> *from
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:780:36: sparse: got struct vk_reset *arg
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct vk_image *arg @@ got void [nstruct vk_image *arg @@
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: expected struct vk_image *arg
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:858:45: sparse: got void [noderef] <asn:1> *argp
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct vk_reset *arg @@ got void [nstruct vk_reset *arg @@
>>> drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: expected struct vk_reset *arg
> drivers/misc/bcm-vk/bcm_vk_dev.c:862:40: sparse: got void [noderef] <asn:1> *argp
> --
>>> drivers/misc/bcm-vk/bcm_vk_msg.c:507:17: sparse: sparse: cast removes address space '<asn:2>' of expression
> drivers/misc/bcm-vk/bcm_vk_msg.c:707:15: sparse: sparse: cast removes address space '<asn:2>' of expression
> drivers/misc/bcm-vk/bcm_vk_msg.c:715:23: sparse: sparse: cast removes address space '<asn:2>' of expression
> drivers/misc/bcm-vk/bcm_vk_msg.c:871:31: sparse: sparse: cast removes address space '<asn:2>' of expression
> drivers/misc/bcm-vk/bcm_vk_msg.c:899:47: sparse: sparse: cast removes address space '<asn:2>' of expression
>
> vim +189 drivers/misc/bcm-vk/bcm_vk_dev.c
>
> 180
> 181 static void bcm_vk_dump_peer_log(struct bcm_vk *vk)
> 182 {
> 183 struct bcm_vk_peer_log log, *p_ctl;
> 184 char loc_buf[BCM_VK_PEER_LOG_LINE_MAX];
> 185 int cnt;
> 186 struct device *dev = &vk->pdev->dev;
> 187 uint data_offset;
> 188
> > 189 p_ctl = vk->bar[BAR_2] + vk->peerlog_off;
> 190 log = *p_ctl;
> 191 /* do a rmb() to make sure log is updated */
> 192 rmb();
> 193
> 194 dev_dbg(dev, "Peer PANIC: Size 0x%x(0x%x), [Rd Wr] = [%d %d]\n",
> 195 log.buf_size, log.mask, log.rd_idx, log.wr_idx);
> 196
> 197 cnt = 0;
> 198 data_offset = vk->peerlog_off + sizeof(struct bcm_vk_peer_log);
> 199 while (log.rd_idx != log.wr_idx) {
> 200 loc_buf[cnt] = vkread8(vk, BAR_2, data_offset + log.rd_idx);
> 201
> 202 if ((loc_buf[cnt] == '\0') ||
> 203 (cnt == (BCM_VK_PEER_LOG_LINE_MAX - 1))) {
> 204 dev_err(dev, "%s", loc_buf);
> 205 cnt = 0;
> 206 } else {
> 207 cnt++;
> 208 }
> 209 log.rd_idx = (log.rd_idx + 1) & log.mask;
> 210 }
> 211 /* update rd idx at the end */
> 212 vkwrite32(vk, log.rd_idx, BAR_2, vk->peerlog_off);
> 213 }
> 214
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]