Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755982Ab1CAVi2 (ORCPT ); Tue, 1 Mar 2011 16:38:28 -0500 Received: from www.tglx.de ([62.245.132.106]:43721 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755534Ab1CAVi2 (ORCPT ); Tue, 1 Mar 2011 16:38:28 -0500 Date: Tue, 1 Mar 2011 22:38:10 +0100 (CET) From: Thomas Gleixner To: "TK, Pratheesh Gangadhar" cc: "Hans J. Koch" , "linux-kernel@vger.kernel.org" , "gregkh@suse.de" , "sshtylyov@mvista.com" , "arnd@arndb.de" , "Chatterjee, Amit" , "davinci-linux-open-source@linux.davincidsp.com" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH v6 1/1] PRUSS UIO driver support In-Reply-To: Message-ID: References: <1298926895-5294-1-git-send-email-pratheesh@ti.com> <1298926895-5294-2-git-send-email-pratheesh@ti.com> <20110228212638.GB16806@local> <20110301183334.GC20497@local> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1727 Lines: 51 On Wed, 2 Mar 2011, TK, Pratheesh Gangadhar wrote: > Hi, > > -----Original Message----- > > From: Hans J. Koch [mailto:hjk@hansjkoch.de] > > Sent: Wednesday, March 02, 2011 12:04 AM > > To: TK, Pratheesh Gangadhar > > Cc: Hans J. Koch; linux-kernel@vger.kernel.org; gregkh@suse.de; > > tglx@linutronix.de; sshtylyov@mvista.com; arnd@arndb.de; Chatterjee, Amit; > > davinci-linux-open-source@linux.davincidsp.com; linux-arm- > > kernel@lists.infradead.org > > Subject: Re: [PATCH v6 1/1] PRUSS UIO driver support Sigh, can you please use a mailer which does not repeat the headers for no value and just has a single line like this: > > On Tue, Mar 01, 2011 at 10:15:27AM +0530, TK, Pratheesh Gangadhar wrote: > > Anyway, please don't use that kind of argumentation. The next newbie > > developer might copy your work as a basis for his new driver, and there > > it probably won't work. > > > > Simply put the spin_lock_init before the loop. > > > Agree, will fix this in next version. As I said before, we want stuff initialized when it is possibly used. But first of all we ant people to use the proper mechanisms to achive that. If that's a module global lock then it needs to be instantiated by static DEFINE_SPINLOCK(lock); which implies the initialization of the lock. If it's a lock which is in allocated memory then the spin_lock_init(&lock); wants to be before it can be possibly used. So in your case DEFINE_SPINLOCK is the correct solution. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/