Hi Chetankumar,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on rafael-pm/thermal]
[also build test ERROR on linux/master linus/master v5.16-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Chetankumar-Mistry/Implement-Zie...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
config: i386-randconfig-r034-20211210
(
https://download.01.org/0day-ci/archive/20211211/202112112254.HX7rf2NF-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/0day-ci/linux/commit/91f16d6a958fcd818cd8649e7d8d92958...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Chetankumar-Mistry/Implement-Ziegler-Nichols-Heuristic/20211211-003430
git checkout 91f16d6a958fcd818cd8649e7d8d92958ada8c2f
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
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 >>):
ld: drivers/thermal/gov_power_allocator.o: in function `ziegler_nichols':
> drivers/thermal/gov_power_allocator.c:477: undefined reference to
`__udivdi3'
vim +477 drivers/thermal/gov_power_allocator.c
455
456 /** ziegler_nichols() - Calculate the k_ultimate and period for the thermal device
457 * and use these values to calculate and set the PID
coefficients based on
458 * the Ziegler-Nichols Heuristic
459 * @tz - The thermal device we are operating on
460 * @next_err - The next error value to be used for calculations
461 * @control_temp - The temperature we are trying to target
462 *
463 * The Ziegler-Nichols PID Coefficient Tuning Method works by determining a
K_Ultimate value. This
464 * is the largest K_P which yields a stable set of oscillations in error. By using
historic and
465 * current values of error, this function attempts to determine whether or not it
is oscillating,
466 * and increment the value of K_Ultimate accordingly. Once it has determined that
the system is
467 * oscillating, it calculates the time between "peaks" to determine its
period
468 *
469 */
470 static inline void ziegler_nichols(struct thermal_zone_device *tz, s32 next_err,
471 int control_temp)
472 {
473 struct power_allocator_params *params = tz->governor_data;
474 struct zn_coefficients *zn_coeffs = params->zn_coeffs;
475 const int NUMBER_OF_OSCILLATIONS = 10;
476
477 u32 t_now = (u32)(ktime_get_real_ns() / 1000000);
478 enum pivot_type peak_trough = MIDPOINT;
479 s32 oscillation_count = 0;
480 bool is_pivot;
481 bool is_safe =
482 is_temperature_safe((control_temp - next_err), control_temp);
483
484 if (tz->tzp->ziegler_nichols == ZN_RESET) {
485 reset_ziegler_nichols(zn_coeffs);
486 tz->tzp->ziegler_nichols = ZN_ON;
487 }
488
489 /* Override default PID Coefficients. These will be updated later according to
the
490 * Heuristic
491 */
492 tz->tzp->k_po = zn_coeffs->k_ultimate;
493 tz->tzp->k_pu = zn_coeffs->k_ultimate;
494 tz->tzp->k_i = 0;
495 tz->tzp->k_d = 0;
496
497 if (!zn_coeffs->zn_found) {
498 /* Make sure that the previous errors have been logged and this isn't
executed on
499 * first pass
500 */
501 if (zn_coeffs->curr_err != zn_coeffs->prev_err &&
502 zn_coeffs->prev_err != 0) {
503 if (!is_safe)
504 goto set_zn;
505 is_pivot = is_error_pivot(next_err, zn_coeffs->curr_err,
506 zn_coeffs->prev_err,
507 &peak_trough);
508 if (is_pivot) {
509 oscillation_count = get_oscillation_count(
510 zn_coeffs->curr_err, peak_trough,
511 zn_coeffs);
512 if (oscillation_count >=
513 NUMBER_OF_OSCILLATIONS) {
514 goto set_zn;
515 }
516 if (peak_trough == PEAK)
517 zn_coeffs->t_prev_peak = t_now;
518 }
519 if (!is_pivot || !oscillation_count)
520 zn_coeffs->k_ultimate += 10;
521 }
522 goto update_errors;
523 } else {
524 set_zn_pid_coefficients(tz->tzp, zn_coeffs->period,
525 zn_coeffs->k_ultimate);
526 tz->tzp->ziegler_nichols = ZN_OFF;
527 }
528 return;
529
530 update_errors:
531 zn_coeffs->prev_err = zn_coeffs->curr_err;
532 zn_coeffs->curr_err = next_err;
533 return;
534
535 set_zn:
536 if (zn_coeffs->t_prev_peak) {
537 zn_coeffs->zn_found = true;
538 zn_coeffs->period = abs(t_now - zn_coeffs->t_prev_peak);
539 set_zn_pid_coefficients(tz->tzp, zn_coeffs->period,
540 zn_coeffs->k_ultimate);
541 ((struct power_allocator_params *)tz->governor_data)
542 ->err_integral = 0;
543 tz->tzp->ziegler_nichols = ZN_OFF;
544 } else {
545 if (peak_trough == PEAK)
546 zn_coeffs->t_prev_peak = t_now;
547 }
548 }
549
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org