lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsSi73YyfKletmgk@smile.fi.intel.com>
Date: Tue, 20 Aug 2024 17:06:39 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: jani.nikula@...ux.intel.com, joonas.lahtinen@...ux.intel.com,
	rodrigo.vivi@...el.com, tursulin@...ulin.net, airlied@...il.com,
	daniel@...ll.ch, linux@...ck-us.net, andi.shyti@...ux.intel.com,
	intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
	linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
	anshuman.gupta@...el.com, badal.nilawar@...el.com,
	riana.tauro@...el.com, ashutosh.dixit@...el.com,
	karthik.poosa@...el.com
Subject: Re: [PATCH v6] drm/i915/hwmon: expose fan speed

On Tue, Aug 20, 2024 at 04:12:46PM +0300, Raag Jadav wrote:
> On Tue, Aug 20, 2024 at 01:23:35PM +0300, Andy Shevchenko wrote:
> > On Tue, Aug 20, 2024 at 11:50:10AM +0530, Raag Jadav wrote:

...

> > > v6: Drop overflow logic (Andy)
> > >     Aesthetic adjustments (Badal)
> > 
> > But it still has an issue with 64-bit division on 32-bit platforms, right?

...

> > > +	/*
> > > +	 * Calculate fan speed in RPM by time averaging two subsequent
> > > +	 * readings in minutes.
> > > +	 * RPM = number of rotations * msecs per minute / time in msecs
> > > +	 */
> > > +	*val = DIV_ROUND_UP(rotations * (MSEC_PER_SEC * 60), time);
> > 
> > ...somewhere here?
> 
> Use div64_u64() instead? Or is there a better alternative?

I don't know the code well to offer anything better. Probably for a starter
you can switch to use DIV_ROUND_UP_ULL().

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