tree:
https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-testing
head: 245be5c9be5382d16e12c6c7e466ccf22a7b0556
commit: 63aff4407c3050823d7680112129dc455477a578 [4/7] PM / devfreq: Use HZ macros
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
#
https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/...
git remote add chanwoo
https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
git fetch --no-tags chanwoo devfreq-testing
git checkout 63aff4407c3050823d7680112129dc455477a578
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:14,
from drivers/devfreq/devfreq.c:10:
drivers/devfreq/devfreq.c: In function 'get_freq_range':
> drivers/devfreq/devfreq.c:148:44: error: 'HZ_PER_KHZ'
undeclared (first use in this function)
148 | *min_freq = max(*min_freq,
(unsigned long)HZ_PER_KHZ * qos_min_freq);
| ^~~~~~~~~~
include/linux/minmax.h:18:39: note: in definition of macro '__typecheck'
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:58:19: note: in expansion of macro '__careful_cmp'
58 | #define max(x, y) __careful_cmp(x, y, >)
| ^~~~~~~~~~~~~
drivers/devfreq/devfreq.c:148:14: note: in expansion of macro 'max'
148 | *min_freq = max(*min_freq, (unsigned long)HZ_PER_KHZ * qos_min_freq);
| ^~~
drivers/devfreq/devfreq.c:148:44: note: each undeclared identifier is reported only
once for each function it appears in
148 | *min_freq = max(*min_freq, (unsigned long)HZ_PER_KHZ * qos_min_freq);
| ^~~~~~~~~~
include/linux/minmax.h:18:39: note: in definition of macro '__typecheck'
18 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/minmax.h:42:24: note: in expansion of macro '__safe_cmp'
42 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/minmax.h:58:19: note: in expansion of macro '__careful_cmp'
58 | #define max(x, y) __careful_cmp(x, y, >)
| ^~~~~~~~~~~~~
drivers/devfreq/devfreq.c:148:14: note: in expansion of macro 'max'
148 | *min_freq = max(*min_freq, (unsigned long)HZ_PER_KHZ * qos_min_freq);
| ^~~
> include/linux/minmax.h:42:2: error: first argument to
'__builtin_choose_expr' not a constant
42 |
__builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:58:19: note: in expansion of macro '__careful_cmp'
58 | #define max(x, y) __careful_cmp(x, y, >)
| ^~~~~~~~~~~~~
drivers/devfreq/devfreq.c:148:14: note: in expansion of macro 'max'
148 | *min_freq = max(*min_freq, (unsigned long)HZ_PER_KHZ * qos_min_freq);
| ^~~
> include/linux/minmax.h:42:2: error: first argument to
'__builtin_choose_expr' not a constant
42 |
__builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:51:19: note: in expansion of macro '__careful_cmp'
51 | #define min(x, y) __careful_cmp(x, y, <)
| ^~~~~~~~~~~~~
drivers/devfreq/devfreq.c:150:15: note: in expansion of macro 'min'
150 | *max_freq = min(*max_freq,
| ^~~
drivers/devfreq/devfreq.c: In function 'min_freq_store':
drivers/devfreq/devfreq.c:1532:14: error: 'HZ_PER_KHZ' undeclared (first use in
this function)
1532 | value / HZ_PER_KHZ);
| ^~~~~~~~~~
In file included from include/vdso/const.h:5,
from include/linux/const.h:4,
from include/linux/bits.h:5,
from include/linux/bitops.h:6,
from include/linux/kernel.h:11,
from drivers/devfreq/devfreq.c:10:
drivers/devfreq/devfreq.c: In function 'max_freq_store':
drivers/devfreq/devfreq.c:1582:31: error: 'HZ_PER_KHZ' undeclared (first use in
this function)
1582 | value = DIV_ROUND_UP(value, HZ_PER_KHZ);
| ^~~~~~~~~~
include/uapi/linux/const.h:34:46: note: in definition of macro
'__KERNEL_DIV_ROUND_UP'
34 | #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
| ^
drivers/devfreq/devfreq.c:1582:11: note: in expansion of macro 'DIV_ROUND_UP'
1582 | value = DIV_ROUND_UP(value, HZ_PER_KHZ);
| ^~~~~~~~~~~~
vim +/HZ_PER_KHZ +148 drivers/devfreq/devfreq.c
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 112
46cecc0bf095bb Leonard Crestez 2019-10-31 113 /**
46cecc0bf095bb Leonard Crestez 2019-10-31 114 * get_freq_range() - Get the current freq
range
46cecc0bf095bb Leonard Crestez 2019-10-31 115 * @devfreq: the devfreq instance
46cecc0bf095bb Leonard Crestez 2019-10-31 116 * @min_freq: the min frequency
46cecc0bf095bb Leonard Crestez 2019-10-31 117 * @max_freq: the max frequency
46cecc0bf095bb Leonard Crestez 2019-10-31 118 *
46cecc0bf095bb Leonard Crestez 2019-10-31 119 * This takes into consideration all
constraints.
46cecc0bf095bb Leonard Crestez 2019-10-31 120 */
46cecc0bf095bb Leonard Crestez 2019-10-31 121 static void get_freq_range(struct devfreq
*devfreq,
46cecc0bf095bb Leonard Crestez 2019-10-31 122 unsigned long *min_freq,
46cecc0bf095bb Leonard Crestez 2019-10-31 123 unsigned long *max_freq)
46cecc0bf095bb Leonard Crestez 2019-10-31 124 {
46cecc0bf095bb Leonard Crestez 2019-10-31 125 unsigned long *freq_table =
devfreq->profile->freq_table;
05d7ae15cfb18f Leonard Crestez 2019-12-05 126 s32 qos_min_freq, qos_max_freq;
46cecc0bf095bb Leonard Crestez 2019-10-31 127
46cecc0bf095bb Leonard Crestez 2019-10-31 128
lockdep_assert_held(&devfreq->lock);
46cecc0bf095bb Leonard Crestez 2019-10-31 129
46cecc0bf095bb Leonard Crestez 2019-10-31 130 /*
46cecc0bf095bb Leonard Crestez 2019-10-31 131 * Initialize minimum/maximum frequency
from freq table.
46cecc0bf095bb Leonard Crestez 2019-10-31 132 * The devfreq drivers can initialize
this in either ascending or
46cecc0bf095bb Leonard Crestez 2019-10-31 133 * descending order and devfreq core
supports both.
46cecc0bf095bb Leonard Crestez 2019-10-31 134 */
46cecc0bf095bb Leonard Crestez 2019-10-31 135 if (freq_table[0] <
freq_table[devfreq->profile->max_state - 1]) {
46cecc0bf095bb Leonard Crestez 2019-10-31 136 *min_freq = freq_table[0];
46cecc0bf095bb Leonard Crestez 2019-10-31 137 *max_freq =
freq_table[devfreq->profile->max_state - 1];
46cecc0bf095bb Leonard Crestez 2019-10-31 138 } else {
46cecc0bf095bb Leonard Crestez 2019-10-31 139 *min_freq =
freq_table[devfreq->profile->max_state - 1];
46cecc0bf095bb Leonard Crestez 2019-10-31 140 *max_freq = freq_table[0];
46cecc0bf095bb Leonard Crestez 2019-10-31 141 }
46cecc0bf095bb Leonard Crestez 2019-10-31 142
05d7ae15cfb18f Leonard Crestez 2019-12-05 143 /* Apply constraints from PM QoS */
05d7ae15cfb18f Leonard Crestez 2019-12-05 144 qos_min_freq =
dev_pm_qos_read_value(devfreq->dev.parent,
05d7ae15cfb18f Leonard Crestez 2019-12-05 145 DEV_PM_QOS_MIN_FREQUENCY);
05d7ae15cfb18f Leonard Crestez 2019-12-05 146 qos_max_freq =
dev_pm_qos_read_value(devfreq->dev.parent,
05d7ae15cfb18f Leonard Crestez 2019-12-05 147 DEV_PM_QOS_MAX_FREQUENCY);
05d7ae15cfb18f Leonard Crestez 2019-12-05 @148 *min_freq = max(*min_freq, (unsigned
long)HZ_PER_KHZ * qos_min_freq);
05d7ae15cfb18f Leonard Crestez 2019-12-05 149 if (qos_max_freq !=
PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE)
05d7ae15cfb18f Leonard Crestez 2019-12-05 150 *max_freq = min(*max_freq,
05d7ae15cfb18f Leonard Crestez 2019-12-05 151 (unsigned long)HZ_PER_KHZ *
qos_max_freq);
05d7ae15cfb18f Leonard Crestez 2019-12-05 152
46cecc0bf095bb Leonard Crestez 2019-10-31 153 /* Apply constraints from OPP interface
*/
46cecc0bf095bb Leonard Crestez 2019-10-31 154 *min_freq = max(*min_freq,
devfreq->scaling_min_freq);
46cecc0bf095bb Leonard Crestez 2019-10-31 155 *max_freq = min(*max_freq,
devfreq->scaling_max_freq);
46cecc0bf095bb Leonard Crestez 2019-10-31 156
46cecc0bf095bb Leonard Crestez 2019-10-31 157 if (*min_freq > *max_freq)
46cecc0bf095bb Leonard Crestez 2019-10-31 158 *min_freq = *max_freq;
46cecc0bf095bb Leonard Crestez 2019-10-31 159 }
46cecc0bf095bb Leonard Crestez 2019-10-31 160
:::::: The code at line 148 was first introduced by commit
:::::: 05d7ae15cfb18f9ce55eef85bb6bcd62d31acc57 PM / devfreq: Add PM QoS support
:::::: TO: Leonard Crestez <leonard.crestez(a)nxp.com>
:::::: CC: Chanwoo Choi <cw00.choi(a)samsung.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org