tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: 411466c5081d2f649b3583cae0f6c9ad5edec636 PM / OPP: add non-OF versions 
of dev_pm_opp_{cpumask_, }remove_table
date:   9 months ago
config: x86_64-randconfig-x008-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 411466c5081d2f649b3583cae0f6c9ad5edec636
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:119:34: note: previous definition of 
'dev_pm_opp_find_freq_floor' was here
    static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device 
*dev,
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:596:5: error: redefinition of 
'dev_pm_opp_set_rate'
    int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
        ^~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:180:19: note: previous definition of 
'dev_pm_opp_set_rate' was here
    static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long 
target_freq)
                      ^~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:926:6: error: redefinition of 
'dev_pm_opp_remove'
    void dev_pm_opp_remove(struct device *dev, unsigned long freq)
         ^~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:137:20: note: previous definition of 
'dev_pm_opp_remove' was here
    static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
                       ^~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1212:5: error: redefinition of 
'dev_pm_opp_set_supported_hw'
    int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:157:19: note: previous definition of 
'dev_pm_opp_set_supported_hw' was here
    static inline int dev_pm_opp_set_supported_hw(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1272:6: error: redefinition of 
'dev_pm_opp_put_supported_hw'
    void dev_pm_opp_put_supported_hw(struct device *dev)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:164:20: note: previous definition of 
'dev_pm_opp_put_supported_hw' was here
    static inline void dev_pm_opp_put_supported_hw(struct device *dev) {}
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1324:5: error: redefinition of 
'dev_pm_opp_set_prop_name'
    int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
        ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:166:19: note: previous definition of 
'dev_pm_opp_set_prop_name' was here
    static inline int dev_pm_opp_set_prop_name(struct device *dev, const char 
*name)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1381:6: error: redefinition of 
'dev_pm_opp_put_prop_name'
    void dev_pm_opp_put_prop_name(struct device *dev)
         ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:171:20: note: previous definition of 
'dev_pm_opp_put_prop_name' was here
    static inline void dev_pm_opp_put_prop_name(struct device *dev) {}
                       ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1431:5: error: redefinition of 
'dev_pm_opp_set_regulator'
    int dev_pm_opp_set_regulator(struct device *dev, const char *name)
        ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:173:19: note: previous definition of 
'dev_pm_opp_set_regulator' was here
    static inline int dev_pm_opp_set_regulator(struct device *dev, const char 
*name)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1490:6: error: redefinition of 
'dev_pm_opp_put_regulator'
    void dev_pm_opp_put_regulator(struct device *dev)
         ^~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:178:20: note: previous definition of 
'dev_pm_opp_put_regulator' was here
    static inline void dev_pm_opp_put_regulator(struct device *dev) {}
                       ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1684:5: error: redefinition of 'dev_pm_opp_add'
    int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long 
u_volt)
        ^~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:131:19: note: previous definition of 'dev_pm_opp_add' 
was here
    static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
                      ^~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1791:5: error: redefinition of 
'dev_pm_opp_enable'
    int dev_pm_opp_enable(struct device *dev, unsigned long freq)
        ^~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:141:19: note: previous definition of 
'dev_pm_opp_enable' was here
    static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
                      ^~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1817:5: error: redefinition of 
'dev_pm_opp_disable'
    int dev_pm_opp_disable(struct device *dev, unsigned long freq)
        ^~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:146:19: note: previous definition of 
'dev_pm_opp_disable' was here
    static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
                      ^~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1837:28: error: redefinition of 
'dev_pm_opp_get_notifier'
    struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
                               ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:151:42: note: previous definition of 
