From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
linux-ide@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: IDE deadlock on CRC errors
Date: Sun, 28 Nov 2004 16:02:12 +0000 [thread overview]
Message-ID: <1101657731.16756.15.camel@localhost.localdomain> (raw)
do_reset1 takes the ide lock and disables interrupts
calls pre_reset
calls check_dma_crc
calls ide_set_xfer_rate
calls ->speedproc
blah_tune_chipset)
calls ide_config_drive_speed
disable_irq_nosync
drops IRQ mask
Wait up to ten seconds
Unfortunately an IRQ can arrive before the disable_irq_nosync and in
that situation we drop the IRQ mask, and the pending _intr routines
deadlock. If we remove the _nosync then the IDE layer deadlocks on the
disable_irq. If we drop the lock then we change the locking semantics
for all IDE drivers on speedproc handling, and some rely on it by
inspection.
I can see some possible ways to fix this but none of them are exactly
trivial because they change the locking or ordering around a lot. The
cleanest is probably to bite the bullet and leave speedproc internal
locking to the drivers. This also clean up a variety of up to two second
delays. As far as I can see speedproc is never called with work
outstanding. Another approach might be to queue the speedproc command to
head of queue, remove the whacked out special case logic and let the IDE
command engine do the right thing.
There is a second deadlock in ide_abort when you call the reset function
from ioctl status at the wrong time. I'll take a look into that since I
wrote the original ide_abort code and the bug. I don't however really
have time to look at the CRC deadlock until I've had a chance to fix the
fact ide-cdrom is unsafe/unsable with CD-R/CD-RW media on some drivess
in 2.6.9 when doing disk copies/compares or mount without the -t flag
(so next year at the earliest)
reply other threads:[~2004-11-28 17:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1101657731.16756.15.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=linux-ide@vger.kernel.org \
--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