From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v4] drm/i915: Use a spin lock to protect the pipe crc struct Date: Tue, 22 Oct 2013 00:27:16 +0200 Message-ID: <20131021222716.GN4830@phenom.ffwll.local> References: <20131018132118.GW4830@phenom.ffwll.local> <1382362170-1686-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) by gabe.freedesktop.org (Postfix) with ESMTP id 57C05E5D39 for ; Mon, 21 Oct 2013 15:26:56 -0700 (PDT) Received: by mail-ea0-f179.google.com with SMTP id b10so3824918eae.10 for ; Mon, 21 Oct 2013 15:26:54 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1382362170-1686-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Oct 21, 2013 at 02:29:30PM +0100, Damien Lespiau wrote: > Daniel pointed out that it was hard to get anything lockless to work > correctly, so don't even try for this non critical piece of code and > just use a spin lock. > > v2: Make intel_pipe_crc->opened a bool > v3: Use assert_spin_locked() instead of a comment (Daniel Vetter) > v4: Use spin_lock_irq() in the debugfs functions (they can only be > called from process context), > Use spin_lock() in the pipe_crc_update() function that can only be > called from an interrupt handler, > Use wait_event_interruptible_lock_irq() when waiting for data in the > cicular buffer to ensure proper locking around the condition we are > waiting for. (Daniel Vetter) > > Suggested-by: Daniel Vetter > Signed-off-by: Damien Lespiau Queued for -next, thanks for the patch. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch