public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: RANDAZZO@ddc-web.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: FW: spinlocks dont work
Date: Sat, 14 Feb 2004 01:26:16 +0000	[thread overview]
Message-ID: <20040214012616.GF31199@mail.shareable.org> (raw)
In-Reply-To: <89760D3F308BD41183B000508BAFAC4104B16F74@DDCNYNTD>

RANDAZZO@ddc-web.com wrote:
> Note the following example:
> 
> driver 'A' calls spin_lock_irqsave and gets through (but does not call
> ..unlock).
> driver 'B' calls spin_lock_irqsave and gets through???
> 
> How can B get through if A did not unlock yet?

Is that code from B an interrupt handler?
If yes, then A should have called spin_lock_irqsave()

Otherwise, is that code from B a softirq or tasklet or timer handler?
If yes, then A should have called spin_lock_bh()

Otherwise, that code from B cannot run unless you are calling
schedule() from A after taking the lock, which is a bug in your code.

-- Jamie

      parent reply	other threads:[~2004-02-14  1:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-13 21:12 FW: spinlocks dont work RANDAZZO
2004-02-13 21:34 ` Tim Hockin
2004-02-13 22:41 ` Brian Gerst
2004-02-14  1:22   ` Jamie Lokier
2004-02-14  1:26 ` Jamie Lokier [this message]

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=20040214012616.GF31199@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=RANDAZZO@ddc-web.com \
    --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