Re: BUG: lock held when returning to user space

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Walker
Date: Thursday, March 13, 2008 - 8:43 am

On Wed, 2008-03-12 at 22:40 +0100, Jiri Kosina wrote:


There's a number of places where a semaphore is used across system
calls. 

for instance the usb skeleton, 
	drivers/usb/usb-skeleton.c

Several of the watchdog drivers,
	drivers/watchdog/s3c2410_wdt.c

These need to be removed, but the usage is clearly not compatible with
the mutex API ..

If you convert them to atomic counts then you loose the sleeping aspect
of the semaphore, which you'd have to add back somehow.

The only API that seems straight forward is using complete's .. Then you
get an atomic count and all the sleeping function calls you might want..
(include/linux/completion.h) The problem with complete's is that you
can't start them out at "1" or "completed" unless you actually run
complete() once during initialization (that's kind of ugly) ..

Daniel

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
BUG: lock held when returning to user space, Frank Munzert, (Wed Mar 12, 8:45 am)
Re: BUG: lock held when returning to user space, Vegard Nossum, (Wed Mar 12, 9:29 am)
Re: BUG: lock held when returning to user space, Jiri Kosina, (Wed Mar 12, 2:40 pm)
Re: BUG: lock held when returning to user space, Daniel Walker, (Thu Mar 13, 8:43 am)
Re: BUG: lock held when returning to user space, Peter Zijlstra, (Thu Mar 13, 10:39 am)
Re: BUG: lock held when returning to user space, Daniel Walker, (Thu Mar 13, 10:56 am)