All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com, tursulin@ursulin.net, airlied@gmail.com,
	daniel@ffwll.ch, linux@roeck-us.net, andi.shyti@linux.intel.com,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	anshuman.gupta@intel.com, badal.nilawar@intel.com,
	riana.tauro@intel.com, ashutosh.dixit@intel.com,
	karthik.poosa@intel.com
Subject: Re: [PATCH v6] drm/i915/hwmon: expose fan speed
Date: Thu, 22 Aug 2024 16:28:06 +0300	[thread overview]
Message-ID: <Zsc85iQIBpOPJOKp@smile.fi.intel.com> (raw)
In-Reply-To: <ZsbophGauSzh15lz@black.fi.intel.com>

On Thu, Aug 22, 2024 at 10:28:38AM +0300, Raag Jadav wrote:
> On Tue, Aug 20, 2024 at 05:06:39PM +0300, Andy Shevchenko wrote:
> > 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:
> > > > 
> > > > 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().
> 
> This one seems to work. Does it warrant an explanation here?

You mean _ULL part? No.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-08-22 13:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20  6:20 [PATCH v6] drm/i915/hwmon: expose fan speed Raag Jadav
2024-08-20  6:57 ` ✓ Fi.CI.BAT: success for drm/i915/hwmon: expose fan speed (rev6) Patchwork
2024-08-20 10:23 ` [PATCH v6] drm/i915/hwmon: expose fan speed Andy Shevchenko
2024-08-20 13:12   ` Raag Jadav
2024-08-20 14:06     ` Andy Shevchenko
2024-08-22  7:28       ` Raag Jadav
2024-08-22 13:28         ` Andy Shevchenko [this message]
2024-08-20 12:08 ` ✓ Fi.CI.IGT: success for drm/i915/hwmon: expose fan speed (rev6) Patchwork
2024-08-21 14:53 ` [PATCH v6] drm/i915/hwmon: expose fan speed Andi Shyti
2024-08-25 20:20 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zsc85iQIBpOPJOKp@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=karthik.poosa@intel.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tursulin@ursulin.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.