[asm-generic:clkdev 4/5] drivers/clk/clk.c:723:6: error: redefinition of 'clk_rate_exclusive_put'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git clkdev
head:   3c150d2578b204c2e18c7ac6d967b43a614befbe
commit: b82125f4dd714ff85c00fdf585722f02a6929ade [4/5] clkdev: remove CONFIG_CLKDEV_LOOKUP
config: powerpc-randconfig-r016-20210531 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bc6799f2f79f0ae87e9f1ebf9d25ba799fbd25a9)
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
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/commit/?id=b82125f4dd714ff85c00fdf585722f02a6929ade
        git remote add asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
        git fetch --no-tags asm-generic clkdev
        git checkout b82125f4dd714ff85c00fdf585722f02a6929ade
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   In file included from drivers/clk/clk.c:9:
   In file included from include/linux/clk.h:13:
   In file included from include/linux/kernel.h:12:
   In file included from include/linux/bitops.h:32:
   In file included from arch/powerpc/include/asm/bitops.h:62:
   arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
   #define __lwsync()      __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
           ^
   <built-in>:308:9: note: previous definition is here
   #define __lwsync __builtin_ppc_lwsync
           ^
>> drivers/clk/clk.c:723:6: error: redefinition of 'clk_rate_exclusive_put'
   void clk_rate_exclusive_put(struct clk *clk)
        ^
   include/linux/clk.h:861:20: note: previous definition is here
   static inline void clk_rate_exclusive_put(struct clk *clk) {}
                      ^
>> drivers/clk/clk.c:789:5: error: redefinition of 'clk_rate_exclusive_get'
   int clk_rate_exclusive_get(struct clk *clk)
       ^
   include/linux/clk.h:856:19: note: previous definition is here
   static inline int clk_rate_exclusive_get(struct clk *clk)
                     ^
>> drivers/clk/clk.c:993:6: error: redefinition of 'clk_disable'
   void clk_disable(struct clk *clk)
        ^
   include/linux/clk.h:874:20: note: previous definition is here
   static inline void clk_disable(struct clk *clk) {}
                      ^
>> drivers/clk/clk.c:1106:5: error: redefinition of 'clk_save_context'
   int clk_save_context(void)
       ^
   include/linux/clk.h:936:19: note: previous definition is here
   static inline int clk_save_context(void)
                     ^
>> drivers/clk/clk.c:1133:6: error: redefinition of 'clk_restore_context'
   void clk_restore_context(void)
        ^
   include/linux/clk.h:941:20: note: previous definition is here
   static inline void clk_restore_context(void) {}
                      ^
>> drivers/clk/clk.c:1158:5: error: redefinition of 'clk_enable'
   int clk_enable(struct clk *clk)
       ^
   include/linux/clk.h:863:19: note: previous definition is here
   static inline int clk_enable(struct clk *clk)
                     ^
>> drivers/clk/clk.c:1458:6: error: redefinition of 'clk_round_rate'
   long clk_round_rate(struct clk *clk, unsigned long rate)
        ^
   include/linux/clk.h:895:20: note: previous definition is here
   static inline long clk_round_rate(struct clk *clk, unsigned long rate)
                      ^
>> drivers/clk/clk.c:1652:15: error: redefinition of 'clk_get_rate'
   unsigned long clk_get_rate(struct clk *clk)
                 ^
   include/linux/clk.h:880:29: note: previous definition is here
   static inline unsigned long clk_get_rate(struct clk *clk)
                               ^
>> drivers/clk/clk.c:2243:5: error: redefinition of 'clk_set_rate'
   int clk_set_rate(struct clk *clk, unsigned long rate)
       ^
   include/linux/clk.h:885:19: note: previous definition is here
   static inline int clk_set_rate(struct clk *clk, unsigned long rate)
                     ^
>> drivers/clk/clk.c:2286:5: error: redefinition of 'clk_set_rate_exclusive'
   int clk_set_rate_exclusive(struct clk *clk, unsigned long rate)
       ^
   include/linux/clk.h:890:19: note: previous definition is here
   static inline int clk_set_rate_exclusive(struct clk *clk, unsigned long rate)
                     ^
