Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754817AbYAQBR5 (ORCPT ); Wed, 16 Jan 2008 20:17:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753545AbYAQBRi (ORCPT ); Wed, 16 Jan 2008 20:17:38 -0500 Received: from wx-out-0506.google.com ([66.249.82.224]:39089 "EHLO wx-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbYAQBRg (ORCPT ); Wed, 16 Jan 2008 20:17:36 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=maxKZKaYhB9a2/2kysIEcBxAp8lNRi89XQxez2gxx5FckQkM6OHfYhPGo4HaeB4hWzJJVZ3Woew+AwW5DUi3JOm6uG+djHkFGBBVGW0IMppGpz6sA6ZrcSO2gcZ+p+YXmQYtBGlUDfRZjr9pl9Asreb5Qz4JpJKdkOXmIQnl3EQ= Message-ID: Date: Thu, 17 Jan 2008 09:17:35 +0800 From: "Dave Young" To: "Jarek Poplawski" Subject: Re: [PATCH 7/7] driver-core : convert semaphore to mutex in struct class Cc: "Greg KH" , stefanr@s5r6.in-berlin.de, david-b@pacbell.net, stern@rowland.harvard.edu, linux-kernel@vger.kernel.org In-Reply-To: <20080116083442.GA2307@ff.dom.local> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080112100515.GA2956@darkstar.te-china.tietoenator.com> <20080115091527.GB3186@darkstar.te-china.tietoenator.com> <20080115135604.GD1696@ff.dom.local> <20080116083442.GA2307@ff.dom.local> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1348 Lines: 48 On Jan 16, 2008 4:34 PM, Jarek Poplawski wrote: > On Wed, Jan 16, 2008 at 09:03:03AM +0800, Dave Young wrote: > ... > > The lockdep warining was posted in the below thread, actually, I have > > built and run this patced kernel for several days, there's no more > > warnings. > > http://lkml.org/lkml/2008/1/3/2 > > Right... But, with something like this: > > ... have_some_fun(... cls) > { > mutex_lock_nested(&cls->mutex, SINGLE_DEPTH_NESTING); > have_other_fun(cls); > mutex_unlock(&cls->mutex); > > } > > ... have_more_fun(...) > { > ... > > mutex_init(&cls->mutex); > > mutex_lock(&cls->mutex); > have_some_fun(cls); > mutex_unlock(&cls->mutex); > } > > probably you wouldn't get any lockdep warning too... Sorry for late reply. Actually, I don't know much about lockdep. Could you tell how to use it properly in this scenario? > > Of course, if we know all the locking is right such proper lockdep > annotating shouldn't matter too much. (And of course this could be > improved later.) > > Regards, > Jarek P. > -- 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/