include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type 'struct dpll_pin'

From: kernel test robot
Date: Fri Mar 01 2024 - 03:45:50 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 87adedeba51a822533649b143232418b9e26d08b
commit: 0d60d8df6f493bb46bf5db40d39dd60a1bafdd4e dpll: rely on rcu for netdev_dpll_pin()
date: 3 days ago
config: i386-randconfig-141-20240228 (https://download.01.org/0day-ci/archive/20240301/202403011658.jcZIoLY9-lkp@xxxxxxxxx/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240301/202403011658.jcZIoLY9-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/202403011658.jcZIoLY9-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/radix-tree.h:18:0,
from include/linux/idr.h:15,
from include/linux/kernfs.h:12,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:20,
from include/linux/energy_model.h:7,
from include/linux/device.h:16,
from drivers/dpll/dpll_core.c:11:
include/linux/dpll.h: In function 'netdev_dpll_pin':
>> include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type 'struct dpll_pin'
typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
^
include/linux/rcupdate.h:587:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rtnetlink.h:70:2: note: in expansion of macro 'rcu_dereference_check'
rcu_dereference_check(p, lockdep_rtnl_is_held())
^~~~~~~~~~~~~~~~~~~~~
include/linux/dpll.h:175:9: note: in expansion of macro 'rcu_dereference_rtnl'
return rcu_dereference_rtnl(dev->dpll_pin);
^~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/rbtree.h:24:0,
from include/linux/mm_types.h:11,
from include/linux/mmzone.h:22,
from include/linux/gfp.h:7,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:17,
from net/core/rtnetlink.c:17:
include/linux/dpll.h: In function 'netdev_dpll_pin':
>> include/linux/rcupdate.h:439:9: error: dereferencing pointer to incomplete type 'struct dpll_pin'
typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
^
include/linux/rcupdate.h:587:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), __UNIQUE_ID(rcu), \
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/rtnetlink.h:70:2: note: in expansion of macro 'rcu_dereference_check'
rcu_dereference_check(p, lockdep_rtnl_is_held())
^~~~~~~~~~~~~~~~~~~~~
include/linux/dpll.h:175:9: note: in expansion of macro 'rcu_dereference_rtnl'
return rcu_dereference_rtnl(dev->dpll_pin);
^~~~~~~~~~~~~~~~~~~~
In file included from net/core/rtnetlink.c:60:0:
include/linux/dpll.h:179:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^


vim +439 include/linux/rcupdate.h

76c8eaafe4f061 Paul E. McKenney 2021-04-21 429
24ba53017e188e Chun-Hung Tseng 2021-09-15 430 #define __rcu_access_pointer(p, local, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 431 ({ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 432 typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 433) rcu_check_sparse(p, space); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 434 ((typeof(*p) __force __kernel *)(local)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 435 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 436 #define __rcu_dereference_check(p, local, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 437 ({ \
ac59853c06993a Pranith Kumar 2014-11-13 438 /* Dependency order vs. p above. */ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 @439 typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 440 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 441) rcu_check_sparse(p, space); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 442 ((typeof(*p) __force __kernel *)(local)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 443 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 444 #define __rcu_dereference_protected(p, local, c, space) \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 445 ({ \
f78f5b90c4ffa5 Paul E. McKenney 2015-06-18 446 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
423a86a610cad1 Joel Fernandes (Google 2018-12-12 447) rcu_check_sparse(p, space); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 448 ((typeof(*p) __force __kernel *)(p)); \
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 449 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 450 #define __rcu_dereference_raw(p, local) \
995f1405610bd8 Paul E. McKenney 2016-07-01 451 ({ \
995f1405610bd8 Paul E. McKenney 2016-07-01 452 /* Dependency order vs. p above. */ \
24ba53017e188e Chun-Hung Tseng 2021-09-15 453 typeof(p) local = READ_ONCE(p); \
24ba53017e188e Chun-Hung Tseng 2021-09-15 454 ((typeof(*p) __force __kernel *)(local)); \
995f1405610bd8 Paul E. McKenney 2016-07-01 455 })
24ba53017e188e Chun-Hung Tseng 2021-09-15 456 #define rcu_dereference_raw(p) __rcu_dereference_raw(p, __UNIQUE_ID(rcu))
ca5ecddfa8fcbd Paul E. McKenney 2010-04-28 457

:::::: The code at line 439 was first introduced by commit
:::::: 24ba53017e188e031f9cb8b290286fad52d2af00 rcu: Replace ________p1 and _________p1 with __UNIQUE_ID(rcu)

:::::: TO: Chun-Hung Tseng <henrybear327@xxxxxxxxx>
:::::: CC: Paul E. McKenney <paulmck@xxxxxxxxxx>

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