mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: florin@iucha.net (Florin Iucha)
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: "upping" a semaphore from interrupt context?
Date: Fri, 22 Jun 2007 12:38:39 -0500	[thread overview]
Message-ID: <20070622173839.GB8398@iucha.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

Hello,

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?

I know the completion handler runs in interrupt context so you are not
allowed to acquire any semaphores: but can you release them?  Will the
waiting tasks wake up after the handler and its caller returned - IOW
will the waking up task run in interrupt context as well?

This is with Linux 2.4 (if it makes a difference).

Thanks,
florin

-- 
Bruce Schneier expects the Spanish Inquisition.
      http://geekz.co.uk/schneierfacts/fact/163

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2007-06-22 17:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-22 17:38 Florin Iucha [this message]
2007-06-22 17:34 ` Arnd Bergmann
2007-06-23 11:52   ` Robert P. J. Day
2007-06-23 12:02     ` Arnd Bergmann
2007-06-23 12:06       ` Robert P. J. Day
2007-06-23 15:42       ` Satyam Sharma
2007-06-23 15:52         ` Oliver Neukum
2007-06-23 17:02           ` Satyam Sharma
2007-06-23 16:11         ` Robert P. J. Day
2007-06-23 17:16           ` Satyam Sharma
2007-06-24 15:25             ` Robert P. J. Day
2007-06-24 16:45               ` Satyam Sharma
2007-06-24 16:59                 ` Robert P. J. Day
2007-06-24 18:12                   ` Satyam Sharma
2007-06-22 17:50 ` Satyam Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070622173839.GB8398@iucha.net \
    --to=florin@iucha.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®