From patchwork Tue Aug 18 22:42:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 31606 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id DE435B7DCA for ; Wed, 19 Aug 2009 08:43:18 +1000 (EST) Received: by ozlabs.org (Postfix) id CFDACDDD1B; Wed, 19 Aug 2009 08:43:18 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id CDD03DDD01 for ; Wed, 19 Aug 2009 08:43:18 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 66C5FB85E4 for ; Wed, 19 Aug 2009 08:43:09 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id C5AF7B7087 for ; Wed, 19 Aug 2009 08:43:01 +1000 (EST) Received: by ozlabs.org (Postfix) id 9CEE0DDD1B; Wed, 19 Aug 2009 08:43:01 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 10DF9DDD01 for ; Wed, 19 Aug 2009 08:43:00 +1000 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id n7IMgNWc015986; Tue, 18 Aug 2009 17:42:24 -0500 From: Kumar Gala To: Linus Torvalds Subject: [PATCH] spinlock: __raw_spin_is_locked() should return true for UP Date: Tue, 18 Aug 2009 17:42:23 -0500 Message-Id: <1250635343-32546-1-git-send-email-galak@kernel.crashing.org> X-Mailer: git-send-email 1.6.0.6 Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, linuxppc-dev@ozlabs.org, mingo@elte.hu, tglx@linutronix.de X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org For some reason __raw_spin_is_locked() has been returning false for the uni-processor, non-CONFIG_DEBUG_SPINLOCK. The UP + CONFIG_DEBUG_SPINLOCK handles this correctly. Found this by enabling CONFIG_DEBUG_VM on PPC and hitting always hitting a BUG_ON that was testing to make sure the pte_lock was held. Signed-off-by: Kumar Gala --- Linus, a fix for 2.6.31 include/linux/spinlock_up.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index d4841ed..2b372e0 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h @@ -57,7 +57,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) #define __raw_write_unlock(lock) do { (void)(lock); } while (0) #else /* DEBUG_SPINLOCK */ -#define __raw_spin_is_locked(lock) ((void)(lock), 0) +#define __raw_spin_is_locked(lock) ((void)(lock), 1) /* for sched.c and kernel_lock.c: */ # define __raw_spin_lock(lock) do { (void)(lock); } while (0) # define __raw_spin_lock_flags(lock, flags) do { (void)(lock); } while (0)