Hi Marco, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: f8f60f322f0640c8edda2942ca5f84b7a27c417a commit: 80a21da360516fa602f3a50eb9792f9dfbfb5fdb [3052/7443] media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver config: sh-allmodconfig compiler: sh4-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=80a21da360516fa602f3a50eb9792f9dfbfb5fdb git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 80a21da360516fa602f3a50eb9792f9dfbfb5fdb # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): >> drivers/clk/clk.c:941:6: error: redefinition of 'clk_unprepare' 941 | void clk_unprepare(struct clk *clk) | ^~~~~~~~~~~~~ In file included from drivers/clk/clk.c:9: include/linux/clk.h:303:20: note: previous definition of 'clk_unprepare' with type 'void(struct clk *)' 303 | static inline void clk_unprepare(struct clk *clk) | ^~~~~~~~~~~~~ >> drivers/clk/clk.c:1022:5: error: redefinition of 'clk_prepare' 1022 | int clk_prepare(struct clk *clk) | ^~~~~~~~~~~ include/linux/clk.h:271:19: note: previous definition of 'clk_prepare' with type 'int(struct clk *)' 271 | static inline int clk_prepare(struct clk *clk) | ^~~~~~~~~~~ >> drivers/clk/clk.c:1268:6: error: redefinition of 'clk_is_enabled_when_prepared' 1268 | bool clk_is_enabled_when_prepared(struct clk *clk) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/clk.h:284:20: note: previous definition of 'clk_is_enabled_when_prepared' with type 'bool(struct clk *)' {aka '_Bool(struct clk *)'} 284 | static inline bool clk_is_enabled_when_prepared(struct clk *clk) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for COMMON_CLK Depends on [n]: !HAVE_LEGACY_CLK [=y] Selected by [m]: - VIDEO_TC358746 [=m] && MEDIA_SUPPORT [=m] && VIDEO_DEV [=m] && PM [=y] && I2C [=m] vim +/clk_prepare +1022 drivers/clk/clk.c a6adc30ba7bef8 Dong Aisheng 2016-06-30 929 4dff95dc9477a3 Stephen Boyd 2015-04-30 930 /** 4dff95dc9477a3 Stephen Boyd 2015-04-30 931 * clk_unprepare - undo preparation of a clock source 4dff95dc9477a3 Stephen Boyd 2015-04-30 932 * @clk: the clk being unprepared 4dff95dc9477a3 Stephen Boyd 2015-04-30 933 * 4dff95dc9477a3 Stephen Boyd 2015-04-30 934 * clk_unprepare may sleep, which differentiates it from clk_disable. In a 4dff95dc9477a3 Stephen Boyd 2015-04-30 935 * simple case, clk_unprepare can be used instead of clk_disable to gate a clk 4dff95dc9477a3 Stephen Boyd 2015-04-30 936 * if the operation may sleep. One example is a clk which is accessed over 4dff95dc9477a3 Stephen Boyd 2015-04-30 937 * I2c. In the complex case a clk gate operation may require a fast and a slow 4dff95dc9477a3 Stephen Boyd 2015-04-30 938 * part. It is this reason that clk_unprepare and clk_disable are not mutually 4dff95dc9477a3 Stephen Boyd 2015-04-30 939 * exclusive. In fact clk_disable must be called before clk_unprepare. 4dff95dc9477a3 Stephen Boyd 2015-04-30 940 */ 4dff95dc9477a3 Stephen Boyd 2015-04-30 @941 void clk_unprepare(struct clk *clk) b2476490ef1113 Mike Turquette 2012-03-15 942 { 4dff95dc9477a3 Stephen Boyd 2015-04-30 943 if (IS_ERR_OR_NULL(clk)) 4dff95dc9477a3 Stephen Boyd 2015-04-30 944 return; b2476490ef1113 Mike Turquette 2012-03-15 945 a6adc30ba7bef8 Dong Aisheng 2016-06-30 946 clk_core_unprepare_lock(clk->core); 1e435256d625c2 Olof Johansson 2013-04-27 947 } 4dff95dc9477a3 Stephen Boyd 2015-04-30 948 EXPORT_SYMBOL_GPL(clk_unprepare); 1e435256d625c2 Olof Johansson 2013-04-27 949 4dff95dc9477a3 Stephen Boyd 2015-04-30 950 static int clk_core_prepare(struct clk_core *core) 4dff95dc9477a3 Stephen Boyd 2015-04-30 951 { 4dff95dc9477a3 Stephen Boyd 2015-04-30 952 int ret = 0; b2476490ef1113 Mike Turquette 2012-03-15 953 a63347251907d7 Stephen Boyd 2015-05-06 954 lockdep_assert_held(&prepare_lock); a63347251907d7 Stephen Boyd 2015-05-06 955 4dff95dc9477a3 Stephen Boyd 2015-04-30 956 if (!core) 4dff95dc9477a3 Stephen Boyd 2015-04-30 957 return 0; b2476490ef1113 Mike Turquette 2012-03-15 958 4dff95dc9477a3 Stephen Boyd 2015-04-30 959 if (core->prepare_count == 0) { 9a34b45397e5a3 Marek Szyprowski 2017-08-21 960 ret = clk_pm_runtime_get(core); 4dff95dc9477a3 Stephen Boyd 2015-04-30 961 if (ret) 4dff95dc9477a3 Stephen Boyd 2015-04-30 962 return ret; b2476490ef1113 Mike Turquette 2012-03-15 963 9a34b45397e5a3 Marek Szyprowski 2017-08-21 964 ret = clk_core_prepare(core->parent); 9a34b45397e5a3 Marek Szyprowski 2017-08-21 965 if (ret) 9a34b45397e5a3 Marek Szyprowski 2017-08-21 966 goto runtime_put; 9a34b45397e5a3 Marek Szyprowski 2017-08-21 967 4dff95dc9477a3 Stephen Boyd 2015-04-30 968 trace_clk_prepare(core); 1c155b3dfe0835 Ulf Hansson 2013-03-12 969 4dff95dc9477a3 Stephen Boyd 2015-04-30 970 if (core->ops->prepare) 4dff95dc9477a3 Stephen Boyd 2015-04-30 971 ret = core->ops->prepare(core->hw); 1c155b3dfe0835 Ulf Hansson 2013-03-12 972 4dff95dc9477a3 Stephen Boyd 2015-04-30 973 trace_clk_prepare_complete(core); b2476490ef1113 Mike Turquette 2012-03-15 974 9a34b45397e5a3 Marek Szyprowski 2017-08-21 975 if (ret) 9a34b45397e5a3 Marek Szyprowski 2017-08-21 976 goto unprepare; b2476490ef1113 Mike Turquette 2012-03-15 977 } b2476490ef1113 Mike Turquette 2012-03-15 978 4dff95dc9477a3 Stephen Boyd 2015-04-30 979 core->prepare_count++; b2476490ef1113 Mike Turquette 2012-03-15 980 9461f7b33d11cb Jerome Brunet 2018-06-19 981 /* 9461f7b33d11cb Jerome Brunet 2018-06-19 982 * CLK_SET_RATE_GATE is a special case of clock protection 9461f7b33d11cb Jerome Brunet 2018-06-19 983 * Instead of a consumer claiming exclusive rate control, it is 9461f7b33d11cb Jerome Brunet 2018-06-19 984 * actually the provider which prevents any consumer from making any 9461f7b33d11cb Jerome Brunet 2018-06-19 985 * operation which could result in a rate change or rate glitch while 9461f7b33d11cb Jerome Brunet 2018-06-19 986 * the clock is prepared. 9461f7b33d11cb Jerome Brunet 2018-06-19 987 */ 9461f7b33d11cb Jerome Brunet 2018-06-19 988 if (core->flags & CLK_SET_RATE_GATE) 9461f7b33d11cb Jerome Brunet 2018-06-19 989 clk_core_rate_protect(core); 9461f7b33d11cb Jerome Brunet 2018-06-19 990 4dff95dc9477a3 Stephen Boyd 2015-04-30 991 return 0; 9a34b45397e5a3 Marek Szyprowski 2017-08-21 992 unprepare: 9a34b45397e5a3 Marek Szyprowski 2017-08-21 993 clk_core_unprepare(core->parent); 9a34b45397e5a3 Marek Szyprowski 2017-08-21 994 runtime_put: 9a34b45397e5a3 Marek Szyprowski 2017-08-21 995 clk_pm_runtime_put(core); 9a34b45397e5a3 Marek Szyprowski 2017-08-21 996 return ret; b2476490ef1113 Mike Turquette 2012-03-15 997 } b2476490ef1113 Mike Turquette 2012-03-15 998 a6adc30ba7bef8 Dong Aisheng 2016-06-30 999 static int clk_core_prepare_lock(struct clk_core *core) a6adc30ba7bef8 Dong Aisheng 2016-06-30 1000 { a6adc30ba7bef8 Dong Aisheng 2016-06-30 1001 int ret; a6adc30ba7bef8 Dong Aisheng 2016-06-30 1002 a6adc30ba7bef8 Dong Aisheng 2016-06-30 1003 clk_prepare_lock(); a6adc30ba7bef8 Dong Aisheng 2016-06-30 1004 ret = clk_core_prepare(core); a6adc30ba7bef8 Dong Aisheng 2016-06-30 1005 clk_prepare_unlock(); a6adc30ba7bef8 Dong Aisheng 2016-06-30 1006 a6adc30ba7bef8 Dong Aisheng 2016-06-30 1007 return ret; a6adc30ba7bef8 Dong Aisheng 2016-06-30 1008 } a6adc30ba7bef8 Dong Aisheng 2016-06-30 1009 4dff95dc9477a3 Stephen Boyd 2015-04-30 1010 /** 4dff95dc9477a3 Stephen Boyd 2015-04-30 1011 * clk_prepare - prepare a clock source 4dff95dc9477a3 Stephen Boyd 2015-04-30 1012 * @clk: the clk being prepared 4dff95dc9477a3 Stephen Boyd 2015-04-30 1013 * 4dff95dc9477a3 Stephen Boyd 2015-04-30 1014 * clk_prepare may sleep, which differentiates it from clk_enable. In a simple 4dff95dc9477a3 Stephen Boyd 2015-04-30 1015 * case, clk_prepare can be used instead of clk_enable to ungate a clk if the 4dff95dc9477a3 Stephen Boyd 2015-04-30 1016 * operation may sleep. One example is a clk which is accessed over I2c. In 4dff95dc9477a3 Stephen Boyd 2015-04-30 1017 * the complex case a clk ungate operation may require a fast and a slow part. 4dff95dc9477a3 Stephen Boyd 2015-04-30 1018 * It is this reason that clk_prepare and clk_enable are not mutually 4dff95dc9477a3 Stephen Boyd 2015-04-30 1019 * exclusive. In fact clk_prepare must be called before clk_enable. 4dff95dc9477a3 Stephen Boyd 2015-04-30 1020 * Returns 0 on success, -EERROR otherwise. 4dff95dc9477a3 Stephen Boyd 2015-04-30 1021 */ 4dff95dc9477a3 Stephen Boyd 2015-04-30 @1022 int clk_prepare(struct clk *clk) b2476490ef1113 Mike Turquette 2012-03-15 1023 { 035a61c314eb3d Tomeu Vizoso 2015-01-23 1024 if (!clk) 4dff95dc9477a3 Stephen Boyd 2015-04-30 1025 return 0; 035a61c314eb3d Tomeu Vizoso 2015-01-23 1026 a6adc30ba7bef8 Dong Aisheng 2016-06-30 1027 return clk_core_prepare_lock(clk->core); 7ef3dcc8145263 James Hogan 2013-07-29 1028 } 4dff95dc9477a3 Stephen Boyd 2015-04-30 1029 EXPORT_SYMBOL_GPL(clk_prepare); 035a61c314eb3d Tomeu Vizoso 2015-01-23 1030 :::::: The code at line 1022 was first introduced by commit :::::: 4dff95dc9477a34de77d24c59dcf1dc593687fcf clk: Remove forward declared function prototypes :::::: TO: Stephen Boyd :::::: CC: Stephen Boyd -- 0-DAY CI Kernel Test Service https://01.org/lkp