'dev_pm_opp_get_notifier' was here
    static inline struct srcu_notifier_head *dev_pm_opp_get_notifier(
                                             ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/opp/core.c:1901:6: error: redefinition of 
>> 'dev_pm_opp_remove_table'
    void dev_pm_opp_remove_table(struct device *dev)
         ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:195:20: note: previous definition of 
'dev_pm_opp_remove_table' was here
    static inline void dev_pm_opp_remove_table(struct device *dev)
                       ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:1921:6: error: redefinition of 
'dev_pm_opp_of_remove_table'
    void dev_pm_opp_of_remove_table(struct device *dev)
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:217:20: note: previous definition of 
'dev_pm_opp_of_remove_table' was here
    static inline void dev_pm_opp_of_remove_table(struct device *dev)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/base/power/opp/core.c:2057:5: error: redefinition of 
'dev_pm_opp_of_add_table'
    int dev_pm_opp_of_add_table(struct device *dev)
        ^~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/base/power/opp/opp.h:21:0,
                    from drivers/base/power/opp/core.c:25:
   include/linux/pm_opp.h:212:19: note: previous definition of 
'dev_pm_opp_of_add_table' was here
    static inline int dev_pm_opp_of_add_table(struct device *dev)
                      ^~~~~~~~~~~~~~~~~~~~~~~

vim +/dev_pm_opp_remove_table +1901 drivers/base/power/opp/core.c

  1831   * Locking: This function must be called under rcu_read_lock(). 
opp_table is a
  1832   * RCU protected pointer. The reason for the same is that the opp 
pointer which
  1833   * is returned will remain valid for use with opp_get_{voltage, freq} 
only while
  1834   * under the locked area. The pointer returned must be used prior to 
unlocking
  1835   * with rcu_read_unlock() to maintain the integrity of the pointer.
  1836   */
> 1837  struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
  1838  {
  1839          struct opp_table *opp_table = _find_opp_table(dev);
  1840  
  1841          if (IS_ERR(opp_table))
  1842                  return ERR_CAST(opp_table); /* matching type */
  1843  
  1844          return &opp_table->srcu_head;
  1845  }
  1846  EXPORT_SYMBOL_GPL(dev_pm_opp_get_notifier);
  1847  
  1848  /*
  1849   * Free OPPs either created using static entries present in DT or even 
the
  1850   * dynamically added entries based on remove_all param.
  1851   */
  1852  static void _dev_pm_opp_remove_table(struct device *dev, bool 
remove_all)
  1853  {
  1854          struct opp_table *opp_table;
  1855          struct dev_pm_opp *opp, *tmp;
  1856  
  1857          /* Hold our table modification lock here */
  1858          mutex_lock(&opp_table_lock);
  1859  
  1860          /* Check for existing table for 'dev' */
  1861          opp_table = _find_opp_table(dev);
  1862          if (IS_ERR(opp_table)) {
  1863                  int error = PTR_ERR(opp_table);
  1864  
  1865                  if (error != -ENODEV)
  1866                          WARN(1, "%s: opp_table: %d\n",
  1867                               IS_ERR_OR_NULL(dev) ?
  1868                                          "Invalid device" : 
dev_name(dev),
  1869                               error);
  1870                  goto unlock;
  1871          }
  1872  
  1873          /* Find if opp_table manages a single device */
  1874          if (list_is_singular(&opp_table->dev_list)) {
  1875                  /* Free static OPPs */
  1876                  list_for_each_entry_safe(opp, tmp, 
&opp_table->opp_list, node) {
  1877                          if (remove_all || !opp->dynamic)
  1878                                  _opp_remove(opp_table, opp, true);
  1879                  }
  1880          } else {
  1881                  _remove_opp_dev(_find_opp_dev(dev, opp_table), 
opp_table);
  1882          }
  1883  
  1884  unlock:
  1885          mutex_unlock(&opp_table_lock);
  1886  }
  1887  
  1888  /**
  1889   * dev_pm_opp_remove_table() - Free all OPPs associated with the device
  1890   * @dev:        device pointer used to lookup OPP table.
  1891   *
  1892   * Free both OPPs created using static entries present in DT and the
  1893   * dynamically added entries.
  1894   *
  1895   * Locking: The internal opp_table and opp structures are RCU protected.
  1896   * Hence this function indirectly uses RCU updater strategy with mutex 
locks
  1897   * to keep the integrity of the internal data structures. Callers 
should ensure
  1898   * that this function is *NOT* called under RCU protection or in 
contexts where
  1899   * mutex cannot be locked.
  1900   */
> 1901  void dev_pm_opp_remove_table(struct device *dev)
  1902  {
  1903          _dev_pm_opp_remove_table(dev, true);
  1904  }

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to