Re: [PATCH v5] drm/i915/hwmon: expose fan speed

kernel test robot
2024-08-12T21:36:46Z

Hi Raag,

kernel test robot noticed the following build errors:

[auto build test ERROR on groeck-staging/hwmon-next]
[also build test ERROR on linus/master v6.11-rc3 next-20240812]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/drm-i915-hwmon-expose-fan-speed/20240812-161645
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20240812081538.1457396-1-raag.jadav%40intel.com
patch subject: [PATCH v5] drm/i915/hwmon: expose fan speed
config: i386-randconfig-012-20240813 (https://download.01.org/0day-ci/archive/20240813/202408130500.SgCVoR2D-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240813/202408130500.SgCVoR2D-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408130500.SgCVoR2D-lkp@intel.com/

All errors (new ones prefixed by >>):

ld: drivers/gpu/drm/i915/i915_hwmon.o: in function `hwm_fan_read':
>> drivers/gpu/drm/i915/i915_hwmon.c:675: undefined reference to `__udivdi3'

vim +675 drivers/gpu/drm/i915/i915_hwmon.c

633
634 static int
635 hwm_fan_read(struct hwm_drvdata *ddat, u32 attr, long *val)
636 {
637 struct i915_hwmon *hwmon = ddat->hwmon;
638 struct hwm_fan_info *fi = &ddat->fi;
639 u64 rotations, time_now, time;
640 intel_wakeref_t wakeref;
641 u32 reg_val, pulses;
642 int ret = 0;
643
644 if (attr != hwmon_fan_input)
645 return -EOPNOTSUPP;
646
647 wakeref = intel_runtime_pm_get(ddat->uncore->rpm);
648 mutex_lock(&hwmon->hwmon_lock);
649
650 reg_val = intel_uncore_read(ddat->uncore, hwmon->rg.fan_speed);
651 time_now = get_jiffies_64();
652
653 /* Handle HW register overflow */
654 if (reg_val >= fi->reg_val_prev)
655 pulses = reg_val - fi->reg_val_prev;
656 else
657 pulses = UINT_MAX - fi->reg_val_prev + reg_val;
658
659 /*
660 * HW register value is accumulated count of pulses from
661 * PWM fan with the scale of 2 pulses per rotation.
662 */
663 rotations = pulses / 2;
664
665 time = jiffies_delta_to_msecs(time_now - fi->time_prev);
666 if (unlikely(!time)) {
667 ret = -EAGAIN;
668 goto exit;
669 }
670
671 /*
672 * Convert to minutes for calculating RPM.
673 * RPM = number of rotations * msecs per minute / time in msecs
674 */
> 675 *val = DIV_ROUND_UP(rotations * (MSEC_PER_SEC * 60), time);
676
677 fi->reg_val_prev = reg_val;
678 fi->time_prev = time_now;
679 exit:
680 mutex_unlock(&hwmon->hwmon_lock);
681 intel_runtime_pm_put(ddat->uncore->rpm, wakeref);
682 return ret;
683 }
684

--
0-DAY CI Kernel Test Service