[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208240755.o30qG0I2-lkp@intel.com>
Date: Wed, 24 Aug 2022 07:53:11 +0800
From: kernel test robot <lkp@...el.com>
To: unlisted-recipients:; (no To-header on input)
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
nick johnstone <nicholas.johnstone@...el.com>
Subject: [mchinth:socwatch_linux_6_0 1/1] drivers/clk/clk.c:867:6: error:
redefinition of 'clk_unprepare'
Hi nick,
First bad commit (maybe != root cause):
tree: https://github.com/mchinth/linux socwatch_linux_6_0
head: d9fa8b4c86d4bc7ccdfcf4ce00a91cbfb5869296
commit: d9fa8b4c86d4bc7ccdfcf4ce00a91cbfb5869296 [1/1] updated socwatch drivers
config: m68k-buildonly-randconfig-r005-20220823 (https://download.01.org/0day-ci/archive/20220824/202208240755.o30qG0I2-lkp@intel.com/config)
compiler: m68k-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://github.com/mchinth/linux/commit/d9fa8b4c86d4bc7ccdfcf4ce00a91cbfb5869296
git remote add mchinth https://github.com/mchinth/linux
git fetch --no-tags mchinth socwatch_linux_6_0
git checkout d9fa8b4c86d4bc7ccdfcf4ce00a91cbfb5869296
# 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=m68k SHELL=/bin/bash drivers/clk/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> drivers/clk/clk.c:867:6: error: redefinition of 'clk_unprepare'
867 | 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:948:5: error: redefinition of 'clk_prepare'
948 | 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:1194:6: error: redefinition of 'clk_is_enabled_when_prepared'
1194 | 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 [y]:
- PMC_ATOM [=y] && PCI [=y]
vim +/clk_unprepare +867 drivers/clk/clk.c
a6adc30ba7bef8d Dong Aisheng 2016-06-30 855
4dff95dc9477a34 Stephen Boyd 2015-04-30 856 /**
4dff95dc9477a34 Stephen Boyd 2015-04-30 857 * clk_unprepare - undo preparation of a clock source
4dff95dc9477a34 Stephen Boyd 2015-04-30 858 * @clk: the clk being unprepared
4dff95dc9477a34 Stephen Boyd 2015-04-30 859 *
4dff95dc9477a34 Stephen Boyd 2015-04-30 860 * clk_unprepare may sleep, which differentiates it from clk_disable. In a
4dff95dc9477a34 Stephen Boyd 2015-04-30 861 * simple case, clk_unprepare can be used instead of clk_disable to gate a clk
4dff95dc9477a34 Stephen Boyd 2015-04-30 862 * if the operation may sleep. One example is a clk which is accessed over
4dff95dc9477a34 Stephen Boyd 2015-04-30 863 * I2c. In the complex case a clk gate operation may require a fast and a slow
4dff95dc9477a34 Stephen Boyd 2015-04-30 864 * part. It is this reason that clk_unprepare and clk_disable are not mutually
4dff95dc9477a34 Stephen Boyd 2015-04-30 865 * exclusive. In fact clk_disable must be called before clk_unprepare.
4dff95dc9477a34 Stephen Boyd 2015-04-30 866 */
4dff95dc9477a34 Stephen Boyd 2015-04-30 @867 void clk_unprepare(struct clk *clk)
b2476490ef11134 Mike Turquette 2012-03-15 868 {
4dff95dc9477a34 Stephen Boyd 2015-04-30 869 if (IS_ERR_OR_NULL(clk))
4dff95dc9477a34 Stephen Boyd 2015-04-30 870 return;
b2476490ef11134 Mike Turquette 2012-03-15 871
a6adc30ba7bef8d Dong Aisheng 2016-06-30 872 clk_core_unprepare_lock(clk->core);
1e435256d625c20 Olof Johansson 2013-04-27 873 }
4dff95dc9477a34 Stephen Boyd 2015-04-30 874 EXPORT_SYMBOL_GPL(clk_unprepare);
1e435256d625c20 Olof Johansson 2013-04-27 875
4dff95dc9477a34 Stephen Boyd 2015-04-30 876 static int clk_core_prepare(struct clk_core *core)
4dff95dc9477a34 Stephen Boyd 2015-04-30 877 {
4dff95dc9477a34 Stephen Boyd 2015-04-30 878 int ret = 0;
b2476490ef11134 Mike Turquette 2012-03-15 879
a63347251907d7f Stephen Boyd 2015-05-06 880 lockdep_assert_held(&prepare_lock);
a63347251907d7f Stephen Boyd 2015-05-06 881
4dff95dc9477a34 Stephen Boyd 2015-04-30 882 if (!core)
4dff95dc9477a34 Stephen Boyd 2015-04-30 883 return 0;
b2476490ef11134 Mike Turquette 2012-03-15 884
4dff95dc9477a34 Stephen Boyd 2015-04-30 885 if (core->prepare_count == 0) {
9a34b45397e5a38 Marek Szyprowski 2017-08-21 886 ret = clk_pm_runtime_get(core);
4dff95dc9477a34 Stephen Boyd 2015-04-30 887 if (ret)
4dff95dc9477a34 Stephen Boyd 2015-04-30 888 return ret;
b2476490ef11134 Mike Turquette 2012-03-15 889
9a34b45397e5a38 Marek Szyprowski 2017-08-21 890 ret = clk_core_prepare(core->parent);
9a34b45397e5a38 Marek Szyprowski 2017-08-21 891 if (ret)
9a34b45397e5a38 Marek Szyprowski 2017-08-21 892 goto runtime_put;
9a34b45397e5a38 Marek Szyprowski 2017-08-21 893
4dff95dc9477a34 Stephen Boyd 2015-04-30 894 trace_clk_prepare(core);
1c155b3dfe08351 Ulf Hansson 2013-03-12 895
4dff95dc9477a34 Stephen Boyd 2015-04-30 896 if (core->ops->prepare)
4dff95dc9477a34 Stephen Boyd 2015-04-30 897 ret = core->ops->prepare(core->hw);
1c155b3dfe08351 Ulf Hansson 2013-03-12 898
4dff95dc9477a34 Stephen Boyd 2015-04-30 899 trace_clk_prepare_complete(core);
b2476490ef11134 Mike Turquette 2012-03-15 900
9a34b45397e5a38 Marek Szyprowski 2017-08-21 901 if (ret)
9a34b45397e5a38 Marek Szyprowski 2017-08-21 902 goto unprepare;
b2476490ef11134 Mike Turquette 2012-03-15 903 }
b2476490ef11134 Mike Turquette 2012-03-15 904
4dff95dc9477a34 Stephen Boyd 2015-04-30 905 core->prepare_count++;
b2476490ef11134 Mike Turquette 2012-03-15 906
9461f7b33d11cbb Jerome Brunet 2018-06-19 907 /*
9461f7b33d11cbb Jerome Brunet 2018-06-19 908 * CLK_SET_RATE_GATE is a special case of clock protection
9461f7b33d11cbb Jerome Brunet 2018-06-19 909 * Instead of a consumer claiming exclusive rate control, it is
9461f7b33d11cbb Jerome Brunet 2018-06-19 910 * actually the provider which prevents any consumer from making any
9461f7b33d11cbb Jerome Brunet 2018-06-19 911 * operation which could result in a rate change or rate glitch while
9461f7b33d11cbb Jerome Brunet 2018-06-19 912 * the clock is prepared.
9461f7b33d11cbb Jerome Brunet 2018-06-19 913 */
9461f7b33d11cbb Jerome Brunet 2018-06-19 914 if (core->flags & CLK_SET_RATE_GATE)
9461f7b33d11cbb Jerome Brunet 2018-06-19 915 clk_core_rate_protect(core);
9461f7b33d11cbb Jerome Brunet 2018-06-19 916
4dff95dc9477a34 Stephen Boyd 2015-04-30 917 return 0;
9a34b45397e5a38 Marek Szyprowski 2017-08-21 918 unprepare:
9a34b45397e5a38 Marek Szyprowski 2017-08-21 919 clk_core_unprepare(core->parent);
9a34b45397e5a38 Marek Szyprowski 2017-08-21 920 runtime_put:
9a34b45397e5a38 Marek Szyprowski 2017-08-21 921 clk_pm_runtime_put(core);
9a34b45397e5a38 Marek Szyprowski 2017-08-21 922 return ret;
b2476490ef11134 Mike Turquette 2012-03-15 923 }
b2476490ef11134 Mike Turquette 2012-03-15 924
a6adc30ba7bef8d Dong Aisheng 2016-06-30 925 static int clk_core_prepare_lock(struct clk_core *core)
a6adc30ba7bef8d Dong Aisheng 2016-06-30 926 {
a6adc30ba7bef8d Dong Aisheng 2016-06-30 927 int ret;
a6adc30ba7bef8d Dong Aisheng 2016-06-30 928
a6adc30ba7bef8d Dong Aisheng 2016-06-30 929 clk_prepare_lock();
a6adc30ba7bef8d Dong Aisheng 2016-06-30 930 ret = clk_core_prepare(core);
a6adc30ba7bef8d Dong Aisheng 2016-06-30 931 clk_prepare_unlock();
a6adc30ba7bef8d Dong Aisheng 2016-06-30 932
a6adc30ba7bef8d Dong Aisheng 2016-06-30 933 return ret;
a6adc30ba7bef8d Dong Aisheng 2016-06-30 934 }
a6adc30ba7bef8d Dong Aisheng 2016-06-30 935
4dff95dc9477a34 Stephen Boyd 2015-04-30 936 /**
4dff95dc9477a34 Stephen Boyd 2015-04-30 937 * clk_prepare - prepare a clock source
4dff95dc9477a34 Stephen Boyd 2015-04-30 938 * @clk: the clk being prepared
4dff95dc9477a34 Stephen Boyd 2015-04-30 939 *
4dff95dc9477a34 Stephen Boyd 2015-04-30 940 * clk_prepare may sleep, which differentiates it from clk_enable. In a simple
4dff95dc9477a34 Stephen Boyd 2015-04-30 941 * case, clk_prepare can be used instead of clk_enable to ungate a clk if the
4dff95dc9477a34 Stephen Boyd 2015-04-30 942 * operation may sleep. One example is a clk which is accessed over I2c. In
4dff95dc9477a34 Stephen Boyd 2015-04-30 943 * the complex case a clk ungate operation may require a fast and a slow part.
4dff95dc9477a34 Stephen Boyd 2015-04-30 944 * It is this reason that clk_prepare and clk_enable are not mutually
4dff95dc9477a34 Stephen Boyd 2015-04-30 945 * exclusive. In fact clk_prepare must be called before clk_enable.
4dff95dc9477a34 Stephen Boyd 2015-04-30 946 * Returns 0 on success, -EERROR otherwise.
4dff95dc9477a34 Stephen Boyd 2015-04-30 947 */
4dff95dc9477a34 Stephen Boyd 2015-04-30 @948 int clk_prepare(struct clk *clk)
b2476490ef11134 Mike Turquette 2012-03-15 949 {
035a61c314eb3da Tomeu Vizoso 2015-01-23 950 if (!clk)
4dff95dc9477a34 Stephen Boyd 2015-04-30 951 return 0;
035a61c314eb3da Tomeu Vizoso 2015-01-23 952
a6adc30ba7bef8d Dong Aisheng 2016-06-30 953 return clk_core_prepare_lock(clk->core);
7ef3dcc8145263c James Hogan 2013-07-29 954 }
4dff95dc9477a34 Stephen Boyd 2015-04-30 955 EXPORT_SYMBOL_GPL(clk_prepare);
035a61c314eb3da Tomeu Vizoso 2015-01-23 956
:::::: The code at line 867 was first introduced by commit
:::::: 4dff95dc9477a34de77d24c59dcf1dc593687fcf clk: Remove forward declared function prototypes
:::::: TO: Stephen Boyd <sboyd@...eaurora.org>
:::::: CC: Stephen Boyd <sboyd@...eaurora.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists