From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] drm/i915: drop locking from asle pipestat enable
Date: Tue, 30 Apr 2013 10:47:58 +0200 [thread overview]
Message-ID: <20130430084758.GD6169@phenom.ffwll.local> (raw)
In-Reply-To: <0a77d3e8564ea40866fe5b301d68e49120e7213d.1367223972.git.jani.nikula@intel.com>
On Mon, Apr 29, 2013 at 01:02:55PM +0300, Jani Nikula wrote:
> Enable asle pipestat earlier in i915/i965 irq postinstall to not need
> irq_lock in i915_enable_asle_pipestat().
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Honestly I'm not too fond of too clever init sequence ordering - we
already get the inherent constraints of the setup sequence wrong way too
often. Trying to avoid a spinlock at setup time with clever ordering feels
like the wrong tradeoff here.
So I'd prefer a WARN(!spin_is_locked) instead in enable_pipestat (plus
lock grabbing in the vlv/i965 postinstall code).
All other patches from this series merged, thanks.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_irq.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 03a31be..0243db1 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -354,18 +354,13 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask)
> static void i915_enable_asle_pipestat(struct drm_device *dev)
> {
> drm_i915_private_t *dev_priv = dev->dev_private;
> - unsigned long irqflags;
>
> if (!dev_priv->opregion.asle || !IS_MOBILE(dev))
> return;
>
> - spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> -
> i915_enable_pipestat(dev_priv, 1, PIPE_LEGACY_BLC_EVENT_ENABLE);
> if (INTEL_INFO(dev)->gen >= 4)
> i915_enable_pipestat(dev_priv, 0, PIPE_LEGACY_BLC_EVENT_ENABLE);
> -
> - spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
> }
>
> /**
> @@ -2953,6 +2948,8 @@ static int i915_irq_postinstall(struct drm_device *dev)
> I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT |
> I915_USER_INTERRUPT;
>
> + i915_enable_asle_pipestat(dev);
> +
> if (I915_HAS_HOTPLUG(dev)) {
> I915_WRITE(PORT_HOTPLUG_EN, 0);
> POSTING_READ(PORT_HOTPLUG_EN);
> @@ -2967,8 +2964,6 @@ static int i915_irq_postinstall(struct drm_device *dev)
> I915_WRITE(IER, enable_mask);
> POSTING_READ(IER);
>
> - i915_enable_asle_pipestat(dev);
> -
> return 0;
> }
>
> @@ -3178,6 +3173,7 @@ static int i965_irq_postinstall(struct drm_device *dev)
> enable_mask |= I915_BSD_USER_INTERRUPT;
>
> i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE);
> + i915_enable_asle_pipestat(dev);
>
> /*
> * Enable some error detection, note the instruction error mask
> @@ -3201,8 +3197,6 @@ static int i965_irq_postinstall(struct drm_device *dev)
> I915_WRITE(PORT_HOTPLUG_EN, 0);
> POSTING_READ(PORT_HOTPLUG_EN);
>
> - i915_enable_asle_pipestat(dev);
> -
> return 0;
> }
>
> --
> 1.7.9.5
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-04-30 8:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 10:02 [PATCH 0/6] opregion asle enable cleanups Jani Nikula
2013-04-29 10:02 ` [PATCH 1/6] drm/i915: cleanup opregion technology enabled indicator defines Jani Nikula
2013-04-29 11:12 ` Damien Lespiau
2013-04-29 10:02 ` [PATCH 2/6] drm/i915: manage opregion asle driver readiness properly Jani Nikula
2013-04-29 11:23 ` Damien Lespiau
2013-04-29 10:02 ` [PATCH 3/6] drm/i915: untie opregion init and asle irq/pipestat enable Jani Nikula
2013-04-29 11:24 ` Damien Lespiau
2013-04-29 11:29 ` Damien Lespiau
2013-04-29 11:34 ` Damien Lespiau
2013-04-29 10:02 ` [PATCH 4/6] drm/i915: cleanup redundant checks from intel_enable_asle Jani Nikula
2013-04-29 11:30 ` Damien Lespiau
2013-04-29 10:02 ` [PATCH 5/6] drm/i915: cleanup opregion asle pipestat enable Jani Nikula
2013-04-29 11:36 ` Damien Lespiau
2013-04-29 10:02 ` [PATCH 6/6] drm/i915: drop locking from " Jani Nikula
2013-04-29 11:37 ` Damien Lespiau
2013-04-30 8:47 ` Daniel Vetter [this message]
2013-04-30 11:30 ` [PATCH] drm/i915: make locking requirement for pipestat changes more explicit Jani Nikula
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=20130430084758.GD6169@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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