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

2024-08-21 Thread Andi Shyti
> > > + /* > > > + * HW register value is accumulated count of pulses from > > > + * PWM fan with the scale of 2 pulses per rotation. > > > + */ > > > + rotations = pulses / 2; > > > + > > > + time = jiffies_delta_to_msecs(time_now - fi->time_prev); > > > + if (unlikely(!time)) { > > > +

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

2024-08-13 Thread Raag Jadav
On Tue, Aug 13, 2024 at 11:27:22AM +0300, Andy Shevchenko wrote: > On Tue, Aug 13, 2024 at 08:45:19AM +0300, Raag Jadav wrote: > > On Mon, Aug 12, 2024 at 04:15:14PM +0300, Andy Shevchenko wrote: > > > On Mon, Aug 12, 2024 at 01:45:38PM +0530, Raag Jadav wrote: > > ... > > > > > +static int > > >

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

2024-08-13 Thread Andy Shevchenko
On Tue, Aug 13, 2024 at 08:45:19AM +0300, Raag Jadav wrote: > On Mon, Aug 12, 2024 at 04:15:14PM +0300, Andy Shevchenko wrote: > > On Mon, Aug 12, 2024 at 01:45:38PM +0530, Raag Jadav wrote: ... > > > +static int > > > +hwm_fan_read(struct hwm_drvdata *ddat, u32 attr, long *val) > > > +{ > > > +

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

2024-08-12 Thread Raag Jadav
On Mon, Aug 12, 2024 at 03:50:47PM +0200, Andi Shyti wrote: > Hi Raag, > > > +static int > > +hwm_fan_read(struct hwm_drvdata *ddat, u32 attr, long *val) > > +{ > > + struct i915_hwmon *hwmon = ddat->hwmon; > > + struct hwm_fan_info *fi = &ddat->fi; > > + u64 rotations, time_now, time; > > +

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

2024-08-12 Thread Raag Jadav
On Mon, Aug 12, 2024 at 04:15:14PM +0300, Andy Shevchenko wrote: > On Mon, Aug 12, 2024 at 01:45:38PM +0530, Raag Jadav wrote: > > Add hwmon support for fan1_input attribute, which will expose fan speed > > in RPM. With this in place we can monitor fan speed using lm-sensors tool. > > > > $ sensor

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

2024-08-12 Thread kernel test robot
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-allyesconfig (https://download.01.org/0day-ci/archive/20240813/202408130800.xty6xxq5-...@intel.com/config) compiler: gcc-

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

2024-08-12 Thread kernel test robot
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-...@intel.com/config) compil

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

2024-08-12 Thread Andi Shyti
Hi Raag, > +static int > +hwm_fan_read(struct hwm_drvdata *ddat, u32 attr, long *val) > +{ > + struct i915_hwmon *hwmon = ddat->hwmon; > + struct hwm_fan_info *fi = &ddat->fi; > + u64 rotations, time_now, time; > + intel_wakeref_t wakeref; > + u32 reg_val, pulses; > + int r

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

2024-08-12 Thread Andy Shevchenko
On Mon, Aug 12, 2024 at 01:45:38PM +0530, Raag Jadav wrote: > Add hwmon support for fan1_input attribute, which will expose fan speed > in RPM. With this in place we can monitor fan speed using lm-sensors tool. > > $ sensors > i915-pci-0300 > Adapter: PCI adapter > in0: 653.00 mV > fan1:

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

2024-08-12 Thread Raag Jadav
Add hwmon support for fan1_input attribute, which will expose fan speed in RPM. With this in place we can monitor fan speed using lm-sensors tool. $ sensors i915-pci-0300 Adapter: PCI adapter in0: 653.00 mV fan1:3833 RPM power1: N/A (max = 43.00 W) energy1: 32.02 k