public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: Protect force_bit with gmbus_mutex
Date: Mon, 11 Apr 2016 12:24:52 +0300	[thread overview]
Message-ID: <87zit0ts4b.fsf@intel.com> (raw)
In-Reply-To: <1457366220-29409-3-git-send-email-ville.syrjala@linux.intel.com>

On Mon, 07 Mar 2016, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Extend the protection of gmbus_mutex around the force_bit
> RMW in intel_gmbus_force_bit(), in case someone gets the
> idea of calling it from a separate thread while there's
> other stuff happening on the same bus.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

intel_gmbus_is_forced_bit() usage in intel_crt_get_edid() seems a bit
suspect still, but this is a step forward.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_i2c.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index 52fbe530fc9e..7bf8a485e18f 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -718,11 +718,16 @@ void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed)
>  void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit)
>  {
>  	struct intel_gmbus *bus = to_intel_gmbus(adapter);
> +	struct drm_i915_private *dev_priv = bus->dev_priv;
> +
> +	mutex_lock(&dev_priv->gmbus_mutex);
>  
>  	bus->force_bit += force_bit ? 1 : -1;
>  	DRM_DEBUG_KMS("%sabling bit-banging on %s. force bit now %d\n",
>  		      force_bit ? "en" : "dis", adapter->name,
>  		      bus->force_bit);
> +
> +	mutex_unlock(&dev_priv->gmbus_mutex);
>  }
>  
>  void intel_teardown_gmbus(struct drm_device *dev)

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-11  9:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07 15:56 [PATCH 0/4] drm/i915: GMBUS fixes and whatnot ville.syrjala
2016-03-07 15:56 ` [PATCH 1/4] drm/i915: Actually retry with bit-banging after GMBUS timeout ville.syrjala
2016-03-07 17:06   ` Jani Nikula
2016-03-09 15:13     ` Ville Syrjälä
2016-03-07 15:56 ` [PATCH 2/4] drm/i915: Protect force_bit with gmbus_mutex ville.syrjala
2016-04-11  9:24   ` Jani Nikula [this message]
2016-03-07 15:56 ` [PATCH 3/4] drm/i915: Restore GMBUS operation after a failed bit-banging fallback ville.syrjala
2016-04-11  9:50   ` Jani Nikula
2016-04-12 12:17     ` Ville Syrjälä
2016-03-07 15:57 ` [PATCH 4/4] drm/i915: Make GMBUS timeout message DRM_DEBUG_KMS ville.syrjala
2016-04-11  7:29   ` Ville Syrjälä
2016-04-11  8:19     ` Chris Wilson
2016-04-11 15:31       ` Ville Syrjälä
2016-03-08  7:25 ` ✗ Fi.CI.BAT: warning for drm/i915: GMBUS fixes and whatnot Patchwork
2016-03-09 15:12   ` 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=87zit0ts4b.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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