From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
axboe@suse.de,
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
torvalds@osdl.org
Subject: Resend: PATCH: Stop 2.6.12rc rmmod from being able to destroy CD hardware
Date: Fri, 27 May 2005 13:18:08 +0100 [thread overview]
Message-ID: <1117196287.5743.186.camel@localhost.localdomain> (raw)
On an rmmod the cdrom layer when used with ide-cd issues a cache flush
atapi command to devices including those that do not support it.
According to Jens earlier discussion this isn't merely a minor glitch
but can destroy some CD hardware due to firmware bugs in the drive (as
per the Mandrake incident)
The IDE CD layer uses a mask of unsupported features, this means that
because ide-cd doesn't know about MRW writables it doesn't set the
relevant bit for non writables and harm can occur.
The simple fix is attached, making the driver start from ~0 and mask
bits the other direction would longer term be safer.
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12rc3/drivers/ide/ide-cd.c linux-2.6.12rc3-minoride/drivers/ide/ide-cd.c
--- linux.vanilla-2.6.12rc3/drivers/ide/ide-cd.c 2005-04-27 16:01:29.000000000 +0100
+++ linux-2.6.12rc3-minoride/drivers/ide/ide-cd.c 2005-05-01 14:09:35.000000000 +0100
@@ -2860,6 +2922,9 @@
devinfo->mask |= CDC_CLOSE_TRAY;
if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
devinfo->mask |= CDC_MO_DRIVE;
+
+ /* We must have this masked unless a drive definitely handles it */
+ devinfo->mask |= CDC_MRW_W;
devinfo->disk = info->disk;
return register_cdrom(devinfo);
next reply other threads:[~2005-05-27 12:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-27 12:18 Alan Cox [this message]
2005-05-27 14:27 ` Bartlomiej Zolnierkiewicz
2005-05-27 14:54 ` Linus Torvalds
2005-05-27 14:58 ` 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=1117196287.5743.186.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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®