[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202510272106.x7zgW7pK-lkp@intel.com>
Date: Mon, 27 Oct 2025 17:12:00 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Pengjie Zhang <zhangpengjie2@...wei.com>,
myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
cw00.choi@...sung.com
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, zhanjie9@...ilicon.com,
zhenglifeng1@...wei.com, lihuisong@...wei.com, yubowen8@...wei.com,
linhongye@...artners.com, linuxarm@...wei.com,
jonathan.cameron@...wei.com, zhangpengjie2@...wei.com
Subject: Re: [PATCH] PM / devfreq: use _visible attribute to replace
create/remove_sysfs_files()
Hi Pengjie,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Pengjie-Zhang/PM-devfreq-use-_visible-attribute-to-replace-create-remove_sysfs_files/20251025-215510
base: https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-testing
patch link: https://lore.kernel.org/r/20251025135238.3576861-1-zhangpengjie2%40huawei.com
patch subject: [PATCH] PM / devfreq: use _visible attribute to replace create/remove_sysfs_files()
config: loongarch-randconfig-r072-20251026 (https://download.01.org/0day-ci/archive/20251027/202510272106.x7zgW7pK-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project e1ae12640102fd2b05bc567243580f90acb1135f)
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@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202510272106.x7zgW7pK-lkp@intel.com/
smatch warnings:
drivers/devfreq/devfreq.c:1927 timer_store() warn: inconsistent returns 'global &devfreq_list_lock'.
vim +1927 drivers/devfreq/devfreq.c
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1874 static ssize_t timer_store(struct device *dev, struct device_attribute *attr,
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1875 const char *buf, size_t count)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1876 {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1877 struct devfreq *df = to_devfreq(dev);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1878 char str_timer[DEVFREQ_NAME_LEN + 1];
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1879 int timer = -1;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1880 int ret = 0, i;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1881
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1882 mutex_lock(&devfreq_list_lock);
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1883 if (!df->governor || !df->profile ||
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1884 !IS_SUPPORTED_ATTR(df->governor->attrs, TIMER)) {
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1885 mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1886 return -EINVAL;
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1887 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1888
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1889 ret = sscanf(buf, "%16s", str_timer);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1890 if (ret != 1)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1891 return -EINVAL;
mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1892
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1893 for (i = 0; i < DEVFREQ_TIMER_NUM; i++) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1894 if (!strncmp(timer_name[i], str_timer, DEVFREQ_NAME_LEN)) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1895 timer = i;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1896 break;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1897 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1898 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1899
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1900 if (timer < 0) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1901 ret = -EINVAL;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1902 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1903 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1904
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1905 if (df->profile->timer == timer) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1906 ret = 0;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1907 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1908 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1909
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1910 mutex_lock(&df->lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1911 df->profile->timer = timer;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1912 mutex_unlock(&df->lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1913
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1914 ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1915 if (ret) {
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1916 dev_warn(dev, "%s: Governor %s not stopped(%d)\n",
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1917 __func__, df->governor->name, ret);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1918 goto out;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1919 }
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1920
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1921 ret = df->governor->event_handler(df, DEVFREQ_GOV_START, NULL);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1922 if (ret)
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1923 dev_warn(dev, "%s: Governor %s not started(%d)\n",
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1924 __func__, df->governor->name, ret);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1925 out:
88ea5f098ddcf4 Pengjie Zhang 2025-10-25 1926 mutex_unlock(&devfreq_list_lock);
4dc3bab8687f1e Chanwoo Choi 2020-07-02 @1927 return ret ? ret : count;
4dc3bab8687f1e Chanwoo Choi 2020-07-02 1928 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists