tree:
https://github.com/intel/linux-intel-lts.git 4.19/android
head: 175090c19b89b02853405bb70bd8b3e9ef9bf129
commit: 045c4cc9854e44be23f27501c397c8d1783a0708 [16527/17639] cpufreq statistics: support
cpufreq driver without freq table
config: x86_64-randconfig-a011-20201021 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
2eac8ce820e6c9fe51bf93b55cb8a781b8b9fc7c)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://github.com/intel/linux-intel-lts/commit/045c4cc9854e44be23f27501c...
git remote add intel-linux-intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android
git checkout 045c4cc9854e44be23f27501c397c8d1783a0708
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/cpufreq/cpufreq_times.c:354:5: warning: no previous
prototype for function 'cpufreq_table_get_closed_index' [-Wmissing-prototypes]
int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
^
drivers/cpufreq/cpufreq_times.c:354:1: note: declare 'static' if the function
is not intended to be used outside of this translation unit
int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
^
static
> drivers/cpufreq/cpufreq_times.c:367:6: warning: no previous
prototype for function 'cpufreq_times_create_policy_no_freq_table'
[-Wmissing-prototypes]
void cpufreq_times_create_policy_no_freq_table(struct
cpufreq_policy *policy)
^
drivers/cpufreq/cpufreq_times.c:367:1: note: declare 'static' if the function
is not intended to be used outside of this translation unit
void cpufreq_times_create_policy_no_freq_table(struct cpufreq_policy *policy)
^
static
2 warnings generated.
vim +/cpufreq_table_get_closed_index +354 drivers/cpufreq/cpufreq_times.c
350
351 #define CPU_FREQ_STEPS 100000
352 // Suppose all cores have same freq count
353 static int all_freq_count;
354 int cpufreq_table_get_closed_index(int cpu, unsigned int freq)
355 {
356 int i;
357 unsigned int rounded_freq;
358
359 rounded_freq = freq + CPU_FREQ_STEPS / 2;
360 for (i = 0; i < all_freq_count; i++) {
361 if ((rounded_freq - all_freqs[cpu]->freq_table[i]) / CPU_FREQ_STEPS == 0)
362 return i;
363 }
364 return -1;
365 }
366
367 void cpufreq_times_create_policy_no_freq_table(struct
cpufreq_policy *policy)
368 {
369 int cpu, index, i;
370 unsigned int count = 0;
371 struct cpu_freqs *freqs;
372 void *tmp;
373
374 if (all_freqs[policy->cpu])
375 return;
376
377 count = (policy->max - policy->min) / CPU_FREQ_STEPS + 1;
378 if ((policy->max - policy->min) % CPU_FREQ_STEPS)
379 count++;
380
381 if (count > 100)
382 return;
383
384 tmp = kzalloc(sizeof(*freqs) + sizeof(freqs->freq_table[0]) * count,
385 GFP_KERNEL);
386 if (!tmp)
387 return;
388
389 freqs = tmp;
390 freqs->max_state = count;
391 all_freq_count = count;
392
393 freqs->freq_table[0] = policy->min;
394 freqs->freq_table[count - 1] = policy->max;
395 for (i = 1; i < count - 1; i++)
396 freqs->freq_table[i] = policy->min + i * CPU_FREQ_STEPS;
397 freqs->offset = next_offset;
398 WRITE_ONCE(next_offset, freqs->offset + count);
399 for_each_cpu(cpu, policy->related_cpus)
400 all_freqs[cpu] = freqs;
401
402 index = cpufreq_table_get_closed_index(policy->cpu, policy->cur);
403 if (index >= 0)
404 WRITE_ONCE(freqs->last_index, index);
405 }
406
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org