From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis Claudio R. Goncalves" Subject: Re: [ANNOUNCE] 3.8.4-rt1 Date: Sat, 23 Mar 2013 22:15:53 -0300 Message-ID: <20130324011553.GA3184@uudg.org> References: <20130323013003.GU11538@uudg.org> <20130323183827.GA31738@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Thomas Gleixner , linux-rt-users To: Sebastian Andrzej Siewior Return-path: Received: from mail-gg0-f171.google.com ([209.85.161.171]:52010 "EHLO mail-gg0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752576Ab3CXBQA (ORCPT ); Sat, 23 Mar 2013 21:16:00 -0400 Received: by mail-gg0-f171.google.com with SMTP id j1so274087ggn.2 for ; Sat, 23 Mar 2013 18:15:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130323183827.GA31738@linutronix.de> Sender: linux-rt-users-owner@vger.kernel.org List-ID: On Sat, Mar 23, 2013 at 07:38:27PM +0100, Sebastian Andrzej Siewior wro= te: | * Luis Claudio R. Goncalves | 2013-03-22 22:30:03 [-0300]: |=20 | What about this: |=20 | diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i= 915_gem.c | index de45b60..9b51712 100644 | --- a/drivers/gpu/drm/i915/i915_gem.c | +++ b/drivers/gpu/drm/i915/i915_gem.c | @@ -91,7 +91,6 @@ i915_gem_wait_for_error(struct drm_device *dev) | { | struct drm_i915_private *dev_priv =3D dev->dev_private; | struct completion *x =3D &dev_priv->error_completion; | - unsigned long flags; | int ret; | =20 | if (!atomic_read(&dev_priv->mm.wedged)) | @@ -116,9 +115,7 @@ i915_gem_wait_for_error(struct drm_device *dev) | * end up waiting upon a subsequent completion event that | * will never happen. | */ | - spin_lock_irqsave(&x->wait.lock, flags); | - x->done++; | - spin_unlock_irqrestore(&x->wait.lock, flags); | + complete(x); | } | return 0; | } | @@ -946,12 +943,9 @@ i915_gem_check_wedge(struct drm_i915_private *de= v_priv, | if (atomic_read(&dev_priv->mm.wedged)) { | struct completion *x =3D &dev_priv->error_completion; | bool recovery_complete; | - unsigned long flags; | =20 | /* Give the error handler a chance to run. */ | - spin_lock_irqsave(&x->wait.lock, flags); | - recovery_complete =3D x->done > 0; | - spin_unlock_irqrestore(&x->wait.lock, flags); | + recovery_complete =3D completion_done(x); | =20 | /* Non-interruptible callers can't handle -EAGAIN, hence return | * -EIO unconditionally for these. */ Good catch. The resulting code is cleaner. I took the simplest approach= while trying to fix the issue, but your solution is more elegant. | @@ -4366,7 +4360,7 @@ static bool mutex_is_locked_by(struct mutex *mu= tex, struct task_struct *task) | if (!mutex_is_locked(mutex)) | return false; | =20 | -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES) | +#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)) && !defin= ed(CONFIG_PREEMPT_RT_BASE) | return mutex->owner =3D=3D task; | #else | /* Since UP may be pre-empted, we cannot assume that we own the loc= k */ I was trying to keep the behavior of CONFIG_DEBUG_MUTEXES, but we do ha= ve the RT counterpart, CONFIG_DEBUG_RT_MUTEXES. So, yours is probably the right one. | I'm not very happy with the complete() here, I am not sure what kind = of | problem they try to solve here=E2=80=A6 I was looking at the code and IMHO it seems to fit there perfectly. Cheers, Luis -- To unsubscribe from this list: send the line "unsubscribe linux-rt-user= s" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html