From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nicholas Mc Guire <hofrat@osadl.org>,
Daniel Vetter <daniel.vetter@intel.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>,
David Airlie <airlied@linux.ie>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Nicholas Mc Guire <hofrat@osadl.org>
Subject: Re: [PATCH] drm/i915: use udelay for very short delays
Date: Thu, 15 Dec 2016 11:08:49 +0200 [thread overview]
Message-ID: <87wpf1pnj2.fsf@intel.com> (raw)
In-Reply-To: <1481776147-23041-1-git-send-email-hofrat@osadl.org>
On Thu, 15 Dec 2016, Nicholas Mc Guire <hofrat@osadl.org> wrote:
> Even on fast systems a 2 microsecond delay is most likely more efficient
> as a busy-wait loop. The overhead of a hrtimer does not seem warranted -
> change this to a udelay(2).
Similar concerns as in [1]. We don't need the accuracy of udelay() here,
so this boils down to which is the better use of CPU. We could probably
relax the max delay more if that was helpful. But I'm not immediately
sold on "is most likely more efficient" which sounds like a gut feeling.
I'm sorry it's not clear in my other reply that I do appreciate
addressing incorrect/silly use of usleep_range(); I'm just not (yet)
convinced udelay() is the answer.
BR,
Jani.
[1] http://lkml.kernel.org/r/8737hpr32a.fsf@intel.com
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> Problem found by coccinelle:
>
> Patch was compile tested with: x86_64_defconfig (implies CONFIG_DRM_I915)
>
> Patch is against 4.9.0 (localversion-next is next-20161214)
>
> drivers/gpu/drm/i915/intel_dsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 5b72c50..19fe86b 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -379,7 +379,7 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder)
> val &= ~ULPS_STATE_MASK;
> val |= (ULPS_STATE_ENTER | DEVICE_READY);
> I915_WRITE(MIPI_DEVICE_READY(port), val);
> - usleep_range(2, 3);
> + udelay(2);
>
> /* 3. Exit ULPS */
> val = I915_READ(MIPI_DEVICE_READY(port));
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2016-12-15 9:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 4:29 [PATCH] drm/i915: use udelay for very short delays Nicholas Mc Guire
2016-12-15 9:08 ` Jani Nikula [this message]
2016-12-15 9:25 ` [Intel-gfx] " Daniel Vetter
2016-12-15 9:27 ` Daniel Vetter
2016-12-15 10:51 ` Nicholas Mc Guire
2016-12-15 11:39 ` Daniel Vetter
2016-12-15 9:28 ` Nicholas Mc Guire
2016-12-15 9:52 ` Jani Nikula
2016-12-15 10:10 ` Ville Syrjälä
2016-12-15 10:20 ` Jani Nikula
2016-12-15 10:34 ` Nicholas Mc Guire
2016-12-15 11:48 ` Jani Nikula
2016-12-15 11:51 ` Ville Syrjälä
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=87wpf1pnj2.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hofrat@osadl.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shashank.sharma@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox