Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces)
@ 2020-09-02  6:01 kernel test robot
  2020-09-02 11:52 ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2020-09-02  6:01 UTC (permalink / raw)
  To: Håkon Bugge
  Cc: kbuild-all, Doug Ledford, Jason Gunthorpe, linux-rdma,
	Jason Gunthorpe

[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
head:   524d8ffd07f0ca10b24011487339f836ed859b32
commit: 227a0e142e375909959a74b7782403e14331f6f3 [16/50] IB/mlx4: Add support for REJ due to timeout
config: i386-randconfig-s001-20200902 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        git checkout 227a0e142e375909959a74b7782403e14331f6f3
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct rej_tmout_entry *item @@     got void [noderef] __rcu * @@
>> drivers/infiniband/hw/mlx4/cm.c:496:48: sparse:     expected struct rej_tmout_entry *item
>> drivers/infiniband/hw/mlx4/cm.c:496:48: sparse:     got void [noderef] __rcu *

# https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=227a0e142e375909959a74b7782403e14331f6f3
git remote add rdma https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
git fetch --no-tags rdma for-next
git checkout 227a0e142e375909959a74b7782403e14331f6f3
vim +496 drivers/infiniband/hw/mlx4/cm.c

   486	
   487	static void rej_tmout_tree_cleanup(struct mlx4_ib_sriov *sriov, int slave)
   488	{
   489		struct radix_tree_iter iter;
   490		bool flush_needed = false;
   491		__rcu void **slot;
   492		int cnt = 0;
   493	
   494		mutex_lock(&sriov->rej_tmout_lock);
   495		radix_tree_for_each_slot(slot, &sriov->rej_tmout_root, &iter, 0) {
 > 496			struct rej_tmout_entry *item = *slot;
   497	
   498			if (slave < 0 || slave == item->slave) {
   499				mod_delayed_work(system_wq, &item->timeout, 0);
   500				flush_needed = true;
   501				++cnt;
   502			}
   503		}
   504		mutex_unlock(&sriov->rej_tmout_lock);
   505	
   506		if (flush_needed) {
   507			flush_scheduled_work();
   508			pr_debug("Deleted %d entries in radix_tree for slave %d during cleanup\n",
   509				 slave, cnt);
   510		}
   511	}
   512	

---
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: 45842 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-09-02  6:01 [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot
@ 2020-09-02 11:52 ` Jason Gunthorpe
  2020-09-02 12:18   ` Håkon Bugge
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2020-09-02 11:52 UTC (permalink / raw)
  To: kernel test robot
  Cc: Håkon Bugge, kbuild-all, Doug Ledford, Jason Gunthorpe,
	linux-rdma

On Wed, Sep 02, 2020 at 02:01:41PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
> head:   524d8ffd07f0ca10b24011487339f836ed859b32
> commit: 227a0e142e375909959a74b7782403e14331f6f3 [16/50] IB/mlx4: Add support for REJ due to timeout
> config: i386-randconfig-s001-20200902 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
>         # apt-get install sparse
>         # sparse version: v0.6.2-191-g10164920-dirty
>         git checkout 227a0e142e375909959a74b7782403e14331f6f3
>         # save the attached .config to linux build tree
>         make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>

Gah!

Håkon, radix trees are not allowed please change this to xarray!

Thanks,
Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-09-02 11:52 ` Jason Gunthorpe
@ 2020-09-02 12:18   ` Håkon Bugge
  2020-09-02 12:40     ` Jason Gunthorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Håkon Bugge @ 2020-09-02 12:18 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: kernel test robot, kbuild-all, Doug Ledford, Jason Gunthorpe,
	OFED mailing list



> On 2 Sep 2020, at 13:52, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Wed, Sep 02, 2020 at 02:01:41PM +0800, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
>> head:   524d8ffd07f0ca10b24011487339f836ed859b32
>> commit: 227a0e142e375909959a74b7782403e14331f6f3 [16/50] IB/mlx4: Add support for REJ due to timeout
>> config: i386-randconfig-s001-20200902 (attached as .config)
>> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
>> reproduce:
>>        # apt-get install sparse
>>        # sparse version: v0.6.2-191-g10164920-dirty
>>        git checkout 227a0e142e375909959a74b7782403e14331f6f3
>>        # save the attached .config to linux build tree
>>        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 
>> 
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
> 
> Gah!
> 
> Håkon, radix trees are not allowed please change this to xarray!

I believe this is lack of __rcu in the variable definition. I started with

	void **slot; 

but sparse didn't like it, so I changed it to:

	__rcu void **slot;

sparse liked that, but then it didn't like:

	struct rej_tmout_entry *item = *slot;

Shall I change that to:

	struct rej_tmout_entry *item = rcu_dereference_protected(*slot, true);

?


Not sure why I need to meld in this rcu stuff when everything is protected by a mutex anyway.

Please advice,


Håkon



> 
> Thanks,
> Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-09-02 12:18   ` Håkon Bugge
@ 2020-09-02 12:40     ` Jason Gunthorpe
  2020-09-02 13:06       ` Håkon Bugge
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2020-09-02 12:40 UTC (permalink / raw)
  To: Håkon Bugge
  Cc: kernel test robot, kbuild-all, Doug Ledford, Jason Gunthorpe,
	OFED mailing list

On Wed, Sep 02, 2020 at 02:18:27PM +0200, Håkon Bugge wrote:
> 
> 
> > On 2 Sep 2020, at 13:52, Jason Gunthorpe <jgg@nvidia.com> wrote:
> > 
> > On Wed, Sep 02, 2020 at 02:01:41PM +0800, kernel test robot wrote:
> >> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
> >> head:   524d8ffd07f0ca10b24011487339f836ed859b32
> >> commit: 227a0e142e375909959a74b7782403e14331f6f3 [16/50] IB/mlx4: Add support for REJ due to timeout
> >> config: i386-randconfig-s001-20200902 (attached as .config)
> >> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> >> reproduce:
> >>        # apt-get install sparse
> >>        # sparse version: v0.6.2-191-g10164920-dirty
> >>        git checkout 227a0e142e375909959a74b7782403e14331f6f3
> >>        # save the attached .config to linux build tree
> >>        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 
> >> 
> >> If you fix the issue, kindly add following tag as appropriate
> >> Reported-by: kernel test robot <lkp@intel.com>
> > 
> > Gah!
> > 
> > Håkon, radix trees are not allowed please change this to xarray!
> 
> I believe this is lack of __rcu in the variable definition. I started with
> 
> 	void **slot; 
> 
> but sparse didn't like it, so I changed it to:
> 
> 	__rcu void **slot;
> 
> sparse liked that, but then it didn't like:
> 
> 	struct rej_tmout_entry *item = *slot;
> 
> Shall I change that to:
> 
> 	struct rej_tmout_entry *item = rcu_dereference_protected(*slot, true);
> 
> ?
> 
> 
> Not sure why I need to meld in this rcu stuff when everything is protected by a mutex anyway.
> 
> Please advice,

Change to xarray.

Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces)
  2020-09-02 12:40     ` Jason Gunthorpe
@ 2020-09-02 13:06       ` Håkon Bugge
  0 siblings, 0 replies; 5+ messages in thread
From: Håkon Bugge @ 2020-09-02 13:06 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: kernel test robot, kbuild-all, Doug Ledford, Jason Gunthorpe,
	OFED mailing list



> On 2 Sep 2020, at 14:40, Jason Gunthorpe <jgg@nvidia.com> wrote:
> 
> On Wed, Sep 02, 2020 at 02:18:27PM +0200, Håkon Bugge wrote:
>> 
>> 
>>> On 2 Sep 2020, at 13:52, Jason Gunthorpe <jgg@nvidia.com> wrote:
>>> 
>>> On Wed, Sep 02, 2020 at 02:01:41PM +0800, kernel test robot wrote:
>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
>>>> head:   524d8ffd07f0ca10b24011487339f836ed859b32
>>>> commit: 227a0e142e375909959a74b7782403e14331f6f3 [16/50] IB/mlx4: Add support for REJ due to timeout
>>>> config: i386-randconfig-s001-20200902 (attached as .config)
>>>> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
>>>> reproduce:
>>>>       # apt-get install sparse
>>>>       # sparse version: v0.6.2-191-g10164920-dirty
>>>>       git checkout 227a0e142e375909959a74b7782403e14331f6f3
>>>>       # save the attached .config to linux build tree
>>>>       make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 
>>>> 
>>>> If you fix the issue, kindly add following tag as appropriate
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>> 
>>> Gah!
>>> 
>>> Håkon, radix trees are not allowed please change this to xarray!
>> 
>> I believe this is lack of __rcu in the variable definition. I started with
>> 
>> 	void **slot; 
>> 
>> but sparse didn't like it, so I changed it to:
>> 
>> 	__rcu void **slot;
>> 
>> sparse liked that, but then it didn't like:
>> 
>> 	struct rej_tmout_entry *item = *slot;
>> 
>> Shall I change that to:
>> 
>> 	struct rej_tmout_entry *item = rcu_dereference_protected(*slot, true);
>> 
>> ?
>> 
>> 
>> Not sure why I need to meld in this rcu stuff when everything is protected by a mutex anyway.
>> 
>> Please advice,
> 
> Change to xarray.

Understood. It has to be converted anyway, now is probably the best time.


Thxs, Håkon

> 
> Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-02 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02  6:01 [rdma:for-next 16/50] drivers/infiniband/hw/mlx4/cm.c:496:48: sparse: sparse: incorrect type in initializer (different address spaces) kernel test robot
2020-09-02 11:52 ` Jason Gunthorpe
2020-09-02 12:18   ` Håkon Bugge
2020-09-02 12:40     ` Jason Gunthorpe
2020-09-02 13:06       ` Håkon Bugge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox