All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [RFC 1/4] drm/i915: split out uncore_mmio_debug
Date: Wed, 26 Jun 2019 11:02:26 +0100	[thread overview]
Message-ID: <156154334639.2637.9988052891636686902@skylake-alporthouse-com> (raw)
In-Reply-To: <20190624203152.13725-2-daniele.ceraolospurio@intel.com>

Quoting Daniele Ceraolo Spurio (2019-06-24 21:31:49)
> @@ -605,18 +614,20 @@ void intel_uncore_forcewake_get(struct intel_uncore *uncore,
>  void intel_uncore_forcewake_user_get(struct intel_uncore *uncore)
>  {
>         spin_lock_irq(&uncore->lock);
> +       spin_lock(&uncore->debug->lock);
>         if (!uncore->user_forcewake.count++) {

Afaict, uncore->user_forcewake.count is only guarded by uncore->lock
and we only need to take debug->lock for the debug->unclaimed_mmio_check
manipulation. But there needs to be a shared usage counter around the
debug as it is shared state.

>                 intel_uncore_forcewake_get__locked(uncore, FORCEWAKE_ALL);
>  
>                 /* Save and disable mmio debugging for the user bypass */
>                 uncore->user_forcewake.saved_mmio_check =
> -                       uncore->unclaimed_mmio_check;
> +                       uncore->debug->unclaimed_mmio_check;
>                 uncore->user_forcewake.saved_mmio_debug =
>                         i915_modparams.mmio_debug;

Something more like

spin_lock_irq(&uncore->lock);
if (!uncore->user_forcewake_count++) {
	spin_lock(&uncore->debug->lock);
	if (!uncore->debug->usage_count++) {
		...
	}
	spin_unlock(&uncore->debug->lock);
}
...
spin_unlock_irq(&uncore->lock);
?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-06-26 10:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 20:31 [RFC 0/4] Display uncore Daniele Ceraolo Spurio
2019-06-24 20:31 ` [RFC 1/4] drm/i915: split out uncore_mmio_debug Daniele Ceraolo Spurio
2019-06-26 10:02   ` Chris Wilson [this message]
2019-06-26 17:38     ` Daniele Ceraolo Spurio
2019-06-26 17:58       ` Chris Wilson
2019-06-26 18:20         ` Daniele Ceraolo Spurio
2019-06-24 20:31 ` [RFC 2/4] drm/i915: rework mmio debug stop/start Daniele Ceraolo Spurio
2019-06-24 20:31 ` [RFC 3/4] drm/i915: introduce display_uncore Daniele Ceraolo Spurio
2019-06-26 18:42   ` Ville Syrjälä
2019-06-26 20:27     ` Daniele Ceraolo Spurio
2019-06-27 12:41       ` Ville Syrjälä
2019-06-24 20:31 ` [RFC 4/4] drm/i915: convert intel_hdmi to display reg accessors Daniele Ceraolo Spurio
2019-06-24 20:43 ` ✗ Fi.CI.SPARSE: warning for Display uncore (rev2) Patchwork
2019-06-24 21:37 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-25  1:04 ` ✓ Fi.CI.IGT: " Patchwork

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=156154334639.2637.9988052891636686902@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.