[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0706230751230.4164@localhost.localdomain>
Date: Sat, 23 Jun 2007 07:52:51 -0400 (EDT)
From: "Robert P. J. Day" <rpjday@...dspring.com>
To: Arnd Bergmann <arnd@...db.de>
cc: Florin Iucha <florin@...ha.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: "upping" a semaphore from interrupt context?
On Fri, 22 Jun 2007, Arnd Bergmann wrote:
> On Friday 22 June 2007, Florin Iucha wrote:
> > I am writing a USB driver for some custom hardware, and I need to
> > synchronize between the user-space and the USB subsystem. Can I
> > create a semaphore and "down" it in the reader then "up" it in the
> > completion handler?
>
> yes, but you should not. The use of semaphores is not recommended
> for new code, it should be replaced with either a mutex or a
> completion.
can you clarify this? it sounds like you're saying that the current
implementation of semaphores is entirely superfluous. but surely it
isn't possible to replace all semaphores with either mutexes or
completions, is it?
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
Powered by blists - more mailing lists