Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756713AbZGEPUP (ORCPT ); Sun, 5 Jul 2009 11:20:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755644AbZGEPUD (ORCPT ); Sun, 5 Jul 2009 11:20:03 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51269 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753701AbZGEPUC (ORCPT ); Sun, 5 Jul 2009 11:20:02 -0400 Date: Sun, 5 Jul 2009 08:19:40 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Paul Mundt cc: Wu Zhangjin , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Krzysztof Helt , Peter Zijlstra , "Rafael J. Wysocki" , Andrew Morton , Ralf Baechle , ???? , zhangfx Subject: Re: [BUG] drivers/video/sis: deadlock introduced by "fbdev: add mutex for fb_mmap locking" In-Reply-To: <20090705150134.GB8326@linux-sh.org> Message-ID: References: <1246785112.14240.34.camel@falcon> <20090705145203.GA8326@linux-sh.org> <20090705150134.GB8326@linux-sh.org> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) 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: 1364 Lines: 35 On Mon, 6 Jul 2009, Paul Mundt wrote: > > > > Why not "lock" as well? > > I had that initially, but matroxfb will break if we do that, and > presently nothing cares about trying to take ->lock that early on. I really would rather have consistency than some odd rules like that. In particular - if matroxfb is different and needs its own lock initialization because it doesn't use the common allocation routine, then please make _that_ consistent too. Rather than have it special-case just one lock that it needs to initialize separately, make it clear that since it does its own allocations it needs to initialize _everything_ separately. Otherwise anybody grepping for things will always be confused, since depending on random factors they'll notice the initializations in one place or the other, and then do the wrong thing - exactly like mm_lock was not correctly initialized this time around. In other words: it's actually _better_ to make the matroxfb pain _more_ obvious rather than less. And maybe we can deprecate the driver, throw it out entirely, or have somebody actually fix it? Linus -- 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/