lkml.org 
[lkml]   [2008]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] driver-core : convert semaphore to mutex in struct class
On Jan 16, 2008 4:34 PM, Jarek Poplawski <jarkao2@gmail.com> 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.
>


\
 
 \ /
  Last update: 2008-01-17 02:21    [W:0.116 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site