mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@cimice.maxinet.cz>
To: Oliver Neukum <oliver@neukum.name>
Cc: Thunder from the hill <thunder@lightweight.ods.org>,
	Ralf Baechle <ralf@uni-koblenz.de>,
	linux-kernel@vger.kernel.org
Subject: Re: question on spinlocks
Date: Tue, 3 Sep 2002 00:30:26 +0200	[thread overview]
Message-ID: <20020902223026.GB30964@vagabond> (raw)
In-Reply-To: <200209020033.23113.oliver@neukum.name>

On Mon, Sep 02, 2002 at 12:33:23AM +0200, Oliver Neukum wrote:
> Am Montag, 2. September 2002 00:09 schrieb Thunder from the hill:
> > Hi,
> >
> > On Mon, 2 Sep 2002, Oliver Neukum wrote:
> > > > > No; spin_lock_irqsave/spin_unlock_irqrestore and
> > > > > spin_lock/spin_unlock have to be used in matching pairs.
> > > >
> > > > If it was his least problem! He'll run straight into a "schedule
> > > > w/IRQs disabled" bug.
> > >
> > > OK, how do I drop an irqsave spinlock if I don't have flags?
> >
> > IMHO you might even ask "How do I start a car when I don't have the
> > keys?"
> 
> Break off the lock, touch some cables ... ;-)
> 
> > You might find a way, but it's not desired. Are you sure you want to
> > reschedule in an interrupt handler? If it's none, are you sure you want
> > to disable interrupts?
> 
> I am not in an interrupt handler. It's not my fault that the scsi layer
> calls queuecommand with a spinlock held. But I need to sleep,
> I have to get rid of that spinlock's effects. If possible I even want
> interrupts to be enabled.

If it's calling it with spinlock held, it probably relies on that it
won't be sleeping. So you either have to avoid sleeping (start now,
finish in tasklet) or patch the calling code.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

  reply	other threads:[~2002-09-04  8:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-01 17:27 Oliver Neukum
2002-09-01 19:05 ` Ralf Baechle
2002-09-01 21:53   ` Thunder from the hill
2002-09-01 22:02     ` Oliver Neukum
2002-09-01 22:09       ` Thunder from the hill
2002-09-01 22:11         ` Robert Love
2002-09-01 22:33         ` Oliver Neukum
2002-09-02 22:30           ` Jan Hudec [this message]
2002-09-03 22:13           ` george anzinger
2002-09-01 22:11       ` Robert Love
2002-09-01 22:08     ` Robert Love
2002-09-01 22:16       ` Thunder from the hill
     [not found]     ` <mailman.1030918200.24262.linux-kernel2news@redhat.com>
2002-09-03 20:09       ` Pete Zaitcev

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=20020902223026.GB30964@vagabond \
    --to=bulb@cimice.maxinet.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver@neukum.name \
    --cc=ralf@uni-koblenz.de \
    --cc=thunder@lightweight.ods.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®