linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
	Jens Axboe <axboe@suse.de>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: IDE locking problem
Date: 03 Aug 2003 10:42:29 +0200	[thread overview]
Message-ID: <1059900149.3524.84.camel@gaston> (raw)

Hi Alan & Bart !

While fixing my hotswap media-bay IDE controller for 2.6, I found
a locking problem with IDE (again ? :) in ide_unregister_hw. Basically
the problem is that it calls blk_cleanup_queue(), which is unsafe to
call with a lock held (it will call flush_workqueue() at one point).
Other side effect, flush_workqueue() will re-enable IRQs, thus allowing
us to get an IRQ while holding the spinlock -> double lock, but that's
just a side effect of calling flush_workqueue in that context.

So the call to blk_cleanup_queue() shall be moved outside of the
spinlock. I don't know much about the BIO details, is it possible
to first unregister_blkdev, then only call blk_cleanup_queue() ? That
would help making sure we don't get a request sneaking in ?

Ben.



             reply	other threads:[~2003-08-03  8:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-03  8:42 Benjamin Herrenschmidt [this message]
2003-08-03  9:58 ` IDE locking problem Benjamin Herrenschmidt
2003-08-05  0:28   ` Bartlomiej Zolnierkiewicz
2003-08-05  8:08     ` Benjamin Herrenschmidt
2003-08-05 10:49       ` Bartlomiej Zolnierkiewicz
2003-08-05 11:18         ` Benjamin Herrenschmidt
2003-08-05 12:30           ` Bartlomiej Zolnierkiewicz
2003-08-05 17:13             ` Alan Cox
2003-08-03 10:04 ` Jens Axboe
2003-08-03 10:08   ` Jens Axboe
2003-08-03 10:11   ` Benjamin Herrenschmidt
2003-08-03 10:20     ` Jens Axboe
2003-08-03 14:13 Manfred Spraul
2003-08-03 14:25 ` Benjamin Herrenschmidt
2003-08-03 15:35   ` Lou Langholtz
2003-08-04  5:40     ` Jens Axboe

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=1059900149.3524.84.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).