>> drivers/clk/clk.c:2322:5: error: redefinition of 'clk_set_rate_range'
   int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max)
       ^
   include/linux/clk.h:905:19: note: previous definition is here
   static inline int clk_set_rate_range(struct clk *clk, unsigned long min,
                     ^
>> drivers/clk/clk.c:2394:5: error: redefinition of 'clk_set_min_rate'
   int clk_set_min_rate(struct clk *clk, unsigned long rate)
       ^
   include/linux/clk.h:911:19: note: previous definition is here
   static inline int clk_set_min_rate(struct clk *clk, unsigned long rate)
                     ^
>> drivers/clk/clk.c:2412:5: error: redefinition of 'clk_set_max_rate'
   int clk_set_max_rate(struct clk *clk, unsigned long rate)
       ^
   include/linux/clk.h:916:19: note: previous definition is here
   static inline int clk_set_max_rate(struct clk *clk, unsigned long rate)
                     ^
>> drivers/clk/clk.c:2429:13: error: redefinition of 'clk_get_parent'
   struct clk *clk_get_parent(struct clk *clk)
               ^
   include/linux/clk.h:926:27: note: previous definition is here
   static inline struct clk *clk_get_parent(struct clk *clk)
                             ^
>> drivers/clk/clk.c:2481:6: error: redefinition of 'clk_has_parent'
   bool clk_has_parent(struct clk *clk, struct clk *parent)
        ^
   include/linux/clk.h:900:20: note: previous definition is here
   static inline bool clk_has_parent(struct clk *clk, struct clk *parent)
                      ^
>> drivers/clk/clk.c:2593:5: error: redefinition of 'clk_set_parent'
   int clk_set_parent(struct clk *clk, struct clk *parent)
       ^
   include/linux/clk.h:921:19: note: previous definition is here
   static inline int clk_set_parent(struct clk *clk, struct clk *parent)
                     ^
   1 warning and 16 errors generated.


vim +/clk_rate_exclusive_put +723 drivers/clk/clk.c

e55a839a7a1c56 Jerome Brunet   2017-12-01  704  
55e9b8b7b806ec Jerome Brunet   2017-12-01  705  /**
55e9b8b7b806ec Jerome Brunet   2017-12-01  706   * clk_rate_exclusive_put - release exclusivity over clock rate control
55e9b8b7b806ec Jerome Brunet   2017-12-01  707   * @clk: the clk over which the exclusivity is released
55e9b8b7b806ec Jerome Brunet   2017-12-01  708   *
55e9b8b7b806ec Jerome Brunet   2017-12-01  709   * clk_rate_exclusive_put() completes a critical section during which a clock
55e9b8b7b806ec Jerome Brunet   2017-12-01  710   * consumer cannot tolerate any other consumer making any operation on the
55e9b8b7b806ec Jerome Brunet   2017-12-01  711   * clock which could result in a rate change or rate glitch. Exclusive clocks
55e9b8b7b806ec Jerome Brunet   2017-12-01  712   * cannot have their rate changed, either directly or indirectly due to changes
55e9b8b7b806ec Jerome Brunet   2017-12-01  713   * further up the parent chain of clocks. As a result, clocks up parent chain
55e9b8b7b806ec Jerome Brunet   2017-12-01  714   * also get under exclusive control of the calling consumer.
55e9b8b7b806ec Jerome Brunet   2017-12-01  715   *
55e9b8b7b806ec Jerome Brunet   2017-12-01  716   * If exlusivity is claimed more than once on clock, even by the same consumer,
55e9b8b7b806ec Jerome Brunet   2017-12-01  717   * the rate effectively gets locked as exclusivity can't be preempted.
55e9b8b7b806ec Jerome Brunet   2017-12-01  718   *
55e9b8b7b806ec Jerome Brunet   2017-12-01  719   * Calls to clk_rate_exclusive_put() must be balanced with calls to
55e9b8b7b806ec Jerome Brunet   2017-12-01  720   * clk_rate_exclusive_get(). Calls to this function may sleep, and do not return
55e9b8b7b806ec Jerome Brunet   2017-12-01  721   * error status.
55e9b8b7b806ec Jerome Brunet   2017-12-01  722   */
55e9b8b7b806ec Jerome Brunet   2017-12-01 @723  void clk_rate_exclusive_put(struct clk *clk)
55e9b8b7b806ec Jerome Brunet   2017-12-01  724  {
55e9b8b7b806ec Jerome Brunet   2017-12-01  725  	if (!clk)
55e9b8b7b806ec Jerome Brunet   2017-12-01  726  		return;
55e9b8b7b806ec Jerome Brunet   2017-12-01  727  
55e9b8b7b806ec Jerome Brunet   2017-12-01  728  	clk_prepare_lock();
55e9b8b7b806ec Jerome Brunet   2017-12-01  729  
55e9b8b7b806ec Jerome Brunet   2017-12-01  730  	/*
55e9b8b7b806ec Jerome Brunet   2017-12-01  731  	 * if there is something wrong with this consumer protect count, stop
55e9b8b7b806ec Jerome Brunet   2017-12-01  732  	 * here before messing with the provider
55e9b8b7b806ec Jerome Brunet   2017-12-01  733  	 */
55e9b8b7b806ec Jerome Brunet   2017-12-01  734  	if (WARN_ON(clk->exclusive_count <= 0))
55e9b8b7b806ec Jerome Brunet   2017-12-01  735  		goto out;
55e9b8b7b806ec Jerome Brunet   2017-12-01  736  
55e9b8b7b806ec Jerome Brunet   2017-12-01  737  	clk_core_rate_unprotect(clk->core);
55e9b8b7b806ec Jerome Brunet   2017-12-01  738  	clk->exclusive_count--;
55e9b8b7b806ec Jerome Brunet   2017-12-01  739  out:
55e9b8b7b806ec Jerome Brunet   2017-12-01  740  	clk_prepare_unlock();
55e9b8b7b806ec Jerome Brunet   2017-12-01  741  }
55e9b8b7b806ec Jerome Brunet   2017-12-01  742  EXPORT_SYMBOL_GPL(clk_rate_exclusive_put);
55e9b8b7b806ec Jerome Brunet   2017-12-01  743  
e55a839a7a1c56 Jerome Brunet   2017-12-01  744  static void clk_core_rate_protect(struct clk_core *core)
e55a839a7a1c56 Jerome Brunet   2017-12-01  745  {
e55a839a7a1c56 Jerome Brunet   2017-12-01  746  	lockdep_assert_held(&prepare_lock);
e55a839a7a1c56 Jerome Brunet   2017-12-01  747  
e55a839a7a1c56 Jerome Brunet   2017-12-01  748  	if (!core)
e55a839a7a1c56 Jerome Brunet   2017-12-01  749  		return;
e55a839a7a1c56 Jerome Brunet   2017-12-01  750  
e55a839a7a1c56 Jerome Brunet   2017-12-01  751  	if (core->protect_count == 0)
e55a839a7a1c56 Jerome Brunet   2017-12-01  752  		clk_core_rate_protect(core->parent);
e55a839a7a1c56 Jerome Brunet   2017-12-01  753  
e55a839a7a1c56 Jerome Brunet   2017-12-01  754  	core->protect_count++;
e55a839a7a1c56 Jerome Brunet   2017-12-01  755  }
e55a839a7a1c56 Jerome Brunet   2017-12-01  756  
e55a839a7a1c56 Jerome Brunet   2017-12-01  757  static void clk_core_rate_restore_protect(struct clk_core *core, int count)
e55a839a7a1c56 Jerome Brunet   2017-12-01  758  {
e55a839a7a1c56 Jerome Brunet   2017-12-01  759  	lockdep_assert_held(&prepare_lock);
e55a839a7a1c56 Jerome Brunet   2017-12-01  760  
e55a839a7a1c56 Jerome Brunet   2017-12-01  761  	if (!core)
e55a839a7a1c56 Jerome Brunet   2017-12-01  762  		return;
e55a839a7a1c56 Jerome Brunet   2017-12-01  763  
e55a839a7a1c56 Jerome Brunet   2017-12-01  764  	if (count == 0)
e55a839a7a1c56 Jerome Brunet   2017-12-01  765  		return;
e55a839a7a1c56 Jerome Brunet   2017-12-01  766  
e55a839a7a1c56 Jerome Brunet   2017-12-01  767  	clk_core_rate_protect(core);
e55a839a7a1c56 Jerome Brunet   2017-12-01  768  	core->protect_count = count;
e55a839a7a1c56 Jerome Brunet   2017-12-01  769  }
e55a839a7a1c56 Jerome Brunet   2017-12-01  770  
55e9b8b7b806ec Jerome Brunet   2017-12-01  771  /**
55e9b8b7b806ec Jerome Brunet   2017-12-01  772   * clk_rate_exclusive_get - get exclusivity over the clk rate control
55e9b8b7b806ec Jerome Brunet   2017-12-01  773   * @clk: the clk over which the exclusity of rate control is requested
55e9b8b7b806ec Jerome Brunet   2017-12-01  774   *
a37a5a9d715f0d Andy Shevchenko 2020-03-10  775   * clk_rate_exclusive_get() begins a critical section during which a clock
55e9b8b7b806ec Jerome Brunet   2017-12-01  776   * consumer cannot tolerate any other consumer making any operation on the
55e9b8b7b806ec Jerome Brunet   2017-12-01  777   * clock which could result in a rate change or rate glitch. Exclusive clocks
55e9b8b7b806ec Jerome Brunet   2017-12-01  778   * cannot have their rate changed, either directly or indirectly due to changes
55e9b8b7b806ec Jerome Brunet   2017-12-01  779   * further up the parent chain of clocks. As a result, clocks up parent chain
55e9b8b7b806ec Jerome Brunet   2017-12-01  780   * also get under exclusive control of the calling consumer.
55e9b8b7b806ec Jerome Brunet   2017-12-01  781   *
55e9b8b7b806ec Jerome Brunet   2017-12-01  782   * If exlusivity is claimed more than once on clock, even by the same consumer,
55e9b8b7b806ec Jerome Brunet   2017-12-01  783   * the rate effectively gets locked as exclusivity can't be preempted.
55e9b8b7b806ec Jerome Brunet   2017-12-01  784   *
55e9b8b7b806ec Jerome Brunet   2017-12-01  785   * Calls to clk_rate_exclusive_get() should be balanced with calls to
55e9b8b7b806ec Jerome Brunet   2017-12-01  786   * clk_rate_exclusive_put(). Calls to this function may sleep.
55e9b8b7b806ec Jerome Brunet   2017-12-01  787   * Returns 0 on success, -EERROR otherwise
55e9b8b7b806ec Jerome Brunet   2017-12-01  788   */
55e9b8b7b806ec Jerome Brunet   2017-12-01 @789  int clk_rate_exclusive_get(struct clk *clk)
55e9b8b7b806ec Jerome Brunet   2017-12-01  790  {
55e9b8b7b806ec Jerome Brunet   2017-12-01  791  	if (!clk)
55e9b8b7b806ec Jerome Brunet   2017-12-01  792  		return 0;
55e9b8b7b806ec Jerome Brunet   2017-12-01  793  
55e9b8b7b806ec Jerome Brunet   2017-12-01  794  	clk_prepare_lock();
55e9b8b7b806ec Jerome Brunet   2017-12-01  795  	clk_core_rate_protect(clk->core);
55e9b8b7b806ec Jerome Brunet   2017-12-01  796  	clk->exclusive_count++;
55e9b8b7b806ec Jerome Brunet   2017-12-01  797  	clk_prepare_unlock();
55e9b8b7b806ec Jerome Brunet   2017-12-01  798  
55e9b8b7b806ec Jerome Brunet   2017-12-01  799  	return 0;
55e9b8b7b806ec Jerome Brunet   2017-12-01  800  }
55e9b8b7b806ec Jerome Brunet   2017-12-01  801  EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
55e9b8b7b806ec Jerome Brunet   2017-12-01  802  

:::::: The code at line 723 was first introduced by commit
:::::: 55e9b8b7b806ec3f9a8817e13596682a5981c19c clk: add clk_rate_exclusive api

:::::: TO: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
:::::: CC: Michael Turquette <mturquette@xxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux